fdc.c (db901281608f0c69c05dd9ab366155d3225f0fd2) fdc.c (ada54f9e54741ff8921d27b945990a21147078a1)
1/*
2 * Copyright (c) 1990 The Regents of the University of California.
3 * All rights reserved.
4 *
5 * This code is derived from software contributed to Berkeley by
6 * Don Ahn.
7 *
8 * Libretto PCMCIA floppy support by David Horwitt (dhorwitt@ucsd.edu)

--- 824 unchanged lines hidden (view full) ---

833 device_disable(child);
834}
835
836static int
837fdc_attach(device_t dev)
838{
839 struct fdc_data *fdc;
840 int i, error;
1/*
2 * Copyright (c) 1990 The Regents of the University of California.
3 * All rights reserved.
4 *
5 * This code is derived from software contributed to Berkeley by
6 * Don Ahn.
7 *
8 * Libretto PCMCIA floppy support by David Horwitt (dhorwitt@ucsd.edu)

--- 824 unchanged lines hidden (view full) ---

833 device_disable(child);
834}
835
836static int
837fdc_attach(device_t dev)
838{
839 struct fdc_data *fdc;
840 int i, error;
841 const char *name;
841
842 fdc = device_get_softc(dev);
843 error = fdc_alloc_resources(fdc);
844 if (error) {
845 device_printf(dev, "cannot re-aquire resources\n");
846 return error;
847 }
848 error = BUS_SETUP_INTR(device_get_parent(dev), dev, fdc->res_irq,

--- 16 unchanged lines hidden (view full) ---

865 /* reset controller, turn motor off, clear fdout mirror reg */
866 fdout_wr(fdc, ((fdc->fdout = 0)));
867 bioq_init(&fdc->head);
868
869 /*
870 * Probe and attach any children. We should probably detect
871 * devices from the BIOS unless overridden.
872 */
842
843 fdc = device_get_softc(dev);
844 error = fdc_alloc_resources(fdc);
845 if (error) {
846 device_printf(dev, "cannot re-aquire resources\n");
847 return error;
848 }
849 error = BUS_SETUP_INTR(device_get_parent(dev), dev, fdc->res_irq,

--- 16 unchanged lines hidden (view full) ---

866 /* reset controller, turn motor off, clear fdout mirror reg */
867 fdout_wr(fdc, ((fdc->fdout = 0)));
868 bioq_init(&fdc->head);
869
870 /*
871 * Probe and attach any children. We should probably detect
872 * devices from the BIOS unless overridden.
873 */
873 for (i = resource_query_string(-1, "at", device_get_nameunit(dev));
874 i != -1;
875 i = resource_query_string(i, "at", device_get_nameunit(dev)))
874 name = device_get_nameunit(dev);
875 i = -1;
876 while ((i = resource_query_string(i, "at", name)) != -1)
876 fdc_add_child(dev, resource_query_name(i),
877 resource_query_unit(i));
878
879 return (bus_generic_attach(dev));
880}
881
882static int
883fdc_print_child(device_t me, device_t child)

--- 1567 unchanged lines hidden ---
877 fdc_add_child(dev, resource_query_name(i),
878 resource_query_unit(i));
879
880 return (bus_generic_attach(dev));
881}
882
883static int
884fdc_print_child(device_t me, device_t child)

--- 1567 unchanged lines hidden ---