Merge master.kernel.org:/pub/scm/linux/kernel/git/gregkh/driver-2.6

+362 -260
+2 -2
arch/arm/common/locomo.c
··· 1103 struct bus_type locomo_bus_type = { 1104 .name = "locomo-bus", 1105 .match = locomo_match, 1106 .suspend = locomo_bus_suspend, 1107 .resume = locomo_bus_resume, 1108 }; 1109 1110 int locomo_driver_register(struct locomo_driver *driver) 1111 { 1112 - driver->drv.probe = locomo_bus_probe; 1113 - driver->drv.remove = locomo_bus_remove; 1114 driver->drv.bus = &locomo_bus_type; 1115 return driver_register(&driver->drv); 1116 }
··· 1103 struct bus_type locomo_bus_type = { 1104 .name = "locomo-bus", 1105 .match = locomo_match, 1106 + .probe = locomo_bus_probe, 1107 + .remove = locomo_bus_remove, 1108 .suspend = locomo_bus_suspend, 1109 .resume = locomo_bus_resume, 1110 }; 1111 1112 int locomo_driver_register(struct locomo_driver *driver) 1113 { 1114 driver->drv.bus = &locomo_bus_type; 1115 return driver_register(&driver->drv); 1116 }
+2 -2
arch/arm/common/sa1111.c
··· 1247 struct bus_type sa1111_bus_type = { 1248 .name = "sa1111-rab", 1249 .match = sa1111_match, 1250 .suspend = sa1111_bus_suspend, 1251 .resume = sa1111_bus_resume, 1252 }; 1253 1254 int sa1111_driver_register(struct sa1111_driver *driver) 1255 { 1256 - driver->drv.probe = sa1111_bus_probe; 1257 - driver->drv.remove = sa1111_bus_remove; 1258 driver->drv.bus = &sa1111_bus_type; 1259 return driver_register(&driver->drv); 1260 }
··· 1247 struct bus_type sa1111_bus_type = { 1248 .name = "sa1111-rab", 1249 .match = sa1111_match, 1250 + .probe = sa1111_bus_probe, 1251 + .remove = sa1111_bus_remove, 1252 .suspend = sa1111_bus_suspend, 1253 .resume = sa1111_bus_resume, 1254 }; 1255 1256 int sa1111_driver_register(struct sa1111_driver *driver) 1257 { 1258 driver->drv.bus = &sa1111_bus_type; 1259 return driver_register(&driver->drv); 1260 }
+8 -6
arch/arm/kernel/ecard.c
··· 1147 struct ecard_driver *drv = ECARD_DRV(dev->driver); 1148 struct ecard_request req; 1149 1150 - if (drv->shutdown) 1151 - drv->shutdown(ec); 1152 - ecard_release(ec); 1153 1154 /* 1155 * If this card has a loader, call the reset handler. ··· 1166 int ecard_register_driver(struct ecard_driver *drv) 1167 { 1168 drv->drv.bus = &ecard_bus_type; 1169 - drv->drv.probe = ecard_drv_probe; 1170 - drv->drv.remove = ecard_drv_remove; 1171 - drv->drv.shutdown = ecard_drv_shutdown; 1172 1173 return driver_register(&drv->drv); 1174 } ··· 1194 .name = "ecard", 1195 .dev_attrs = ecard_dev_attrs, 1196 .match = ecard_match, 1197 }; 1198 1199 static int ecard_bus_init(void)
··· 1147 struct ecard_driver *drv = ECARD_DRV(dev->driver); 1148 struct ecard_request req; 1149 1150 + if (dev->driver) { 1151 + if (drv->shutdown) 1152 + drv->shutdown(ec); 1153 + ecard_release(ec); 1154 + } 1155 1156 /* 1157 * If this card has a loader, call the reset handler. ··· 1164 int ecard_register_driver(struct ecard_driver *drv) 1165 { 1166 drv->drv.bus = &ecard_bus_type; 1167 1168 return driver_register(&drv->drv); 1169 } ··· 1195 .name = "ecard", 1196 .dev_attrs = ecard_dev_attrs, 1197 .match = ecard_match, 1198 + .probe = ecard_drv_probe, 1199 + .remove = ecard_drv_remove, 1200 + .shutdown = ecard_drv_shutdown, 1201 }; 1202 1203 static int ecard_bus_init(void)
+18 -18
arch/arm/mach-integrator/lm.c
··· 22 return 1; 23 } 24 25 - static struct bus_type lm_bustype = { 26 - .name = "logicmodule", 27 - .match = lm_match, 28 - // .suspend = lm_suspend, 29 - // .resume = lm_resume, 30 - }; 31 - 32 - static int __init lm_init(void) 33 - { 34 - return bus_register(&lm_bustype); 35 - } 36 - 37 - postcore_initcall(lm_init); 38 - 39 static int lm_bus_probe(struct device *dev) 40 { 41 struct lm_device *lmdev = to_lm_device(dev); ··· 35 struct lm_device *lmdev = to_lm_device(dev); 36 struct lm_driver *lmdrv = to_lm_driver(dev->driver); 37 38 - lmdrv->remove(lmdev); 39 return 0; 40 } 41 42 int lm_driver_register(struct lm_driver *drv) 43 { 44 drv->drv.bus = &lm_bustype; 45 - drv->drv.probe = lm_bus_probe; 46 - drv->drv.remove = lm_bus_remove; 47 - 48 return driver_register(&drv->drv); 49 } 50
··· 22 return 1; 23 } 24 25 static int lm_bus_probe(struct device *dev) 26 { 27 struct lm_device *lmdev = to_lm_device(dev); ··· 49 struct lm_device *lmdev = to_lm_device(dev); 50 struct lm_driver *lmdrv = to_lm_driver(dev->driver); 51 52 + if (lmdrv->remove) 53 + lmdrv->remove(lmdev); 54 return 0; 55 } 56 + 57 + static struct bus_type lm_bustype = { 58 + .name = "logicmodule", 59 + .match = lm_match, 60 + .probe = lm_bus_probe, 61 + .remove = lm_bus_remove, 62 + // .suspend = lm_bus_suspend, 63 + // .resume = lm_bus_resume, 64 + }; 65 + 66 + static int __init lm_init(void) 67 + { 68 + return bus_register(&lm_bustype); 69 + } 70 + 71 + postcore_initcall(lm_init); 72 73 int lm_driver_register(struct lm_driver *drv) 74 { 75 drv->drv.bus = &lm_bustype; 76 return driver_register(&drv->drv); 77 } 78
+8 -8
arch/ia64/sn/kernel/tiocx.c
··· 77 kfree(to_cx_dev(dev)); 78 } 79 80 - struct bus_type tiocx_bus_type = { 81 - .name = "tiocx", 82 - .match = tiocx_match, 83 - .uevent = tiocx_uevent, 84 - }; 85 - 86 /** 87 * cx_device_match - Find cx_device in the id table. 88 * @ids: id table from driver ··· 143 return 0; 144 } 145 146 /** 147 * cx_driver_register - Register the driver. 148 * @cx_driver: driver table (cx_drv struct) from driver ··· 164 { 165 cx_driver->driver.name = cx_driver->name; 166 cx_driver->driver.bus = &tiocx_bus_type; 167 - cx_driver->driver.probe = cx_device_probe; 168 - cx_driver->driver.remove = cx_driver_remove; 169 170 return driver_register(&cx_driver->driver); 171 }
··· 77 kfree(to_cx_dev(dev)); 78 } 79 80 /** 81 * cx_device_match - Find cx_device in the id table. 82 * @ids: id table from driver ··· 149 return 0; 150 } 151 152 + struct bus_type tiocx_bus_type = { 153 + .name = "tiocx", 154 + .match = tiocx_match, 155 + .uevent = tiocx_uevent, 156 + .probe = cx_device_probe, 157 + .remove = cx_driver_remove, 158 + }; 159 + 160 /** 161 * cx_driver_register - Register the driver. 162 * @cx_driver: driver table (cx_drv struct) from driver ··· 162 { 163 cx_driver->driver.name = cx_driver->name; 164 cx_driver->driver.bus = &tiocx_bus_type; 165 166 return driver_register(&cx_driver->driver); 167 }
+2 -2
arch/parisc/kernel/drivers.c
··· 173 WARN_ON(driver->drv.probe != NULL); 174 WARN_ON(driver->drv.remove != NULL); 175 176 - driver->drv.probe = parisc_driver_probe; 177 - driver->drv.remove = parisc_driver_remove; 178 driver->drv.name = driver->name; 179 180 return driver_register(&driver->drv); ··· 573 .name = "parisc", 574 .match = parisc_generic_match, 575 .dev_attrs = parisc_device_attrs, 576 }; 577 578 /**
··· 173 WARN_ON(driver->drv.probe != NULL); 174 WARN_ON(driver->drv.remove != NULL); 175 176 driver->drv.name = driver->name; 177 178 return driver_register(&driver->drv); ··· 575 .name = "parisc", 576 .match = parisc_generic_match, 577 .dev_attrs = parisc_device_attrs, 578 + .probe = parisc_driver_probe, 579 + .remove = parisc_driver_remove, 580 }; 581 582 /**
+2 -2
arch/powerpc/kernel/of_device.c
··· 132 struct bus_type of_platform_bus_type = { 133 .name = "of_platform", 134 .match = of_platform_bus_match, 135 .suspend = of_device_suspend, 136 .resume = of_device_resume, 137 }; ··· 152 /* initialize common driver fields */ 153 drv->driver.name = drv->name; 154 drv->driver.bus = &of_platform_bus_type; 155 - drv->driver.probe = of_device_probe; 156 - drv->driver.remove = of_device_remove; 157 158 /* register with core */ 159 count = driver_register(&drv->driver);
··· 132 struct bus_type of_platform_bus_type = { 133 .name = "of_platform", 134 .match = of_platform_bus_match, 135 + .probe = of_device_probe, 136 + .remove = of_device_remove, 137 .suspend = of_device_suspend, 138 .resume = of_device_resume, 139 }; ··· 150 /* initialize common driver fields */ 151 drv->driver.name = drv->name; 152 drv->driver.bus = &of_platform_bus_type; 153 154 /* register with core */ 155 count = driver_register(&drv->driver);
+4 -4
arch/powerpc/kernel/vio.c
··· 76 struct vio_dev *viodev = to_vio_dev(dev); 77 struct vio_driver *viodrv = to_vio_driver(dev->driver); 78 79 - if (viodrv->shutdown) 80 viodrv->shutdown(viodev); 81 } 82 ··· 91 92 /* fill in 'struct driver' fields */ 93 viodrv->driver.bus = &vio_bus_type; 94 - viodrv->driver.probe = vio_bus_probe; 95 - viodrv->driver.remove = vio_bus_remove; 96 - viodrv->driver.shutdown = vio_bus_shutdown; 97 98 return driver_register(&viodrv->driver); 99 } ··· 292 .name = "vio", 293 .uevent = vio_hotplug, 294 .match = vio_bus_match, 295 };
··· 76 struct vio_dev *viodev = to_vio_dev(dev); 77 struct vio_driver *viodrv = to_vio_driver(dev->driver); 78 79 + if (dev->driver && viodrv->shutdown) 80 viodrv->shutdown(viodev); 81 } 82 ··· 91 92 /* fill in 'struct driver' fields */ 93 viodrv->driver.bus = &vio_bus_type; 94 95 return driver_register(&viodrv->driver); 96 } ··· 295 .name = "vio", 296 .uevent = vio_hotplug, 297 .match = vio_bus_match, 298 + .probe = vio_bus_probe, 299 + .remove = vio_bus_remove, 300 + .shutdown = vio_bus_shutdown, 301 };
+2 -2
arch/ppc/syslib/ocp.c
··· 189 struct bus_type ocp_bus_type = { 190 .name = "ocp", 191 .match = ocp_device_match, 192 .suspend = ocp_device_suspend, 193 .resume = ocp_device_resume, 194 }; ··· 212 /* initialize common driver fields */ 213 drv->driver.name = drv->name; 214 drv->driver.bus = &ocp_bus_type; 215 - drv->driver.probe = ocp_device_probe; 216 - drv->driver.remove = ocp_device_remove; 217 218 /* register with core */ 219 return driver_register(&drv->driver);
··· 189 struct bus_type ocp_bus_type = { 190 .name = "ocp", 191 .match = ocp_device_match, 192 + .probe = ocp_driver_probe, 193 + .remove = ocp_driver_remove, 194 .suspend = ocp_device_suspend, 195 .resume = ocp_device_resume, 196 }; ··· 210 /* initialize common driver fields */ 211 drv->driver.name = drv->name; 212 drv->driver.bus = &ocp_bus_type; 213 214 /* register with core */ 215 return driver_register(&drv->driver);
+17 -17
arch/sh/kernel/cpu/bus.c
··· 53 return 0; 54 } 55 56 - static struct device sh_bus_devices[SH_NR_BUSES] = { 57 - { 58 - .bus_id = SH_BUS_NAME_VIRT, 59 - }, 60 - }; 61 - 62 - struct bus_type sh_bus_types[SH_NR_BUSES] = { 63 - { 64 - .name = SH_BUS_NAME_VIRT, 65 - .match = sh_bus_match, 66 - .suspend = sh_bus_suspend, 67 - .resume = sh_bus_resume, 68 - }, 69 - }; 70 - 71 static int sh_device_probe(struct device *dev) 72 { 73 struct sh_dev *shdev = to_sh_dev(dev); ··· 74 75 return 0; 76 } 77 78 int sh_device_register(struct sh_dev *dev) 79 { ··· 135 return -EINVAL; 136 } 137 138 - drv->drv.probe = sh_device_probe; 139 - drv->drv.remove = sh_device_remove; 140 drv->drv.bus = &sh_bus_types[drv->bus_id]; 141 142 return driver_register(&drv->drv);
··· 53 return 0; 54 } 55 56 static int sh_device_probe(struct device *dev) 57 { 58 struct sh_dev *shdev = to_sh_dev(dev); ··· 89 90 return 0; 91 } 92 + 93 + static struct device sh_bus_devices[SH_NR_BUSES] = { 94 + { 95 + .bus_id = SH_BUS_NAME_VIRT, 96 + }, 97 + }; 98 + 99 + struct bus_type sh_bus_types[SH_NR_BUSES] = { 100 + { 101 + .name = SH_BUS_NAME_VIRT, 102 + .match = sh_bus_match, 103 + .probe = sh_bus_probe, 104 + .remove = sh_bus_remove, 105 + .suspend = sh_bus_suspend, 106 + .resume = sh_bus_resume, 107 + }, 108 + }; 109 110 int sh_device_register(struct sh_dev *dev) 111 { ··· 133 return -EINVAL; 134 } 135 136 drv->drv.bus = &sh_bus_types[drv->bus_id]; 137 138 return driver_register(&drv->drv);
+10 -2
drivers/base/dd.c
··· 78 pr_debug("%s: Matched Device %s with Driver %s\n", 79 drv->bus->name, dev->bus_id, drv->name); 80 dev->driver = drv; 81 - if (drv->probe) { 82 ret = drv->probe(dev); 83 if (ret) { 84 dev->driver = NULL; ··· 209 sysfs_remove_link(&dev->kobj, "driver"); 210 klist_remove(&dev->knode_driver); 211 212 - if (drv->remove) 213 drv->remove(dev); 214 dev->driver = NULL; 215 put_driver(drv);
··· 78 pr_debug("%s: Matched Device %s with Driver %s\n", 79 drv->bus->name, dev->bus_id, drv->name); 80 dev->driver = drv; 81 + if (dev->bus->probe) { 82 + ret = dev->bus->probe(dev); 83 + if (ret) { 84 + dev->driver = NULL; 85 + goto ProbeFailed; 86 + } 87 + } else if (drv->probe) { 88 ret = drv->probe(dev); 89 if (ret) { 90 dev->driver = NULL; ··· 203 sysfs_remove_link(&dev->kobj, "driver"); 204 klist_remove(&dev->knode_driver); 205 206 + if (dev->bus->remove) 207 + dev->bus->remove(dev); 208 + else if (drv->remove) 209 drv->remove(dev); 210 dev->driver = NULL; 211 put_driver(drv);
+5
drivers/base/driver.c
··· 171 */ 172 int driver_register(struct device_driver * drv) 173 { 174 klist_init(&drv->klist_devices, klist_devices_get, klist_devices_put); 175 init_completion(&drv->unloaded); 176 return bus_add_driver(drv);
··· 171 */ 172 int driver_register(struct device_driver * drv) 173 { 174 + if ((drv->bus->probe && drv->probe) || 175 + (drv->bus->remove && drv->remove) || 176 + (drv->bus->shutdown && drv->shutdown)) { 177 + printk(KERN_WARNING "Driver '%s' needs updating - please use bus_type methods\n", drv->name); 178 + } 179 klist_init(&drv->klist_devices, klist_devices_get, klist_devices_put); 180 init_completion(&drv->unloaded); 181 return bus_add_driver(drv);
+1 -1
drivers/base/platform.c
··· 327 * @pdev: platform device we're unregistering 328 * 329 * Unregistration is done in 2 steps. Fisrt we release all resources 330 - * and remove it from the sybsystem, then we drop reference count by 331 * calling platform_device_put(). 332 */ 333 void platform_device_unregister(struct platform_device * pdev)
··· 327 * @pdev: platform device we're unregistering 328 * 329 * Unregistration is done in 2 steps. Fisrt we release all resources 330 + * and remove it from the subsystem, then we drop reference count by 331 * calling platform_device_put(). 332 */ 333 void platform_device_unregister(struct platform_device * pdev)
+6 -3
drivers/base/power/shutdown.c
··· 35 */ 36 void device_shutdown(void) 37 { 38 - struct device * dev; 39 40 down_write(&devices_subsys.rwsem); 41 - list_for_each_entry_reverse(dev, &devices_subsys.kset.list, 42 kobj.entry) { 43 - if (dev->driver && dev->driver->shutdown) { 44 dev_dbg(dev, "shutdown\n"); 45 dev->driver->shutdown(dev); 46 }
··· 35 */ 36 void device_shutdown(void) 37 { 38 + struct device * dev, *devn; 39 40 down_write(&devices_subsys.rwsem); 41 + list_for_each_entry_safe_reverse(dev, devn, &devices_subsys.kset.list, 42 kobj.entry) { 43 + if (dev->bus && dev->bus->shutdown) { 44 + dev_dbg(dev, "shutdown\n"); 45 + dev->bus->shutdown(dev); 46 + } else if (dev->driver && dev->driver->shutdown) { 47 dev_dbg(dev, "shutdown\n"); 48 dev->driver->shutdown(dev); 49 }
+2 -2
drivers/dio/dio-driver.c
··· 83 /* initialize common driver fields */ 84 drv->driver.name = drv->name; 85 drv->driver.bus = &dio_bus_type; 86 - drv->driver.probe = dio_device_probe; 87 88 /* register with core */ 89 count = driver_register(&drv->driver); ··· 144 145 struct bus_type dio_bus_type = { 146 .name = "dio", 147 - .match = dio_bus_match 148 }; 149 150
··· 83 /* initialize common driver fields */ 84 drv->driver.name = drv->name; 85 drv->driver.bus = &dio_bus_type; 86 87 /* register with core */ 88 count = driver_register(&drv->driver); ··· 145 146 struct bus_type dio_bus_type = { 147 .name = "dio", 148 + .match = dio_bus_match, 149 + .probe = dio_device_probe, 150 }; 151 152
+9 -11
drivers/i2c/i2c-core.c
··· 63 return rc; 64 } 65 66 - struct bus_type i2c_bus_type = { 67 - .name = "i2c", 68 - .match = i2c_device_match, 69 - .suspend = i2c_bus_suspend, 70 - .resume = i2c_bus_resume, 71 - }; 72 - 73 static int i2c_device_probe(struct device *dev) 74 { 75 return -ENODEV; ··· 72 { 73 return 0; 74 } 75 76 void i2c_adapter_dev_release(struct device *dev) 77 { ··· 92 .owner = THIS_MODULE, 93 .name = "i2c_adapter", 94 .bus = &i2c_bus_type, 95 - .probe = i2c_device_probe, 96 - .remove = i2c_device_remove, 97 }; 98 99 static void i2c_adapter_class_dev_release(struct class_device *dev) ··· 294 /* add the driver to the list of i2c drivers in the driver core */ 295 driver->driver.owner = owner; 296 driver->driver.bus = &i2c_bus_type; 297 - driver->driver.probe = i2c_device_probe; 298 - driver->driver.remove = i2c_device_remove; 299 300 res = driver_register(&driver->driver); 301 if (res)
··· 63 return rc; 64 } 65 66 static int i2c_device_probe(struct device *dev) 67 { 68 return -ENODEV; ··· 79 { 80 return 0; 81 } 82 + 83 + struct bus_type i2c_bus_type = { 84 + .name = "i2c", 85 + .match = i2c_device_match, 86 + .probe = i2c_device_probe, 87 + .remove = i2c_device_remove, 88 + .suspend = i2c_bus_suspend, 89 + .resume = i2c_bus_resume, 90 + }; 91 92 void i2c_adapter_dev_release(struct device *dev) 93 { ··· 90 .owner = THIS_MODULE, 91 .name = "i2c_adapter", 92 .bus = &i2c_bus_type, 93 }; 94 95 static void i2c_adapter_class_dev_release(struct class_device *dev) ··· 294 /* add the driver to the list of i2c drivers in the driver core */ 295 driver->driver.owner = owner; 296 driver->driver.bus = &i2c_bus_type; 297 298 res = driver_register(&driver->driver); 299 if (res)
+5 -9
drivers/ide/ide-cd.c
··· 3256 } 3257 #endif 3258 3259 - static int ide_cd_remove(struct device *dev) 3260 { 3261 - ide_drive_t *drive = to_ide_device(dev); 3262 struct cdrom_info *info = drive->driver_data; 3263 3264 ide_unregister_subdriver(drive, info->driver); ··· 3265 del_gendisk(info->disk); 3266 3267 ide_cd_put(info); 3268 - 3269 - return 0; 3270 } 3271 3272 static void ide_cd_release(struct kref *kref) ··· 3288 kfree(info); 3289 } 3290 3291 - static int ide_cd_probe(struct device *); 3292 3293 #ifdef CONFIG_PROC_FS 3294 static int proc_idecd_read_capacity ··· 3314 .owner = THIS_MODULE, 3315 .name = "ide-cdrom", 3316 .bus = &ide_bus_type, 3317 - .probe = ide_cd_probe, 3318 - .remove = ide_cd_remove, 3319 }, 3320 .version = IDECD_VERSION, 3321 .media = ide_cdrom, 3322 .supports_dsc_overlap = 1, ··· 3410 module_param(ignore, charp, 0400); 3411 MODULE_DESCRIPTION("ATAPI CD-ROM Driver"); 3412 3413 - static int ide_cd_probe(struct device *dev) 3414 { 3415 - ide_drive_t *drive = to_ide_device(dev); 3416 struct cdrom_info *info; 3417 struct gendisk *g; 3418 struct request_sense sense;
··· 3256 } 3257 #endif 3258 3259 + static void ide_cd_remove(ide_drive_t *drive) 3260 { 3261 struct cdrom_info *info = drive->driver_data; 3262 3263 ide_unregister_subdriver(drive, info->driver); ··· 3266 del_gendisk(info->disk); 3267 3268 ide_cd_put(info); 3269 } 3270 3271 static void ide_cd_release(struct kref *kref) ··· 3291 kfree(info); 3292 } 3293 3294 + static int ide_cd_probe(ide_drive_t *); 3295 3296 #ifdef CONFIG_PROC_FS 3297 static int proc_idecd_read_capacity ··· 3317 .owner = THIS_MODULE, 3318 .name = "ide-cdrom", 3319 .bus = &ide_bus_type, 3320 }, 3321 + .probe = ide_cd_probe, 3322 + .remove = ide_cd_remove, 3323 .version = IDECD_VERSION, 3324 .media = ide_cdrom, 3325 .supports_dsc_overlap = 1, ··· 3413 module_param(ignore, charp, 0400); 3414 MODULE_DESCRIPTION("ATAPI CD-ROM Driver"); 3415 3416 + static int ide_cd_probe(ide_drive_t *drive) 3417 { 3418 struct cdrom_info *info; 3419 struct gendisk *g; 3420 struct request_sense sense;
+8 -14
drivers/ide/ide-disk.c
··· 997 printk(KERN_INFO "%s: wcache flush failed!\n", drive->name); 998 } 999 1000 - static int ide_disk_remove(struct device *dev) 1001 { 1002 - ide_drive_t *drive = to_ide_device(dev); 1003 struct ide_disk_obj *idkp = drive->driver_data; 1004 struct gendisk *g = idkp->disk; 1005 ··· 1009 ide_cacheflush_p(drive); 1010 1011 ide_disk_put(idkp); 1012 - 1013 - return 0; 1014 } 1015 1016 static void ide_disk_release(struct kref *kref) ··· 1024 kfree(idkp); 1025 } 1026 1027 - static int ide_disk_probe(struct device *dev); 1028 1029 - static void ide_device_shutdown(struct device *dev) 1030 { 1031 - ide_drive_t *drive = container_of(dev, ide_drive_t, gendev); 1032 - 1033 #ifdef CONFIG_ALPHA 1034 /* On Alpha, halt(8) doesn't actually turn the machine off, 1035 it puts you into the sort of firmware monitor. Typically, ··· 1049 } 1050 1051 printk("Shutdown: %s\n", drive->name); 1052 - dev->bus->suspend(dev, PMSG_SUSPEND); 1053 } 1054 1055 static ide_driver_t idedisk_driver = { ··· 1057 .owner = THIS_MODULE, 1058 .name = "ide-disk", 1059 .bus = &ide_bus_type, 1060 - .probe = ide_disk_probe, 1061 - .remove = ide_disk_remove, 1062 - .shutdown = ide_device_shutdown, 1063 }, 1064 .version = IDEDISK_VERSION, 1065 .media = ide_disk, 1066 .supports_dsc_overlap = 0, ··· 1177 1178 MODULE_DESCRIPTION("ATA DISK Driver"); 1179 1180 - static int ide_disk_probe(struct device *dev) 1181 { 1182 - ide_drive_t *drive = to_ide_device(dev); 1183 struct ide_disk_obj *idkp; 1184 struct gendisk *g; 1185
··· 997 printk(KERN_INFO "%s: wcache flush failed!\n", drive->name); 998 } 999 1000 + static void ide_disk_remove(ide_drive_t *drive) 1001 { 1002 struct ide_disk_obj *idkp = drive->driver_data; 1003 struct gendisk *g = idkp->disk; 1004 ··· 1010 ide_cacheflush_p(drive); 1011 1012 ide_disk_put(idkp); 1013 } 1014 1015 static void ide_disk_release(struct kref *kref) ··· 1027 kfree(idkp); 1028 } 1029 1030 + static int ide_disk_probe(ide_drive_t *drive); 1031 1032 + static void ide_device_shutdown(ide_drive_t *drive) 1033 { 1034 #ifdef CONFIG_ALPHA 1035 /* On Alpha, halt(8) doesn't actually turn the machine off, 1036 it puts you into the sort of firmware monitor. Typically, ··· 1054 } 1055 1056 printk("Shutdown: %s\n", drive->name); 1057 + drive->gendev.bus->suspend(&drive->gendev, PMSG_SUSPEND); 1058 } 1059 1060 static ide_driver_t idedisk_driver = { ··· 1062 .owner = THIS_MODULE, 1063 .name = "ide-disk", 1064 .bus = &ide_bus_type, 1065 }, 1066 + .probe = ide_disk_probe, 1067 + .remove = ide_disk_remove, 1068 + .shutdown = ide_device_shutdown, 1069 .version = IDEDISK_VERSION, 1070 .media = ide_disk, 1071 .supports_dsc_overlap = 0, ··· 1182 1183 MODULE_DESCRIPTION("ATA DISK Driver"); 1184 1185 + static int ide_disk_probe(ide_drive_t *drive) 1186 { 1187 struct ide_disk_obj *idkp; 1188 struct gendisk *g; 1189
+5 -9
drivers/ide/ide-floppy.c
··· 1871 idefloppy_add_settings(drive); 1872 } 1873 1874 - static int ide_floppy_remove(struct device *dev) 1875 { 1876 - ide_drive_t *drive = to_ide_device(dev); 1877 idefloppy_floppy_t *floppy = drive->driver_data; 1878 struct gendisk *g = floppy->disk; 1879 ··· 1881 del_gendisk(g); 1882 1883 ide_floppy_put(floppy); 1884 - 1885 - return 0; 1886 } 1887 1888 static void ide_floppy_release(struct kref *kref) ··· 1919 1920 #endif /* CONFIG_PROC_FS */ 1921 1922 - static int ide_floppy_probe(struct device *); 1923 1924 static ide_driver_t idefloppy_driver = { 1925 .gen_driver = { 1926 .owner = THIS_MODULE, 1927 .name = "ide-floppy", 1928 .bus = &ide_bus_type, 1929 - .probe = ide_floppy_probe, 1930 - .remove = ide_floppy_remove, 1931 }, 1932 .version = IDEFLOPPY_VERSION, 1933 .media = ide_floppy, 1934 .supports_dsc_overlap = 0, ··· 2133 .revalidate_disk= idefloppy_revalidate_disk 2134 }; 2135 2136 - static int ide_floppy_probe(struct device *dev) 2137 { 2138 - ide_drive_t *drive = to_ide_device(dev); 2139 idefloppy_floppy_t *floppy; 2140 struct gendisk *g; 2141
··· 1871 idefloppy_add_settings(drive); 1872 } 1873 1874 + static void ide_floppy_remove(ide_drive_t *drive) 1875 { 1876 idefloppy_floppy_t *floppy = drive->driver_data; 1877 struct gendisk *g = floppy->disk; 1878 ··· 1882 del_gendisk(g); 1883 1884 ide_floppy_put(floppy); 1885 } 1886 1887 static void ide_floppy_release(struct kref *kref) ··· 1922 1923 #endif /* CONFIG_PROC_FS */ 1924 1925 + static int ide_floppy_probe(ide_drive_t *); 1926 1927 static ide_driver_t idefloppy_driver = { 1928 .gen_driver = { 1929 .owner = THIS_MODULE, 1930 .name = "ide-floppy", 1931 .bus = &ide_bus_type, 1932 }, 1933 + .probe = ide_floppy_probe, 1934 + .remove = ide_floppy_remove, 1935 .version = IDEFLOPPY_VERSION, 1936 .media = ide_floppy, 1937 .supports_dsc_overlap = 0, ··· 2136 .revalidate_disk= idefloppy_revalidate_disk 2137 }; 2138 2139 + static int ide_floppy_probe(ide_drive_t *drive) 2140 { 2141 idefloppy_floppy_t *floppy; 2142 struct gendisk *g; 2143
+7 -11
drivers/ide/ide-tape.c
··· 4682 idetape_add_settings(drive); 4683 } 4684 4685 - static int ide_tape_remove(struct device *dev) 4686 { 4687 - ide_drive_t *drive = to_ide_device(dev); 4688 idetape_tape_t *tape = drive->driver_data; 4689 4690 ide_unregister_subdriver(drive, tape->driver); ··· 4691 ide_unregister_region(tape->disk); 4692 4693 ide_tape_put(tape); 4694 - 4695 - return 0; 4696 } 4697 4698 static void ide_tape_release(struct kref *kref) ··· 4742 4743 #endif 4744 4745 - static int ide_tape_probe(struct device *); 4746 4747 static ide_driver_t idetape_driver = { 4748 .gen_driver = { 4749 .owner = THIS_MODULE, 4750 .name = "ide-tape", 4751 .bus = &ide_bus_type, 4752 - .probe = ide_tape_probe, 4753 - .remove = ide_tape_remove, 4754 }, 4755 .version = IDETAPE_VERSION, 4756 .media = ide_tape, 4757 .supports_dsc_overlap = 1, ··· 4822 .ioctl = idetape_ioctl, 4823 }; 4824 4825 - static int ide_tape_probe(struct device *dev) 4826 { 4827 - ide_drive_t *drive = to_ide_device(dev); 4828 idetape_tape_t *tape; 4829 struct gendisk *g; 4830 int minor; ··· 4879 idetape_setup(drive, tape, minor); 4880 4881 class_device_create(idetape_sysfs_class, NULL, 4882 - MKDEV(IDETAPE_MAJOR, minor), dev, "%s", tape->name); 4883 class_device_create(idetape_sysfs_class, NULL, 4884 - MKDEV(IDETAPE_MAJOR, minor + 128), dev, "n%s", tape->name); 4885 4886 devfs_mk_cdev(MKDEV(HWIF(drive)->major, minor), 4887 S_IFCHR | S_IRUGO | S_IWUGO,
··· 4682 idetape_add_settings(drive); 4683 } 4684 4685 + static void ide_tape_remove(ide_drive_t *drive) 4686 { 4687 idetape_tape_t *tape = drive->driver_data; 4688 4689 ide_unregister_subdriver(drive, tape->driver); ··· 4692 ide_unregister_region(tape->disk); 4693 4694 ide_tape_put(tape); 4695 } 4696 4697 static void ide_tape_release(struct kref *kref) ··· 4745 4746 #endif 4747 4748 + static int ide_tape_probe(ide_drive_t *); 4749 4750 static ide_driver_t idetape_driver = { 4751 .gen_driver = { 4752 .owner = THIS_MODULE, 4753 .name = "ide-tape", 4754 .bus = &ide_bus_type, 4755 }, 4756 + .probe = ide_tape_probe, 4757 + .remove = ide_tape_remove, 4758 .version = IDETAPE_VERSION, 4759 .media = ide_tape, 4760 .supports_dsc_overlap = 1, ··· 4825 .ioctl = idetape_ioctl, 4826 }; 4827 4828 + static int ide_tape_probe(ide_drive_t *drive) 4829 { 4830 idetape_tape_t *tape; 4831 struct gendisk *g; 4832 int minor; ··· 4883 idetape_setup(drive, tape, minor); 4884 4885 class_device_create(idetape_sysfs_class, NULL, 4886 + MKDEV(IDETAPE_MAJOR, minor), &drive->gendev, "%s", tape->name); 4887 class_device_create(idetape_sysfs_class, NULL, 4888 + MKDEV(IDETAPE_MAJOR, minor + 128), &drive->gendev, "n%s", tape->name); 4889 4890 devfs_mk_cdev(MKDEV(HWIF(drive)->major, minor), 4891 S_IFCHR | S_IRUGO | S_IWUGO,
+31
drivers/ide/ide.c
··· 1949 return 0; 1950 } 1951 1952 struct bus_type ide_bus_type = { 1953 .name = "ide", 1954 .match = ide_bus_match, 1955 .uevent = ide_uevent, 1956 .dev_attrs = ide_dev_attrs, 1957 .suspend = generic_ide_suspend, 1958 .resume = generic_ide_resume,
··· 1949 return 0; 1950 } 1951 1952 + static int generic_ide_probe(struct device *dev) 1953 + { 1954 + ide_drive_t *drive = to_ide_device(dev); 1955 + ide_driver_t *drv = to_ide_driver(dev->driver); 1956 + 1957 + return drv->probe ? drv->probe(drive) : -ENODEV; 1958 + } 1959 + 1960 + static int generic_ide_remove(struct device *dev) 1961 + { 1962 + ide_drive_t *drive = to_ide_device(dev); 1963 + ide_driver_t *drv = to_ide_driver(dev->driver); 1964 + 1965 + if (drv->remove) 1966 + drv->remove(drive); 1967 + 1968 + return 0; 1969 + } 1970 + 1971 + static void generic_ide_shutdown(struct device *dev) 1972 + { 1973 + ide_drive_t *drive = to_ide_device(dev); 1974 + ide_driver_t *drv = to_ide_driver(dev->driver); 1975 + 1976 + if (dev->driver && drv->shutdown) 1977 + drv->shutdown(drive); 1978 + } 1979 + 1980 struct bus_type ide_bus_type = { 1981 .name = "ide", 1982 .match = ide_bus_match, 1983 .uevent = ide_uevent, 1984 + .probe = generic_ide_probe, 1985 + .remove = generic_ide_remove, 1986 + .shutdown = generic_ide_shutdown, 1987 .dev_attrs = ide_dev_attrs, 1988 .suspend = generic_ide_suspend, 1989 .resume = generic_ide_resume,
+7 -5
drivers/input/gameport/gameport.c
··· 50 51 static LIST_HEAD(gameport_list); 52 53 - static struct bus_type gameport_bus = { 54 - .name = "gameport", 55 - }; 56 57 static void gameport_add_port(struct gameport *gameport); 58 static void gameport_destroy_port(struct gameport *gameport); ··· 701 return 0; 702 } 703 704 void __gameport_register_driver(struct gameport_driver *drv, struct module *owner) 705 { 706 drv->driver.bus = &gameport_bus; 707 - drv->driver.probe = gameport_driver_probe; 708 - drv->driver.remove = gameport_driver_remove; 709 gameport_queue_event(drv, owner, GAMEPORT_REGISTER_DRIVER); 710 } 711
··· 50 51 static LIST_HEAD(gameport_list); 52 53 + static struct bus_type gameport_bus; 54 55 static void gameport_add_port(struct gameport *gameport); 56 static void gameport_destroy_port(struct gameport *gameport); ··· 703 return 0; 704 } 705 706 + static struct bus_type gameport_bus = { 707 + .name = "gameport", 708 + .probe = gameport_driver_probe, 709 + .remove = gameport_driver_remove, 710 + }; 711 + 712 void __gameport_register_driver(struct gameport_driver *drv, struct module *owner) 713 { 714 drv->driver.bus = &gameport_bus; 715 gameport_queue_event(drv, owner, GAMEPORT_REGISTER_DRIVER); 716 } 717
+41 -22
drivers/input/input.c
··· 528 INPUT_DEV_STRING_ATTR_SHOW(phys); 529 INPUT_DEV_STRING_ATTR_SHOW(uniq); 530 531 - static int print_modalias_bits(char *buf, char prefix, unsigned long *arr, 532 unsigned int min, unsigned int max) 533 { 534 int len, i; 535 536 - len = sprintf(buf, "%c", prefix); 537 for (i = min; i < max; i++) 538 if (arr[LONG(i)] & BIT(i)) 539 - len += sprintf(buf+len, "%X,", i); 540 return len; 541 } 542 543 static ssize_t input_dev_show_modalias(struct class_device *dev, char *buf) 544 { 545 struct input_dev *id = to_input_dev(dev); 546 - ssize_t len = 0; 547 548 - len += sprintf(buf+len, "input:b%04Xv%04Xp%04Xe%04X-", 549 - id->id.bustype, 550 - id->id.vendor, 551 - id->id.product, 552 - id->id.version); 553 - 554 - len += print_modalias_bits(buf+len, 'e', id->evbit, 0, EV_MAX); 555 - len += print_modalias_bits(buf+len, 'k', id->keybit, 556 - KEY_MIN_INTERESTING, KEY_MAX); 557 - len += print_modalias_bits(buf+len, 'r', id->relbit, 0, REL_MAX); 558 - len += print_modalias_bits(buf+len, 'a', id->absbit, 0, ABS_MAX); 559 - len += print_modalias_bits(buf+len, 'm', id->mscbit, 0, MSC_MAX); 560 - len += print_modalias_bits(buf+len, 'l', id->ledbit, 0, LED_MAX); 561 - len += print_modalias_bits(buf+len, 's', id->sndbit, 0, SND_MAX); 562 - len += print_modalias_bits(buf+len, 'f', id->ffbit, 0, FF_MAX); 563 - len += print_modalias_bits(buf+len, 'w', id->swbit, 0, SW_MAX); 564 - len += sprintf(buf+len, "\n"); 565 return len; 566 } 567 static CLASS_DEVICE_ATTR(modalias, S_IRUGO, input_dev_show_modalias, NULL); ··· 744 if (test_bit(EV_SW, dev->evbit)) 745 INPUT_ADD_HOTPLUG_BM_VAR("SW=", dev->swbit, SW_MAX); 746 747 - envp[i] = NULL; 748 749 return 0; 750 } 751
··· 528 INPUT_DEV_STRING_ATTR_SHOW(phys); 529 INPUT_DEV_STRING_ATTR_SHOW(uniq); 530 531 + static int print_modalias_bits(char *buf, int size, char prefix, unsigned long *arr, 532 unsigned int min, unsigned int max) 533 { 534 int len, i; 535 536 + len = snprintf(buf, size, "%c", prefix); 537 for (i = min; i < max; i++) 538 if (arr[LONG(i)] & BIT(i)) 539 + len += snprintf(buf + len, size - len, "%X,", i); 540 + return len; 541 + } 542 + 543 + static int print_modalias(char *buf, int size, struct input_dev *id) 544 + { 545 + int len; 546 + 547 + len = snprintf(buf, size, "input:b%04Xv%04Xp%04Xe%04X-", 548 + id->id.bustype, 549 + id->id.vendor, 550 + id->id.product, 551 + id->id.version); 552 + 553 + len += print_modalias_bits(buf + len, size - len, 'e', id->evbit, 554 + 0, EV_MAX); 555 + len += print_modalias_bits(buf + len, size - len, 'k', id->keybit, 556 + KEY_MIN_INTERESTING, KEY_MAX); 557 + len += print_modalias_bits(buf + len, size - len, 'r', id->relbit, 558 + 0, REL_MAX); 559 + len += print_modalias_bits(buf + len, size - len, 'a', id->absbit, 560 + 0, ABS_MAX); 561 + len += print_modalias_bits(buf + len, size - len, 'm', id->mscbit, 562 + 0, MSC_MAX); 563 + len += print_modalias_bits(buf + len, size - len, 'l', id->ledbit, 564 + 0, LED_MAX); 565 + len += print_modalias_bits(buf + len, size - len, 's', id->sndbit, 566 + 0, SND_MAX); 567 + len += print_modalias_bits(buf + len, size - len, 'f', id->ffbit, 568 + 0, FF_MAX); 569 + len += print_modalias_bits(buf + len, size - len, 'w', id->swbit, 570 + 0, SW_MAX); 571 return len; 572 } 573 574 static ssize_t input_dev_show_modalias(struct class_device *dev, char *buf) 575 { 576 struct input_dev *id = to_input_dev(dev); 577 + ssize_t len; 578 579 + len = print_modalias(buf, PAGE_SIZE, id); 580 + len += snprintf(buf + len, PAGE_SIZE-len, "\n"); 581 return len; 582 } 583 static CLASS_DEVICE_ATTR(modalias, S_IRUGO, input_dev_show_modalias, NULL); ··· 728 if (test_bit(EV_SW, dev->evbit)) 729 INPUT_ADD_HOTPLUG_BM_VAR("SW=", dev->swbit, SW_MAX); 730 731 + envp[i++] = buffer + len; 732 + len += snprintf(buffer + len, buffer_size - len, "MODALIAS="); 733 + len += print_modalias(buffer + len, buffer_size - len, dev) + 1; 734 735 + envp[i] = NULL; 736 return 0; 737 } 738
+7 -5
drivers/input/serio/serio.c
··· 59 60 static LIST_HEAD(serio_list); 61 62 - static struct bus_type serio_bus = { 63 - .name = "serio", 64 - }; 65 66 static void serio_add_port(struct serio *serio); 67 static void serio_destroy_port(struct serio *serio); ··· 748 return 0; 749 } 750 751 void __serio_register_driver(struct serio_driver *drv, struct module *owner) 752 { 753 drv->driver.bus = &serio_bus; 754 - drv->driver.probe = serio_driver_probe; 755 - drv->driver.remove = serio_driver_remove; 756 757 serio_queue_event(drv, owner, SERIO_REGISTER_DRIVER); 758 }
··· 59 60 static LIST_HEAD(serio_list); 61 62 + static struct bus_type serio_bus; 63 64 static void serio_add_port(struct serio *serio); 65 static void serio_destroy_port(struct serio *serio); ··· 750 return 0; 751 } 752 753 + static struct bus_type serio_bus = { 754 + .name = "serio", 755 + .probe = serio_driver_probe, 756 + .remove = serio_driver_remove, 757 + }; 758 + 759 void __serio_register_driver(struct serio_driver *drv, struct module *owner) 760 { 761 drv->driver.bus = &serio_bus; 762 763 serio_queue_event(drv, owner, SERIO_REGISTER_DRIVER); 764 }
+3 -3
drivers/macintosh/macio_asic.c
··· 211 .name = "macio", 212 .match = macio_bus_match, 213 .uevent = macio_uevent, 214 .suspend = macio_device_suspend, 215 .resume = macio_device_resume, 216 .dev_attrs = macio_dev_attrs, ··· 531 /* initialize common driver fields */ 532 drv->driver.name = drv->name; 533 drv->driver.bus = &macio_bus_type; 534 - drv->driver.probe = macio_device_probe; 535 - drv->driver.remove = macio_device_remove; 536 - drv->driver.shutdown = macio_device_shutdown; 537 538 /* register with core */ 539 count = driver_register(&drv->driver);
··· 211 .name = "macio", 212 .match = macio_bus_match, 213 .uevent = macio_uevent, 214 + .probe = macio_device_probe, 215 + .remove = macio_device_remove, 216 + .shutdown = macio_device_shutdown, 217 .suspend = macio_device_suspend, 218 .resume = macio_device_resume, 219 .dev_attrs = macio_dev_attrs, ··· 528 /* initialize common driver fields */ 529 drv->driver.name = drv->name; 530 drv->driver.bus = &macio_bus_type; 531 532 /* register with core */ 533 count = driver_register(&drv->driver);
+11 -12
drivers/media/dvb/bt8xx/dvb-bt8xx.c
··· 779 return 0; 780 } 781 782 - static int dvb_bt8xx_probe(struct device *dev) 783 { 784 - struct bttv_sub_device *sub = to_bttv_sub_dev(dev); 785 struct dvb_bt8xx_card *card; 786 struct pci_dev* bttv_pci_dev; 787 int ret; ··· 889 return ret; 890 } 891 892 - dev_set_drvdata(dev, card); 893 return 0; 894 } 895 896 - static int dvb_bt8xx_remove(struct device *dev) 897 { 898 - struct dvb_bt8xx_card *card = dev_get_drvdata(dev); 899 900 dprintk("dvb_bt8xx: unloading card%d\n", card->bttv_nr); 901 ··· 918 static struct bttv_sub_driver driver = { 919 .drv = { 920 .name = "dvb-bt8xx", 921 - .probe = dvb_bt8xx_probe, 922 - .remove = dvb_bt8xx_remove, 923 - /* FIXME: 924 - * .shutdown = dvb_bt8xx_shutdown, 925 - * .suspend = dvb_bt8xx_suspend, 926 - * .resume = dvb_bt8xx_resume, 927 - */ 928 }, 929 }; 930 931 static int __init dvb_bt8xx_init(void)
··· 779 return 0; 780 } 781 782 + static int dvb_bt8xx_probe(struct bttv_sub_device *sub) 783 { 784 struct dvb_bt8xx_card *card; 785 struct pci_dev* bttv_pci_dev; 786 int ret; ··· 890 return ret; 891 } 892 893 + dev_set_drvdata(&sub->dev, card); 894 return 0; 895 } 896 897 + static int dvb_bt8xx_remove(struct bttv_sub_device *sub) 898 { 899 + struct dvb_bt8xx_card *card = dev_get_drvdata(&sub->dev); 900 901 dprintk("dvb_bt8xx: unloading card%d\n", card->bttv_nr); 902 ··· 919 static struct bttv_sub_driver driver = { 920 .drv = { 921 .name = "dvb-bt8xx", 922 }, 923 + .probe = dvb_bt8xx_probe, 924 + .remove = dvb_bt8xx_remove, 925 + /* FIXME: 926 + * .shutdown = dvb_bt8xx_shutdown, 927 + * .suspend = dvb_bt8xx_suspend, 928 + * .resume = dvb_bt8xx_resume, 929 + */ 930 }; 931 932 static int __init dvb_bt8xx_init(void)
+22 -2
drivers/media/video/bttv-gpio.c
··· 47 return 0; 48 } 49 50 struct bus_type bttv_sub_bus_type = { 51 - .name = "bttv-sub", 52 - .match = &bttv_sub_bus_match, 53 }; 54 EXPORT_SYMBOL(bttv_sub_bus_type); 55
··· 47 return 0; 48 } 49 50 + static int bttv_sub_probe(struct device *dev) 51 + { 52 + struct bttv_sub_device *sdev = to_bttv_sub_dev(dev); 53 + struct bttv_sub_driver *sub = to_bttv_sub_drv(dev->driver); 54 + 55 + return sub->probe ? sub->probe(sdev) : -ENODEV; 56 + } 57 + 58 + static int bttv_sub_remove(struct device *dev) 59 + { 60 + struct bttv_sub_device *sdev = to_bttv_sub_dev(dev); 61 + struct bttv_sub_driver *sub = to_bttv_sub_drv(dev->driver); 62 + 63 + if (sub->remove) 64 + sub->remove(sdev); 65 + return 0; 66 + } 67 + 68 struct bus_type bttv_sub_bus_type = { 69 + .name = "bttv-sub", 70 + .match = &bttv_sub_bus_match, 71 + .probe = bttv_sub_probe, 72 + .remove = bttv_sub_remove, 73 }; 74 EXPORT_SYMBOL(bttv_sub_bus_type); 75
+2
drivers/media/video/bttv.h
··· 365 struct bttv_sub_driver { 366 struct device_driver drv; 367 char wanted[BUS_ID_SIZE]; 368 void (*gpio_irq)(struct bttv_sub_device *sub); 369 }; 370 #define to_bttv_sub_drv(x) container_of((x), struct bttv_sub_driver, drv)
··· 365 struct bttv_sub_driver { 366 struct device_driver drv; 367 char wanted[BUS_ID_SIZE]; 368 + int (*probe)(struct bttv_sub_device *sub); 369 + void (*remove)(struct bttv_sub_device *sub); 370 void (*gpio_irq)(struct bttv_sub_device *sub); 371 }; 372 #define to_bttv_sub_drv(x) container_of((x), struct bttv_sub_driver, drv)
+2 -2
drivers/mfd/mcp-core.c
··· 77 static struct bus_type mcp_bus_type = { 78 .name = "mcp", 79 .match = mcp_bus_match, 80 .suspend = mcp_bus_suspend, 81 .resume = mcp_bus_resume, 82 }; ··· 229 int mcp_driver_register(struct mcp_driver *mcpdrv) 230 { 231 mcpdrv->drv.bus = &mcp_bus_type; 232 - mcpdrv->drv.probe = mcp_bus_probe; 233 - mcpdrv->drv.remove = mcp_bus_remove; 234 return driver_register(&mcpdrv->drv); 235 } 236 EXPORT_SYMBOL(mcp_driver_register);
··· 77 static struct bus_type mcp_bus_type = { 78 .name = "mcp", 79 .match = mcp_bus_match, 80 + .probe = mcp_bus_probe, 81 + .remove = mcp_bus_remove, 82 .suspend = mcp_bus_suspend, 83 .resume = mcp_bus_resume, 84 }; ··· 227 int mcp_driver_register(struct mcp_driver *mcpdrv) 228 { 229 mcpdrv->drv.bus = &mcp_bus_type; 230 return driver_register(&mcpdrv->drv); 231 } 232 EXPORT_SYMBOL(mcp_driver_register);
+12 -14
drivers/mmc/mmc_sysfs.c
··· 136 return ret; 137 } 138 139 - static struct bus_type mmc_bus_type = { 140 - .name = "mmc", 141 - .dev_attrs = mmc_dev_attrs, 142 - .match = mmc_bus_match, 143 - .uevent = mmc_bus_uevent, 144 - .suspend = mmc_bus_suspend, 145 - .resume = mmc_bus_resume, 146 - }; 147 - 148 - 149 - static int mmc_drv_probe(struct device *dev) 150 { 151 struct mmc_driver *drv = to_mmc_driver(dev->driver); 152 struct mmc_card *card = dev_to_mmc_card(dev); ··· 144 return drv->probe(card); 145 } 146 147 - static int mmc_drv_remove(struct device *dev) 148 { 149 struct mmc_driver *drv = to_mmc_driver(dev->driver); 150 struct mmc_card *card = dev_to_mmc_card(dev); ··· 154 return 0; 155 } 156 157 158 /** 159 * mmc_register_driver - register a media driver ··· 172 int mmc_register_driver(struct mmc_driver *drv) 173 { 174 drv->drv.bus = &mmc_bus_type; 175 - drv->drv.probe = mmc_drv_probe; 176 - drv->drv.remove = mmc_drv_remove; 177 return driver_register(&drv->drv); 178 } 179
··· 136 return ret; 137 } 138 139 + static int mmc_bus_probe(struct device *dev) 140 { 141 struct mmc_driver *drv = to_mmc_driver(dev->driver); 142 struct mmc_card *card = dev_to_mmc_card(dev); ··· 154 return drv->probe(card); 155 } 156 157 + static int mmc_bus_remove(struct device *dev) 158 { 159 struct mmc_driver *drv = to_mmc_driver(dev->driver); 160 struct mmc_card *card = dev_to_mmc_card(dev); ··· 164 return 0; 165 } 166 167 + static struct bus_type mmc_bus_type = { 168 + .name = "mmc", 169 + .dev_attrs = mmc_dev_attrs, 170 + .match = mmc_bus_match, 171 + .uevent = mmc_bus_uevent, 172 + .probe = mmc_bus_probe, 173 + .remove = mmc_bus_remove, 174 + .suspend = mmc_bus_suspend, 175 + .resume = mmc_bus_resume, 176 + }; 177 178 /** 179 * mmc_register_driver - register a media driver ··· 172 int mmc_register_driver(struct mmc_driver *drv) 173 { 174 drv->drv.bus = &mmc_bus_type; 175 return driver_register(&drv->drv); 176 } 177
+2 -2
drivers/pci/pci-driver.c
··· 380 /* initialize common driver fields */ 381 drv->driver.name = drv->name; 382 drv->driver.bus = &pci_bus_type; 383 - drv->driver.probe = pci_device_probe; 384 - drv->driver.remove = pci_device_remove; 385 /* FIXME, once all of the existing PCI drivers have been fixed to set 386 * the pci shutdown function, this test can go away. */ 387 if (!drv->driver.shutdown) ··· 511 .name = "pci", 512 .match = pci_bus_match, 513 .uevent = pci_uevent, 514 .suspend = pci_device_suspend, 515 .resume = pci_device_resume, 516 .dev_attrs = pci_dev_attrs,
··· 380 /* initialize common driver fields */ 381 drv->driver.name = drv->name; 382 drv->driver.bus = &pci_bus_type; 383 /* FIXME, once all of the existing PCI drivers have been fixed to set 384 * the pci shutdown function, this test can go away. */ 385 if (!drv->driver.shutdown) ··· 513 .name = "pci", 514 .match = pci_bus_match, 515 .uevent = pci_uevent, 516 + .probe = pci_device_probe, 517 + .remove = pci_device_remove, 518 .suspend = pci_device_suspend, 519 .resume = pci_device_resume, 520 .dev_attrs = pci_dev_attrs,
+2 -2
drivers/pcmcia/ds.c
··· 311 /* initialize common fields */ 312 driver->drv.bus = &pcmcia_bus_type; 313 driver->drv.owner = driver->owner; 314 - driver->drv.probe = pcmcia_device_probe; 315 - driver->drv.remove = pcmcia_device_remove; 316 317 return driver_register(&driver->drv); 318 } ··· 1198 .uevent = pcmcia_bus_uevent, 1199 .match = pcmcia_bus_match, 1200 .dev_attrs = pcmcia_dev_attrs, 1201 .suspend = pcmcia_dev_suspend, 1202 .resume = pcmcia_dev_resume, 1203 };
··· 311 /* initialize common fields */ 312 driver->drv.bus = &pcmcia_bus_type; 313 driver->drv.owner = driver->owner; 314 315 return driver_register(&driver->drv); 316 } ··· 1200 .uevent = pcmcia_bus_uevent, 1201 .match = pcmcia_bus_match, 1202 .dev_attrs = pcmcia_dev_attrs, 1203 + .probe = pcmcia_device_probe, 1204 + .remove = pcmcia_device_remove, 1205 .suspend = pcmcia_dev_suspend, 1206 .resume = pcmcia_dev_resume, 1207 };
+2 -2
drivers/pnp/driver.c
··· 195 struct bus_type pnp_bus_type = { 196 .name = "pnp", 197 .match = pnp_bus_match, 198 .suspend = pnp_bus_suspend, 199 .resume = pnp_bus_resume, 200 }; ··· 217 218 drv->driver.name = drv->name; 219 drv->driver.bus = &pnp_bus_type; 220 - drv->driver.probe = pnp_device_probe; 221 - drv->driver.remove = pnp_device_remove; 222 223 count = driver_register(&drv->driver); 224
··· 195 struct bus_type pnp_bus_type = { 196 .name = "pnp", 197 .match = pnp_bus_match, 198 + .probe = pnp_device_probe, 199 + .remove = pnp_device_remove, 200 .suspend = pnp_bus_suspend, 201 .resume = pnp_bus_resume, 202 }; ··· 215 216 drv->driver.name = drv->name; 217 drv->driver.bus = &pnp_bus_type; 218 219 count = driver_register(&drv->driver); 220
+3 -3
drivers/rapidio/rio-driver.c
··· 147 /* initialize common driver fields */ 148 rdrv->driver.name = rdrv->name; 149 rdrv->driver.bus = &rio_bus_type; 150 - rdrv->driver.probe = rio_device_probe; 151 - rdrv->driver.remove = rio_device_remove; 152 153 /* register with core */ 154 return driver_register(&rdrv->driver); ··· 202 struct bus_type rio_bus_type = { 203 .name = "rapidio", 204 .match = rio_match_bus, 205 - .dev_attrs = rio_dev_attrs 206 }; 207 208 /**
··· 147 /* initialize common driver fields */ 148 rdrv->driver.name = rdrv->name; 149 rdrv->driver.bus = &rio_bus_type; 150 151 /* register with core */ 152 return driver_register(&rdrv->driver); ··· 204 struct bus_type rio_bus_type = { 205 .name = "rapidio", 206 .match = rio_match_bus, 207 + .dev_attrs = rio_dev_attrs, 208 + .probe = rio_device_probe, 209 + .remove = rio_device_remove, 210 }; 211 212 /**
+9 -7
drivers/s390/cio/ccwgroup.c
··· 52 return 0; 53 } 54 55 - static struct bus_type ccwgroup_bus_type = { 56 - .name = "ccwgroup", 57 - .match = ccwgroup_bus_match, 58 - .uevent = ccwgroup_uevent, 59 - }; 60 61 static inline void 62 __ccwgroup_remove_symlinks(struct ccwgroup_device *gdev) ··· 385 return 0; 386 } 387 388 int 389 ccwgroup_driver_register (struct ccwgroup_driver *cdriver) 390 { ··· 400 cdriver->driver = (struct device_driver) { 401 .bus = &ccwgroup_bus_type, 402 .name = cdriver->name, 403 - .probe = ccwgroup_probe, 404 - .remove = ccwgroup_remove, 405 }; 406 407 return driver_register(&cdriver->driver);
··· 52 return 0; 53 } 54 55 + static struct bus_type ccwgroup_bus_type; 56 57 static inline void 58 __ccwgroup_remove_symlinks(struct ccwgroup_device *gdev) ··· 389 return 0; 390 } 391 392 + static struct bus_type ccwgroup_bus_type = { 393 + .name = "ccwgroup", 394 + .match = ccwgroup_bus_match, 395 + .uevent = ccwgroup_uevent, 396 + .probe = ccwgroup_probe, 397 + .remove = ccwgroup_remove, 398 + }; 399 + 400 int 401 ccwgroup_driver_register (struct ccwgroup_driver *cdriver) 402 { ··· 396 cdriver->driver = (struct device_driver) { 397 .bus = &ccwgroup_bus_type, 398 .name = cdriver->name, 399 }; 400 401 return driver_register(&cdriver->driver);
+34 -2
drivers/s390/cio/css.c
··· 542 return 0; 543 } 544 545 struct bus_type css_bus_type = { 546 - .name = "css", 547 - .match = &css_bus_match, 548 }; 549 550 subsys_initcall(init_channel_subsystem);
··· 542 return 0; 543 } 544 545 + static int 546 + css_probe (struct device *dev) 547 + { 548 + struct subchannel *sch; 549 + 550 + sch = to_subchannel(dev); 551 + sch->driver = container_of (dev->driver, struct css_driver, drv); 552 + return (sch->driver->probe ? sch->driver->probe(sch) : 0); 553 + } 554 + 555 + static int 556 + css_remove (struct device *dev) 557 + { 558 + struct subchannel *sch; 559 + 560 + sch = to_subchannel(dev); 561 + return (sch->driver->remove ? sch->driver->remove(sch) : 0); 562 + } 563 + 564 + static void 565 + css_shutdown (struct device *dev) 566 + { 567 + struct subchannel *sch; 568 + 569 + sch = to_subchannel(dev); 570 + if (sch->driver->shutdown) 571 + sch->driver->shutdown(sch); 572 + } 573 + 574 struct bus_type css_bus_type = { 575 + .name = "css", 576 + .match = css_bus_match, 577 + .probe = css_probe, 578 + .remove = css_remove, 579 + .shutdown = css_shutdown, 580 }; 581 582 subsys_initcall(init_channel_subsystem);
+4
drivers/s390/cio/css.h
··· 115 * Currently, we only care about I/O subchannels (type 0), these 116 * have a ccw_device connected to them. 117 */ 118 struct css_driver { 119 unsigned int subchannel_type; 120 struct device_driver drv; ··· 123 int (*notify)(struct device *, int); 124 void (*verify)(struct device *); 125 void (*termination)(struct device *); 126 }; 127 128 /*
··· 115 * Currently, we only care about I/O subchannels (type 0), these 116 * have a ccw_device connected to them. 117 */ 118 + struct subchannel; 119 struct css_driver { 120 unsigned int subchannel_type; 121 struct device_driver drv; ··· 122 int (*notify)(struct device *, int); 123 void (*verify)(struct device *); 124 void (*termination)(struct device *); 125 + int (*probe)(struct subchannel *); 126 + int (*remove)(struct subchannel *); 127 + void (*shutdown)(struct subchannel *); 128 }; 129 130 /*
+24 -26
drivers/s390/cio/device.c
··· 107 return 0; 108 } 109 110 - struct bus_type ccw_bus_type = { 111 - .name = "ccw", 112 - .match = &ccw_bus_match, 113 - .uevent = &ccw_uevent, 114 - }; 115 116 - static int io_subchannel_probe (struct device *); 117 - static int io_subchannel_remove (struct device *); 118 void io_subchannel_irq (struct device *); 119 static int io_subchannel_notify(struct device *, int); 120 static void io_subchannel_verify(struct device *); 121 static void io_subchannel_ioterm(struct device *); 122 - static void io_subchannel_shutdown(struct device *); 123 124 struct css_driver io_subchannel_driver = { 125 .subchannel_type = SUBCHANNEL_TYPE_IO, 126 .drv = { 127 .name = "io_subchannel", 128 .bus = &css_bus_type, 129 - .probe = &io_subchannel_probe, 130 - .remove = &io_subchannel_remove, 131 - .shutdown = &io_subchannel_shutdown, 132 }, 133 .irq = io_subchannel_irq, 134 .notify = io_subchannel_notify, 135 .verify = io_subchannel_verify, 136 .termination = io_subchannel_ioterm, 137 }; 138 139 struct workqueue_struct *ccw_device_work; ··· 799 } 800 801 static int 802 - io_subchannel_probe (struct device *pdev) 803 { 804 - struct subchannel *sch; 805 struct ccw_device *cdev; 806 int rc; 807 unsigned long flags; 808 809 - sch = to_subchannel(pdev); 810 if (sch->dev.driver_data) { 811 /* 812 * This subchannel already has an associated ccw_device. ··· 840 memset(cdev->private, 0, sizeof(struct ccw_device_private)); 841 atomic_set(&cdev->private->onoff, 0); 842 cdev->dev = (struct device) { 843 - .parent = pdev, 844 .release = ccw_device_release, 845 }; 846 INIT_LIST_HEAD(&cdev->private->kick_work.entry); ··· 853 return -ENODEV; 854 } 855 856 - rc = io_subchannel_recog(cdev, to_subchannel(pdev)); 857 if (rc) { 858 spin_lock_irqsave(&sch->lock, flags); 859 sch->dev.driver_data = NULL; ··· 877 } 878 879 static int 880 - io_subchannel_remove (struct device *dev) 881 { 882 struct ccw_device *cdev; 883 unsigned long flags; 884 885 - if (!dev->driver_data) 886 return 0; 887 - cdev = dev->driver_data; 888 /* Set ccw device to not operational and drop reference. */ 889 spin_lock_irqsave(cdev->ccwlock, flags); 890 - dev->driver_data = NULL; 891 cdev->private->state = DEV_STATE_NOT_OPER; 892 spin_unlock_irqrestore(cdev->ccwlock, flags); 893 /* ··· 942 } 943 944 static void 945 - io_subchannel_shutdown(struct device *dev) 946 { 947 - struct subchannel *sch; 948 struct ccw_device *cdev; 949 int ret; 950 951 - sch = to_subchannel(dev); 952 - cdev = dev->driver_data; 953 954 if (cio_is_console(sch->schid)) 955 return; ··· 1121 return 0; 1122 } 1123 1124 int 1125 ccw_driver_register (struct ccw_driver *cdriver) 1126 { ··· 1136 1137 drv->bus = &ccw_bus_type; 1138 drv->name = cdriver->name; 1139 - drv->probe = ccw_device_probe; 1140 - drv->remove = ccw_device_remove; 1141 1142 return driver_register(drv); 1143 }
··· 107 return 0; 108 } 109 110 + struct bus_type ccw_bus_type; 111 112 + static int io_subchannel_probe (struct subchannel *); 113 + static int io_subchannel_remove (struct subchannel *); 114 void io_subchannel_irq (struct device *); 115 static int io_subchannel_notify(struct device *, int); 116 static void io_subchannel_verify(struct device *); 117 static void io_subchannel_ioterm(struct device *); 118 + static void io_subchannel_shutdown(struct subchannel *); 119 120 struct css_driver io_subchannel_driver = { 121 .subchannel_type = SUBCHANNEL_TYPE_IO, 122 .drv = { 123 .name = "io_subchannel", 124 .bus = &css_bus_type, 125 }, 126 .irq = io_subchannel_irq, 127 .notify = io_subchannel_notify, 128 .verify = io_subchannel_verify, 129 .termination = io_subchannel_ioterm, 130 + .probe = io_subchannel_probe, 131 + .remove = io_subchannel_remove, 132 + .shutdown = io_subchannel_shutdown, 133 }; 134 135 struct workqueue_struct *ccw_device_work; ··· 803 } 804 805 static int 806 + io_subchannel_probe (struct subchannel *sch) 807 { 808 struct ccw_device *cdev; 809 int rc; 810 unsigned long flags; 811 812 if (sch->dev.driver_data) { 813 /* 814 * This subchannel already has an associated ccw_device. ··· 846 memset(cdev->private, 0, sizeof(struct ccw_device_private)); 847 atomic_set(&cdev->private->onoff, 0); 848 cdev->dev = (struct device) { 849 + .parent = &sch->dev, 850 .release = ccw_device_release, 851 }; 852 INIT_LIST_HEAD(&cdev->private->kick_work.entry); ··· 859 return -ENODEV; 860 } 861 862 + rc = io_subchannel_recog(cdev, sch); 863 if (rc) { 864 spin_lock_irqsave(&sch->lock, flags); 865 sch->dev.driver_data = NULL; ··· 883 } 884 885 static int 886 + io_subchannel_remove (struct subchannel *sch) 887 { 888 struct ccw_device *cdev; 889 unsigned long flags; 890 891 + if (!sch->dev.driver_data) 892 return 0; 893 + cdev = sch->dev.driver_data; 894 /* Set ccw device to not operational and drop reference. */ 895 spin_lock_irqsave(cdev->ccwlock, flags); 896 + sch->dev.driver_data = NULL; 897 cdev->private->state = DEV_STATE_NOT_OPER; 898 spin_unlock_irqrestore(cdev->ccwlock, flags); 899 /* ··· 948 } 949 950 static void 951 + io_subchannel_shutdown(struct subchannel *sch) 952 { 953 struct ccw_device *cdev; 954 int ret; 955 956 + cdev = sch->dev.driver_data; 957 958 if (cio_is_console(sch->schid)) 959 return; ··· 1129 return 0; 1130 } 1131 1132 + struct bus_type ccw_bus_type = { 1133 + .name = "ccw", 1134 + .match = ccw_bus_match, 1135 + .uevent = ccw_uevent, 1136 + .probe = ccw_device_probe, 1137 + .remove = ccw_device_remove, 1138 + }; 1139 + 1140 int 1141 ccw_driver_register (struct ccw_driver *cdriver) 1142 { ··· 1136 1137 drv->bus = &ccw_bus_type; 1138 drv->name = cdriver->name; 1139 1140 return driver_register(drv); 1141 }
+2 -2
drivers/scsi/scsi_debug.c
··· 221 static struct device_driver sdebug_driverfs_driver = { 222 .name = sdebug_proc_name, 223 .bus = &pseudo_lld_bus, 224 - .probe = sdebug_driver_probe, 225 - .remove = sdebug_driver_remove, 226 }; 227 228 static const int check_condition_result = ··· 1794 static struct bus_type pseudo_lld_bus = { 1795 .name = "pseudo", 1796 .match = pseudo_lld_bus_match, 1797 }; 1798 1799 static void sdebug_release_adapter(struct device * dev)
··· 221 static struct device_driver sdebug_driverfs_driver = { 222 .name = sdebug_proc_name, 223 .bus = &pseudo_lld_bus, 224 }; 225 226 static const int check_condition_result = ··· 1796 static struct bus_type pseudo_lld_bus = { 1797 .name = "pseudo", 1798 .match = pseudo_lld_bus_match, 1799 + .probe = sdebug_driver_probe, 1800 + .remove = sdebug_driver_remove, 1801 }; 1802 1803 static void sdebug_release_adapter(struct device * dev)
+2 -2
drivers/sh/superhyway/superhyway.c
··· 175 { 176 drv->drv.name = drv->name; 177 drv->drv.bus = &superhyway_bus_type; 178 - drv->drv.probe = superhyway_device_probe; 179 - drv->drv.remove = superhyway_device_remove; 180 181 return driver_register(&drv->drv); 182 } ··· 211 #ifdef CONFIG_SYSFS 212 .dev_attrs = superhyway_dev_attrs, 213 #endif 214 }; 215 216 static int __init superhyway_bus_init(void)
··· 175 { 176 drv->drv.name = drv->name; 177 drv->drv.bus = &superhyway_bus_type; 178 179 return driver_register(&drv->drv); 180 } ··· 213 #ifdef CONFIG_SYSFS 214 .dev_attrs = superhyway_dev_attrs, 215 #endif 216 + .probe = superhyway_device_probe, 217 + .remove = superhyway_device_remove, 218 }; 219 220 static int __init superhyway_bus_init(void)
-3
drivers/usb/gadget/ether.c
··· 2534 .driver = { 2535 .name = (char *) shortname, 2536 .owner = THIS_MODULE, 2537 - // .shutdown = ... 2538 - // .suspend = ... 2539 - // .resume = ... 2540 }, 2541 }; 2542
··· 2534 .driver = { 2535 .name = (char *) shortname, 2536 .owner = THIS_MODULE, 2537 }, 2538 }; 2539
-3
drivers/usb/gadget/inode.c
··· 1738 1739 .driver = { 1740 .name = (char *) shortname, 1741 - // .shutdown = ... 1742 - // .suspend = ... 1743 - // .resume = ... 1744 }, 1745 }; 1746
··· 1738 1739 .driver = { 1740 .name = (char *) shortname, 1741 }, 1742 }; 1743
-3
drivers/usb/gadget/serial.c
··· 374 .disconnect = gs_disconnect, 375 .driver = { 376 .name = GS_SHORT_NAME, 377 - /* .shutdown = ... */ 378 - /* .suspend = ... */ 379 - /* .resume = ... */ 380 }, 381 }; 382
··· 374 .disconnect = gs_disconnect, 375 .driver = { 376 .name = GS_SHORT_NAME, 377 }, 378 }; 379
-3
drivers/usb/gadget/zero.c
··· 1303 .driver = { 1304 .name = (char *) shortname, 1305 .owner = THIS_MODULE, 1306 - // .shutdown = ... 1307 - // .suspend = ... 1308 - // .resume = ... 1309 }, 1310 }; 1311
··· 1303 .driver = { 1304 .name = (char *) shortname, 1305 .owner = THIS_MODULE, 1306 }, 1307 }; 1308
+7 -8
drivers/usb/serial/bus.c
··· 37 return 0; 38 } 39 40 - struct bus_type usb_serial_bus_type = { 41 - .name = "usb-serial", 42 - .match = usb_serial_device_match, 43 - }; 44 - 45 static int usb_serial_device_probe (struct device *dev) 46 { 47 struct usb_serial_driver *driver; ··· 104 return retval; 105 } 106 107 int usb_serial_bus_register(struct usb_serial_driver *driver) 108 { 109 int retval; 110 111 driver->driver.bus = &usb_serial_bus_type; 112 - driver->driver.probe = usb_serial_device_probe; 113 - driver->driver.remove = usb_serial_device_remove; 114 - 115 retval = driver_register(&driver->driver); 116 117 return retval;
··· 37 return 0; 38 } 39 40 static int usb_serial_device_probe (struct device *dev) 41 { 42 struct usb_serial_driver *driver; ··· 109 return retval; 110 } 111 112 + struct bus_type usb_serial_bus_type = { 113 + .name = "usb-serial", 114 + .match = usb_serial_device_match, 115 + .probe = usb_serial_device_probe, 116 + .remove = usb_serial_device_remove, 117 + }; 118 + 119 int usb_serial_bus_register(struct usb_serial_driver *driver) 120 { 121 int retval; 122 123 driver->driver.bus = &usb_serial_bus_type; 124 retval = driver_register(&driver->driver); 125 126 return retval;
+2 -2
drivers/zorro/zorro-driver.c
··· 77 /* initialize common driver fields */ 78 drv->driver.name = drv->name; 79 drv->driver.bus = &zorro_bus_type; 80 - drv->driver.probe = zorro_device_probe; 81 82 /* register with core */ 83 count = driver_register(&drv->driver); ··· 131 132 struct bus_type zorro_bus_type = { 133 .name = "zorro", 134 - .match = zorro_bus_match 135 }; 136 137
··· 77 /* initialize common driver fields */ 78 drv->driver.name = drv->name; 79 drv->driver.bus = &zorro_bus_type; 80 81 /* register with core */ 82 count = driver_register(&drv->driver); ··· 132 133 struct bus_type zorro_bus_type = { 134 .name = "zorro", 135 + .match = zorro_bus_match, 136 + .probe = zorro_device_probe, 137 }; 138 139
+3
include/linux/device.h
··· 49 int (*match)(struct device * dev, struct device_driver * drv); 50 int (*uevent)(struct device *dev, char **envp, 51 int num_envp, char *buffer, int buffer_size); 52 int (*suspend)(struct device * dev, pm_message_t state); 53 int (*resume)(struct device * dev); 54 };
··· 49 int (*match)(struct device * dev, struct device_driver * drv); 50 int (*uevent)(struct device *dev, char **envp, 51 int num_envp, char *buffer, int buffer_size); 52 + int (*probe)(struct device * dev); 53 + int (*remove)(struct device * dev); 54 + void (*shutdown)(struct device * dev); 55 int (*suspend)(struct device * dev, pm_message_t state); 56 int (*resume)(struct device * dev); 57 };
+5
include/linux/ide.h
··· 983 ide_startstop_t (*abort)(ide_drive_t *, struct request *rq); 984 ide_proc_entry_t *proc; 985 struct device_driver gen_driver; 986 } ide_driver_t; 987 988 int generic_ide_ioctl(ide_drive_t *, struct file *, struct block_device *, unsigned, unsigned long); 989
··· 983 ide_startstop_t (*abort)(ide_drive_t *, struct request *rq); 984 ide_proc_entry_t *proc; 985 struct device_driver gen_driver; 986 + int (*probe)(ide_drive_t *); 987 + void (*remove)(ide_drive_t *); 988 + void (*shutdown)(ide_drive_t *); 989 } ide_driver_t; 990 + 991 + #define to_ide_driver(drv) container_of(drv, ide_driver_t, gen_driver) 992 993 int generic_ide_ioctl(ide_drive_t *, struct file *, struct block_device *, unsigned, unsigned long); 994