aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@trik.(none)>2005-01-15 05:30:53 +0100
committerBartlomiej Zolnierkiewicz <bzolnier@trik.(none)>2005-01-15 05:30:53 +0100
commitd9ffb29e5c7287a2fe9274ae1272ddbe0dccb7a9 (patch)
tree2fd410cf9dce6d96875902352965fbd64b69eab9 /drivers
parent85c51989b155af5d442f2bcd1c6f3782b9386c88 (diff)
downloadhistory-d9ffb29e5c7287a2fe9274ae1272ddbe0dccb7a9.tar.gz
[ide] kill default_{attach,cleanup}()
Device drivers are supposed to provide their own ->attach and ->cleanup. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/ide/ide-default.c1
-rw-r--r--drivers/ide/ide.c22
2 files changed, 3 insertions, 20 deletions
diff --git a/drivers/ide/ide-default.c b/drivers/ide/ide-default.c
index a6bea5d0de036f..99fc59db018832 100644
--- a/drivers/ide/ide-default.c
+++ b/drivers/ide/ide-default.c
@@ -46,6 +46,7 @@ ide_driver_t idedefault_driver = {
.name = "ide-default",
.version = IDEDEFAULT_VERSION,
.attach = idedefault_attach,
+ .cleanup = ide_unregister_subdriver,
.drives = LIST_HEAD_INIT(idedefault_driver.drives)
};
diff --git a/drivers/ide/ide.c b/drivers/ide/ide.c
index 83dc9af31b2728..e96ae74bcb97ea 100644
--- a/drivers/ide/ide.c
+++ b/drivers/ide/ide.c
@@ -2018,16 +2018,6 @@ static void __init probe_for_hwifs (void)
#endif
}
-/*
- * Actually unregister the subdriver. Called with the
- * request lock dropped.
- */
-
-static int default_cleanup (ide_drive_t *drive)
-{
- return ide_unregister_subdriver(drive);
-}
-
static ide_startstop_t default_do_request (ide_drive_t *drive, struct request *rq, sector_t block)
{
ide_end_request(drive, 0, 0);
@@ -2063,14 +2053,6 @@ static ide_startstop_t default_special (ide_drive_t *drive)
return ide_stopped;
}
-static int default_attach (ide_drive_t *drive)
-{
- printk(KERN_ERR "%s: does not support hotswap of device class !\n",
- drive->name);
-
- return 0;
-}
-
static ide_startstop_t default_abort(ide_drive_t *drive, struct request *rq)
{
return __ide_abort(drive, rq);
@@ -2085,7 +2067,8 @@ static ide_startstop_t default_start_power_step(ide_drive_t *drive,
static void setup_driver_defaults (ide_driver_t *d)
{
- if (d->cleanup == NULL) d->cleanup = default_cleanup;
+ BUG_ON(d->attach == NULL || d->cleanup == NULL);
+
if (d->do_request == NULL) d->do_request = default_do_request;
if (d->end_request == NULL) d->end_request = default_end_request;
if (d->error == NULL) d->error = default_error;
@@ -2093,7 +2076,6 @@ static void setup_driver_defaults (ide_driver_t *d)
if (d->pre_reset == NULL) d->pre_reset = default_pre_reset;
if (d->capacity == NULL) d->capacity = default_capacity;
if (d->special == NULL) d->special = default_special;
- if (d->attach == NULL) d->attach = default_attach;
if (d->start_power_step == NULL)
d->start_power_step = default_start_power_step;
}