summaryrefslogtreecommitdiff
path: root/drivers/ide/ide.c
diff options
context:
space:
mode:
authorRussell King <rmk@arm.linux.org.uk>2006-01-06 11:41:00 +0000
committerGreg Kroah-Hartman <gregkh@suse.de>2006-01-13 11:26:10 -0800
commit4031bbe4bbec6c0fe50412ef7fb43a270b0f29f1 (patch)
tree1e1449ba492ab04d8c5fbc75f9761be237bcae72 /drivers/ide/ide.c
parentbbbe3a41f7ee529f7f4fdcc1bc1157234bac0766 (diff)
[PATCH] Add ide_bus_type probe and remove methods
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/ide/ide.c')
-rw-r--r--drivers/ide/ide.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/drivers/ide/ide.c b/drivers/ide/ide.c
index ec5a4cb173b..afeb02bbb72 100644
--- a/drivers/ide/ide.c
+++ b/drivers/ide/ide.c
@@ -1949,10 +1949,41 @@ static int ide_uevent(struct device *dev, char **envp, int num_envp,
return 0;
}
+static int generic_ide_probe(struct device *dev)
+{
+ ide_drive_t *drive = to_ide_device(dev);
+ ide_driver_t *drv = to_ide_driver(dev->driver);
+
+ return drv->probe ? drv->probe(drive) : -ENODEV;
+}
+
+static int generic_ide_remove(struct device *dev)
+{
+ ide_drive_t *drive = to_ide_device(dev);
+ ide_driver_t *drv = to_ide_driver(dev->driver);
+
+ if (drv->remove)
+ drv->remove(drive);
+
+ return 0;
+}
+
+static void generic_ide_shutdown(struct device *dev)
+{
+ ide_drive_t *drive = to_ide_device(dev);
+ ide_driver_t *drv = to_ide_driver(dev->driver);
+
+ if (dev->driver && drv->shutdown)
+ drv->shutdown(drive);
+}
+
struct bus_type ide_bus_type = {
.name = "ide",
.match = ide_bus_match,
.uevent = ide_uevent,
+ .probe = generic_ide_probe,
+ .remove = generic_ide_remove,
+ .shutdown = generic_ide_shutdown,
.dev_attrs = ide_dev_attrs,
.suspend = generic_ide_suspend,
.resume = generic_ide_resume,