aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@elka.pw.edu.pl>2005-05-26 08:55:34 -0400
committerBartlomiej Zolnierkiewicz <bzolnier@elka.pw.edu.pl>2005-05-26 08:55:34 -0400
commit8604affde9d4f52f04342d6a37c77d95fa167e7a (patch)
tree12143c1be244c69c7c2b488a34856f60d0625e03 /include
parentbef9c558841604116704e10b3d9ff3dbf4939423 (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')
-rw-r--r--include/linux/ide.h20
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 */
1087typedef struct ide_driver_s { 1088typedef 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
1111int generic_ide_ioctl(ide_drive_t *, struct file *, struct block_device *, unsigned, unsigned long); 1104int 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
1329void ide_init_disk(struct gendisk *, ide_drive_t *); 1322void ide_init_disk(struct gendisk *, ide_drive_t *);
1330 1323
1331extern int ata_attach(ide_drive_t *);
1332
1333extern int ideprobe_init(void); 1324extern int ideprobe_init(void);
1334 1325
1335extern void ide_scan_pcibus(int scan_direction) __init; 1326extern void ide_scan_pcibus(int scan_direction) __init;
@@ -1342,11 +1333,8 @@ extern void default_hwif_iops(ide_hwif_t *);
1342extern void default_hwif_mmiops(ide_hwif_t *); 1333extern void default_hwif_mmiops(ide_hwif_t *);
1343extern void default_hwif_transport(ide_hwif_t *); 1334extern void default_hwif_transport(ide_hwif_t *);
1344 1335
1345int ide_register_driver(ide_driver_t *driver); 1336void ide_register_subdriver(ide_drive_t *, ide_driver_t *);
1346void ide_unregister_driver(ide_driver_t *driver); 1337void ide_unregister_subdriver(ide_drive_t *, ide_driver_t *);
1347int ide_register_subdriver(ide_drive_t *, ide_driver_t *);
1348int ide_unregister_subdriver (ide_drive_t *drive);
1349int 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