aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/ide.c
diff options
context:
space:
mode:
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 ec5a4cb173b0..afeb02bbb722 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,
1949 return 0; 1949 return 0;
1950} 1950}
1951 1951
1952static 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
1960static 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
1971static 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
1952struct bus_type ide_bus_type = { 1980struct bus_type ide_bus_type = {
1953 .name = "ide", 1981 .name = "ide",
1954 .match = ide_bus_match, 1982 .match = ide_bus_match,
1955 .uevent = ide_uevent, 1983 .uevent = ide_uevent,
1984 .probe = generic_ide_probe,
1985 .remove = generic_ide_remove,
1986 .shutdown = generic_ide_shutdown,
1956 .dev_attrs = ide_dev_attrs, 1987 .dev_attrs = ide_dev_attrs,
1957 .suspend = generic_ide_suspend, 1988 .suspend = generic_ide_suspend,
1958 .resume = generic_ide_resume, 1989 .resume = generic_ide_resume,