From 594c8281f90560faf9632d91bb9d402cbe560e63 Mon Sep 17 00:00:00 2001 From: Russell King Date: Thu, 5 Jan 2006 14:29:51 +0000 Subject: [PATCH] Add bus_type probe, remove, shutdown methods. Add bus_type probe, remove and shutdown methods to replace the corresponding methods in struct device_driver. This matches the way we handle the suspend/resume methods. Since the bus methods override the device_driver methods, warn if a device driver is registered whose methods will not be called. The long-term idea is to remove the device_driver methods entirely. Signed-off-by: Russell King Signed-off-by: Greg Kroah-Hartman --- include/linux/device.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include') diff --git a/include/linux/device.h b/include/linux/device.h index 0cdee78e5ce..58df18d9cd3 100644 --- a/include/linux/device.h +++ b/include/linux/device.h @@ -49,6 +49,9 @@ struct bus_type { int (*match)(struct device * dev, struct device_driver * drv); int (*uevent)(struct device *dev, char **envp, int num_envp, char *buffer, int buffer_size); + int (*probe)(struct device * dev); + int (*remove)(struct device * dev); + void (*shutdown)(struct device * dev); int (*suspend)(struct device * dev, pm_message_t state); int (*resume)(struct device * dev); }; -- cgit v1.2.3 From 4031bbe4bbec6c0fe50412ef7fb43a270b0f29f1 Mon Sep 17 00:00:00 2001 From: Russell King Date: Fri, 6 Jan 2006 11:41:00 +0000 Subject: [PATCH] Add ide_bus_type probe and remove methods Signed-off-by: Russell King Signed-off-by: Greg Kroah-Hartman --- include/linux/ide.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'include') diff --git a/include/linux/ide.h b/include/linux/ide.h index f2e1b5b2289..110b3cfac02 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h @@ -983,8 +983,13 @@ typedef struct ide_driver_s { ide_startstop_t (*abort)(ide_drive_t *, struct request *rq); ide_proc_entry_t *proc; struct device_driver gen_driver; + int (*probe)(ide_drive_t *); + void (*remove)(ide_drive_t *); + void (*shutdown)(ide_drive_t *); } ide_driver_t; +#define to_ide_driver(drv) container_of(drv, ide_driver_t, gen_driver) + int generic_ide_ioctl(ide_drive_t *, struct file *, struct block_device *, unsigned, unsigned long); /* -- cgit v1.2.3