diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@elka.pw.edu.pl> | 2005-05-26 08:55:34 -0400 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@elka.pw.edu.pl> | 2005-05-26 08:55:34 -0400 |
commit | 8604affde9d4f52f04342d6a37c77d95fa167e7a (patch) | |
tree | 12143c1be244c69c7c2b488a34856f60d0625e03 /include/linux | |
parent | bef9c558841604116704e10b3d9ff3dbf4939423 (diff) |
[PATCH] convert IDE device drivers to driver-model
* add ide_bus_match() and export ide_bus_type
* split ide_remove_driver_from_hwgroup() out of ide_unregister()
* move device cleanup from ide_unregister() to drive_release_dev()
* convert ide_driver_t->name to driver->name
* convert ide_driver_t->{attach,cleanup} to driver->{probe,remove}
* remove ide_driver_t->busy as ide_bus_type->subsys.rwsem
protects against concurrent ->{probe,remove} calls
* make ide_{un}register_driver() void as it cannot fail now
* use driver_{un}register() directly, remove ide_{un}register_driver()
* use device_register() instead of ata_attach(), remove ata_attach()
* add proc_print_driver() and ide_drivers_show(), remove ide_drivers_op
* fix ide_replace_subdriver() and move it to ide-proc.c
* remove ide_driver_t->drives, ide_drives and drives_lock
* remove ide_driver_t->drivers, drivers and drivers_lock
* remove ide_drive_t->driver and DRIVER() macro
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@elka.pw.edu.pl>
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/ide.h | 20 |
1 files changed, 4 insertions, 16 deletions
diff --git a/include/linux/ide.h b/include/linux/ide.h index 9cfc0999becb..336d6e509f59 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h | |||
@@ -664,7 +664,6 @@ typedef struct ide_drive_s { | |||
664 | 664 | ||
665 | struct request *rq; /* current request */ | 665 | struct request *rq; /* current request */ |
666 | struct ide_drive_s *next; /* circular list of hwgroup drives */ | 666 | struct ide_drive_s *next; /* circular list of hwgroup drives */ |
667 | struct ide_driver_s *driver;/* (ide_driver_t *) */ | ||
668 | void *driver_data; /* extra driver data */ | 667 | void *driver_data; /* extra driver data */ |
669 | struct hd_driveid *id; /* drive model identification info */ | 668 | struct hd_driveid *id; /* drive model identification info */ |
670 | struct proc_dir_entry *proc; /* /proc/ide/ directory entry */ | 669 | struct proc_dir_entry *proc; /* /proc/ide/ directory entry */ |
@@ -758,6 +757,8 @@ typedef struct ide_drive_s { | |||
758 | struct semaphore gendev_rel_sem; /* to deal with device release() */ | 757 | struct semaphore gendev_rel_sem; /* to deal with device release() */ |
759 | } ide_drive_t; | 758 | } ide_drive_t; |
760 | 759 | ||
760 | #define to_ide_device(dev)container_of(dev, ide_drive_t, gendev) | ||
761 | |||
761 | #define IDE_CHIPSET_PCI_MASK \ | 762 | #define IDE_CHIPSET_PCI_MASK \ |
762 | ((1<<ide_pci)|(1<<ide_cmd646)|(1<<ide_ali14xx)) | 763 | ((1<<ide_pci)|(1<<ide_cmd646)|(1<<ide_ali14xx)) |
763 | #define IDE_CHIPSET_IS_PCI(c) ((IDE_CHIPSET_PCI_MASK >> (c)) & 1) | 764 | #define IDE_CHIPSET_IS_PCI(c) ((IDE_CHIPSET_PCI_MASK >> (c)) & 1) |
@@ -1086,28 +1087,20 @@ enum { | |||
1086 | */ | 1087 | */ |
1087 | typedef struct ide_driver_s { | 1088 | typedef struct ide_driver_s { |
1088 | struct module *owner; | 1089 | struct module *owner; |
1089 | const char *name; | ||
1090 | const char *version; | 1090 | const char *version; |
1091 | u8 media; | 1091 | u8 media; |
1092 | unsigned busy : 1; | ||
1093 | unsigned supports_dsc_overlap : 1; | 1092 | unsigned supports_dsc_overlap : 1; |
1094 | int (*cleanup)(ide_drive_t *); | ||
1095 | ide_startstop_t (*do_request)(ide_drive_t *, struct request *, sector_t); | 1093 | ide_startstop_t (*do_request)(ide_drive_t *, struct request *, sector_t); |
1096 | int (*end_request)(ide_drive_t *, int, int); | 1094 | int (*end_request)(ide_drive_t *, int, int); |
1097 | ide_startstop_t (*error)(ide_drive_t *, struct request *rq, u8, u8); | 1095 | ide_startstop_t (*error)(ide_drive_t *, struct request *rq, u8, u8); |
1098 | ide_startstop_t (*abort)(ide_drive_t *, struct request *rq); | 1096 | ide_startstop_t (*abort)(ide_drive_t *, struct request *rq); |
1099 | int (*ioctl)(ide_drive_t *, struct inode *, struct file *, unsigned int, unsigned long); | 1097 | int (*ioctl)(ide_drive_t *, struct inode *, struct file *, unsigned int, unsigned long); |
1100 | ide_proc_entry_t *proc; | 1098 | ide_proc_entry_t *proc; |
1101 | int (*attach)(ide_drive_t *); | ||
1102 | void (*ata_prebuilder)(ide_drive_t *); | 1099 | void (*ata_prebuilder)(ide_drive_t *); |
1103 | void (*atapi_prebuilder)(ide_drive_t *); | 1100 | void (*atapi_prebuilder)(ide_drive_t *); |
1104 | struct device_driver gen_driver; | 1101 | struct device_driver gen_driver; |
1105 | struct list_head drives; | ||
1106 | struct list_head drivers; | ||
1107 | } ide_driver_t; | 1102 | } ide_driver_t; |
1108 | 1103 | ||
1109 | #define DRIVER(drive) ((drive)->driver) | ||
1110 | |||
1111 | int generic_ide_ioctl(ide_drive_t *, struct file *, struct block_device *, unsigned, unsigned long); | 1104 | int generic_ide_ioctl(ide_drive_t *, struct file *, struct block_device *, unsigned, unsigned long); |
1112 | 1105 | ||
1113 | /* | 1106 | /* |
@@ -1328,8 +1321,6 @@ extern void ide_init_subdrivers(void); | |||
1328 | 1321 | ||
1329 | void ide_init_disk(struct gendisk *, ide_drive_t *); | 1322 | void ide_init_disk(struct gendisk *, ide_drive_t *); |
1330 | 1323 | ||
1331 | extern int ata_attach(ide_drive_t *); | ||
1332 | |||
1333 | extern int ideprobe_init(void); | 1324 | extern int ideprobe_init(void); |
1334 | 1325 | ||
1335 | extern void ide_scan_pcibus(int scan_direction) __init; | 1326 | extern void ide_scan_pcibus(int scan_direction) __init; |
@@ -1342,11 +1333,8 @@ extern void default_hwif_iops(ide_hwif_t *); | |||
1342 | extern void default_hwif_mmiops(ide_hwif_t *); | 1333 | extern void default_hwif_mmiops(ide_hwif_t *); |
1343 | extern void default_hwif_transport(ide_hwif_t *); | 1334 | extern void default_hwif_transport(ide_hwif_t *); |
1344 | 1335 | ||
1345 | int ide_register_driver(ide_driver_t *driver); | 1336 | void ide_register_subdriver(ide_drive_t *, ide_driver_t *); |
1346 | void ide_unregister_driver(ide_driver_t *driver); | 1337 | void ide_unregister_subdriver(ide_drive_t *, ide_driver_t *); |
1347 | int ide_register_subdriver(ide_drive_t *, ide_driver_t *); | ||
1348 | int ide_unregister_subdriver (ide_drive_t *drive); | ||
1349 | int ide_replace_subdriver(ide_drive_t *drive, const char *driver); | ||
1350 | 1338 | ||
1351 | #define ON_BOARD 1 | 1339 | #define ON_BOARD 1 |
1352 | #define NEVER_BOARD 0 | 1340 | #define NEVER_BOARD 0 |