From 6cdf6eb357c2681596b7b1672b92396ba82333d4 Mon Sep 17 00:00:00 2001 From: Bartlomiej Zolnierkiewicz Date: Thu, 24 Jul 2008 22:53:14 +0200 Subject: ide: add ->dev and ->host_priv fields to struct ide_host * Add 'struct device *dev[2]' and 'void *host_priv' fields to struct ide_host. * Set ->dev[] in ide_host_alloc_all()/ide_setup_pci_device[s](). * Pass 'void *priv' argument to ide_setup_pci_device[s]() and use it to set ->host_priv. * Set PCI dev's ->driver_data to point to the struct ide_host instance if PCI host driver wants to use ->host_priv. * Rename ide_setup_pci_device[s]() to ide_pci_init_{one,two}(). Signed-off-by: Bartlomiej Zolnierkiewicz --- include/linux/ide.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/linux/ide.h b/include/linux/ide.h index d67ccca2b964..776c574c9640 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h @@ -626,6 +626,8 @@ typedef struct hwif_s { struct ide_host { ide_hwif_t *ports[MAX_HWIFS]; unsigned int n_ports; + struct device *dev[2]; + void *host_priv; }; /* @@ -1201,8 +1203,9 @@ struct ide_port_info { u8 udma_mask; }; -int ide_setup_pci_device(struct pci_dev *, const struct ide_port_info *); -int ide_setup_pci_devices(struct pci_dev *, struct pci_dev *, const struct ide_port_info *); +int ide_pci_init_one(struct pci_dev *, const struct ide_port_info *, void *); +int ide_pci_init_two(struct pci_dev *, struct pci_dev *, + const struct ide_port_info *, void *); void ide_map_sg(ide_drive_t *, struct request *); void ide_init_sg_cmd(ide_drive_t *, struct request *); -- cgit v1.2.3 From 08da591e14cf87247ec09b17c350235157a92fc3 Mon Sep 17 00:00:00 2001 From: Bartlomiej Zolnierkiewicz Date: Thu, 24 Jul 2008 22:53:15 +0200 Subject: ide: add ide_device_{get,put}() helpers * Add 'struct ide_host *host' field to ide_hwif_t and set it in ide_host_alloc_all(). * Add ide_device_{get,put}() helpers loosely based on SCSI's scsi_device_{get,put}() ones. * Convert IDE device drivers to use ide_device_{get,put}(). Signed-off-by: Bartlomiej Zolnierkiewicz --- drivers/ide/ide-cd.c | 12 +++++++++--- drivers/ide/ide-disk.c | 12 +++++++++--- drivers/ide/ide-floppy.c | 12 +++++++++--- drivers/ide/ide-probe.c | 2 ++ drivers/ide/ide-tape.c | 12 +++++++++--- drivers/ide/ide.c | 47 +++++++++++++++++++++++++++++++++++++++++++++++ drivers/scsi/ide-scsi.c | 8 +++++++- include/linux/ide.h | 7 +++++++ 8 files changed, 99 insertions(+), 13 deletions(-) (limited to 'include') diff --git a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c index 4e73aeee4053..8f253e5f26a8 100644 --- a/drivers/ide/ide-cd.c +++ b/drivers/ide/ide-cd.c @@ -57,23 +57,29 @@ static DEFINE_MUTEX(idecd_ref_mutex); #define ide_cd_g(disk) \ container_of((disk)->private_data, struct cdrom_info, driver) +static void ide_cd_release(struct kref *); + static struct cdrom_info *ide_cd_get(struct gendisk *disk) { struct cdrom_info *cd = NULL; mutex_lock(&idecd_ref_mutex); cd = ide_cd_g(disk); - if (cd) + if (cd) { kref_get(&cd->kref); + if (ide_device_get(cd->drive)) { + kref_put(&cd->kref, ide_cd_release); + cd = NULL; + } + } mutex_unlock(&idecd_ref_mutex); return cd; } -static void ide_cd_release(struct kref *); - static void ide_cd_put(struct cdrom_info *cd) { mutex_lock(&idecd_ref_mutex); + ide_device_put(cd->drive); kref_put(&cd->kref, ide_cd_release); mutex_unlock(&idecd_ref_mutex); } diff --git a/drivers/ide/ide-disk.c b/drivers/ide/ide-disk.c index df5fe5756871..28d85b410f7c 100644 --- a/drivers/ide/ide-disk.c +++ b/drivers/ide/ide-disk.c @@ -56,23 +56,29 @@ static DEFINE_MUTEX(idedisk_ref_mutex); #define ide_disk_g(disk) \ container_of((disk)->private_data, struct ide_disk_obj, driver) +static void ide_disk_release(struct kref *); + static struct ide_disk_obj *ide_disk_get(struct gendisk *disk) { struct ide_disk_obj *idkp = NULL; mutex_lock(&idedisk_ref_mutex); idkp = ide_disk_g(disk); - if (idkp) + if (idkp) { kref_get(&idkp->kref); + if (ide_device_get(idkp->drive)) { + kref_put(&idkp->kref, ide_disk_release); + idkp = NULL; + } + } mutex_unlock(&idedisk_ref_mutex); return idkp; } -static void ide_disk_release(struct kref *); - static void ide_disk_put(struct ide_disk_obj *idkp) { mutex_lock(&idedisk_ref_mutex); + ide_device_put(idkp->drive); kref_put(&idkp->kref, ide_disk_release); mutex_unlock(&idedisk_ref_mutex); } diff --git a/drivers/ide/ide-floppy.c b/drivers/ide/ide-floppy.c index 3d8e6dd0f41e..ca11a26746f1 100644 --- a/drivers/ide/ide-floppy.c +++ b/drivers/ide/ide-floppy.c @@ -158,23 +158,29 @@ static DEFINE_MUTEX(idefloppy_ref_mutex); #define ide_floppy_g(disk) \ container_of((disk)->private_data, struct ide_floppy_obj, driver) +static void idefloppy_cleanup_obj(struct kref *); + static struct ide_floppy_obj *ide_floppy_get(struct gendisk *disk) { struct ide_floppy_obj *floppy = NULL; mutex_lock(&idefloppy_ref_mutex); floppy = ide_floppy_g(disk); - if (floppy) + if (floppy) { kref_get(&floppy->kref); + if (ide_device_get(floppy->drive)) { + kref_put(&floppy->kref, idefloppy_cleanup_obj); + floppy = NULL; + } + } mutex_unlock(&idefloppy_ref_mutex); return floppy; } -static void idefloppy_cleanup_obj(struct kref *); - static void ide_floppy_put(struct ide_floppy_obj *floppy) { mutex_lock(&idefloppy_ref_mutex); + ide_device_put(floppy->drive); kref_put(&floppy->kref, idefloppy_cleanup_obj); mutex_unlock(&idefloppy_ref_mutex); } diff --git a/drivers/ide/ide-probe.c b/drivers/ide/ide-probe.c index 890c15b1b3ae..9ab5892eaea1 100644 --- a/drivers/ide/ide-probe.c +++ b/drivers/ide/ide-probe.c @@ -1595,6 +1595,8 @@ struct ide_host *ide_host_alloc_all(const struct ide_port_info *d, ide_init_port_data(hwif, idx); + hwif->host = host; + host->ports[i] = hwif; host->n_ports++; } diff --git a/drivers/ide/ide-tape.c b/drivers/ide/ide-tape.c index 6962ca4891a1..789f3428f072 100644 --- a/drivers/ide/ide-tape.c +++ b/drivers/ide/ide-tape.c @@ -322,23 +322,29 @@ static struct class *idetape_sysfs_class; #define ide_tape_g(disk) \ container_of((disk)->private_data, struct ide_tape_obj, driver) +static void ide_tape_release(struct kref *); + static struct ide_tape_obj *ide_tape_get(struct gendisk *disk) { struct ide_tape_obj *tape = NULL; mutex_lock(&idetape_ref_mutex); tape = ide_tape_g(disk); - if (tape) + if (tape) { kref_get(&tape->kref); + if (ide_device_get(tape->drive)) { + kref_put(&tape->kref, ide_tape_release); + tape = NULL; + } + } mutex_unlock(&idetape_ref_mutex); return tape; } -static void ide_tape_release(struct kref *); - static void ide_tape_put(struct ide_tape_obj *tape) { mutex_lock(&idetape_ref_mutex); + ide_device_put(tape->drive); kref_put(&tape->kref, ide_tape_release); mutex_unlock(&idetape_ref_mutex); } diff --git a/drivers/ide/ide.c b/drivers/ide/ide.c index 60f0ca66aa93..772451600e4d 100644 --- a/drivers/ide/ide.c +++ b/drivers/ide/ide.c @@ -618,6 +618,53 @@ set_val: EXPORT_SYMBOL(generic_ide_ioctl); +/** + * ide_device_get - get an additional reference to a ide_drive_t + * @drive: device to get a reference to + * + * Gets a reference to the ide_drive_t and increments the use count of the + * underlying LLDD module. + */ +int ide_device_get(ide_drive_t *drive) +{ + struct device *host_dev; + struct module *module; + + if (!get_device(&drive->gendev)) + return -ENXIO; + + host_dev = drive->hwif->host->dev[0]; + module = host_dev ? host_dev->driver->owner : NULL; + + if (module && !try_module_get(module)) { + put_device(&drive->gendev); + return -ENXIO; + } + + return 0; +} +EXPORT_SYMBOL_GPL(ide_device_get); + +/** + * ide_device_put - release a reference to a ide_drive_t + * @drive: device to release a reference on + * + * Release a reference to the ide_drive_t and decrements the use count of + * the underlying LLDD module. + */ +void ide_device_put(ide_drive_t *drive) +{ +#ifdef CONFIG_MODULE_UNLOAD + struct device *host_dev = drive->hwif->host->dev[0]; + struct module *module = host_dev ? host_dev->driver->owner : NULL; + + if (module) + module_put(module); +#endif + put_device(&drive->gendev); +} +EXPORT_SYMBOL_GPL(ide_device_put); + static int ide_bus_match(struct device *dev, struct device_driver *drv) { return 1; diff --git a/drivers/scsi/ide-scsi.c b/drivers/scsi/ide-scsi.c index 538552495d48..318ef382448f 100644 --- a/drivers/scsi/ide-scsi.c +++ b/drivers/scsi/ide-scsi.c @@ -101,8 +101,13 @@ static struct ide_scsi_obj *ide_scsi_get(struct gendisk *disk) mutex_lock(&idescsi_ref_mutex); scsi = ide_scsi_g(disk); - if (scsi) + if (scsi) { scsi_host_get(scsi->host); + if (ide_device_get(scsi->drive)) { + scsi_host_put(scsi->host); + scsi = NULL; + } + } mutex_unlock(&idescsi_ref_mutex); return scsi; } @@ -110,6 +115,7 @@ static struct ide_scsi_obj *ide_scsi_get(struct gendisk *disk) static void ide_scsi_put(struct ide_scsi_obj *scsi) { mutex_lock(&idescsi_ref_mutex); + ide_device_put(scsi->drive); scsi_host_put(scsi->host); mutex_unlock(&idescsi_ref_mutex); } diff --git a/include/linux/ide.h b/include/linux/ide.h index 776c574c9640..3eccac0a2a36 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h @@ -532,12 +532,16 @@ struct ide_dma_ops { void (*dma_timeout)(struct ide_drive_s *); }; +struct ide_host; + typedef struct hwif_s { struct hwif_s *next; /* for linked-list in ide_hwgroup_t */ struct hwif_s *mate; /* other hwif from same PCI chip */ struct hwgroup_s *hwgroup; /* actually (ide_hwgroup_t *) */ struct proc_dir_entry *proc; /* /proc/ide/ directory entry */ + struct ide_host *host; + char name[6]; /* name of interface, eg. "ide0" */ struct ide_io_ports io_ports; @@ -876,6 +880,9 @@ struct ide_driver_s { #define to_ide_driver(drv) container_of(drv, ide_driver_t, gen_driver) +int ide_device_get(ide_drive_t *); +void ide_device_put(ide_drive_t *); + int generic_ide_ioctl(ide_drive_t *, struct file *, struct block_device *, unsigned, unsigned long); extern int ide_vlb_clk; -- cgit v1.2.3 From ef0b04276d8f719d754c092434fbd62c2aeb5307 Mon Sep 17 00:00:00 2001 From: Bartlomiej Zolnierkiewicz Date: Thu, 24 Jul 2008 22:53:19 +0200 Subject: ide: add ide_pci_remove() helper * Add 'unsigned long host_flags' field to struct ide_host. * Set ->host_flags in ide_host_alloc_all(). * Always set PCI dev's ->driver_data in ide_pci_init_{one,two}(). * Add ide_pci_remove() helper (the default implementation for struct pci_driver's ->remove method). Signed-off-by: Bartlomiej Zolnierkiewicz --- drivers/ide/ide-probe.c | 3 +++ drivers/ide/setup-pci.c | 39 +++++++++++++++++++++++++++++++++------ include/linux/ide.h | 2 ++ 3 files changed, 38 insertions(+), 6 deletions(-) (limited to 'include') diff --git a/drivers/ide/ide-probe.c b/drivers/ide/ide-probe.c index 9ab5892eaea1..f0c162488ec4 100644 --- a/drivers/ide/ide-probe.c +++ b/drivers/ide/ide-probe.c @@ -1609,6 +1609,9 @@ struct ide_host *ide_host_alloc_all(const struct ide_port_info *d, if (hws[0]) host->dev[0] = hws[0]->dev; + if (d) + host->host_flags = d->host_flags; + return host; } EXPORT_SYMBOL_GPL(ide_host_alloc_all); diff --git a/drivers/ide/setup-pci.c b/drivers/ide/setup-pci.c index ca17bf8896df..20f0ee004695 100644 --- a/drivers/ide/setup-pci.c +++ b/drivers/ide/setup-pci.c @@ -548,8 +548,7 @@ int ide_pci_init_one(struct pci_dev *dev, const struct ide_port_info *d, host->host_priv = priv; - if (priv) - pci_set_drvdata(dev, host); + pci_set_drvdata(dev, host); ret = do_ide_setup_pci_device(dev, d, 1); if (ret < 0) @@ -593,10 +592,8 @@ int ide_pci_init_two(struct pci_dev *dev1, struct pci_dev *dev2, host->host_priv = priv; - if (priv) { - pci_set_drvdata(pdev[0], host); - pci_set_drvdata(pdev[1], host); - } + pci_set_drvdata(pdev[0], host); + pci_set_drvdata(pdev[1], host); for (i = 0; i < 2; i++) { ret = do_ide_setup_pci_device(pdev[i], d, !i); @@ -619,3 +616,33 @@ out: return ret; } EXPORT_SYMBOL_GPL(ide_pci_init_two); + +void ide_pci_remove(struct pci_dev *dev) +{ + struct ide_host *host = pci_get_drvdata(dev); + struct pci_dev *dev2 = host->dev[1] ? to_pci_dev(host->dev[1]) : NULL; + int bars; + + if (host->host_flags & IDE_HFLAG_SINGLE) + bars = (1 << 2) - 1; + else + bars = (1 << 4) - 1; + + if ((host->host_flags & IDE_HFLAG_NO_DMA) == 0) { + if (host->host_flags & IDE_HFLAG_CS5520) + bars |= (1 << 2); + else + bars |= (1 << 4); + } + + ide_host_remove(host); + + if (dev2) + pci_release_selected_regions(dev2, bars); + pci_release_selected_regions(dev, bars); + + if (dev2) + pci_disable_device(dev2); + pci_disable_device(dev); +} +EXPORT_SYMBOL_GPL(ide_pci_remove); diff --git a/include/linux/ide.h b/include/linux/ide.h index 3eccac0a2a36..dbd0aeb3a56d 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h @@ -631,6 +631,7 @@ struct ide_host { ide_hwif_t *ports[MAX_HWIFS]; unsigned int n_ports; struct device *dev[2]; + unsigned long host_flags; void *host_priv; }; @@ -1213,6 +1214,7 @@ struct ide_port_info { int ide_pci_init_one(struct pci_dev *, const struct ide_port_info *, void *); int ide_pci_init_two(struct pci_dev *, struct pci_dev *, const struct ide_port_info *, void *); +void ide_pci_remove(struct pci_dev *); void ide_map_sg(ide_drive_t *, struct request *); void ide_init_sg_cmd(ide_drive_t *, struct request *); -- cgit v1.2.3 From b0a62817961796f6dcef5f316134d8bc7279bf6e Mon Sep 17 00:00:00 2001 From: Bartlomiej Zolnierkiewicz Date: Thu, 24 Jul 2008 22:53:27 +0200 Subject: ide: fix * Add missing include. While at it: * Remove needless ide_default_{irq,io_base}() inlines. Cc: Chris Zankel Signed-off-by: Bartlomiej Zolnierkiewicz --- include/asm-xtensa/ide.h | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) (limited to 'include') diff --git a/include/asm-xtensa/ide.h b/include/asm-xtensa/ide.h index 6b912742a42d..cb995701c42d 100644 --- a/include/asm-xtensa/ide.h +++ b/include/asm-xtensa/ide.h @@ -19,17 +19,8 @@ # define MAX_HWIFS 1 #endif -static __inline__ int ide_default_irq(unsigned long base) -{ - /* Unsupported! */ - return 0; -} - -static __inline__ unsigned long ide_default_io_base(int index) -{ - /* Unsupported! */ - return 0; -} +#include #endif /* __KERNEL__ */ + #endif /* _XTENSA_IDE_H */ -- cgit v1.2.3 From ac32f3238c1d95a6ebea2c312160dbdbd61bf91c Mon Sep 17 00:00:00 2001 From: Bartlomiej Zolnierkiewicz Date: Thu, 24 Jul 2008 22:53:27 +0200 Subject: ide-generic: fix ide_default_io_base() for m32r Fix ide_default_io_base() to match ide_default_irq(). Cc: Hirokazu Takata Signed-off-by: Bartlomiej Zolnierkiewicz --- include/asm-m32r/ide.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'include') diff --git a/include/asm-m32r/ide.h b/include/asm-m32r/ide.h index 1e7f6474d130..72798d624221 100644 --- a/include/asm-m32r/ide.h +++ b/include/asm-m32r/ide.h @@ -52,12 +52,20 @@ static __inline__ int ide_default_irq(unsigned long base) static __inline__ unsigned long ide_default_io_base(int index) { switch (index) { +#if defined(CONFIG_PLAT_M32700UT) || defined(CONFIG_PLAT_MAPPI2) \ + || defined(CONFIG_PLAT_OPSPUT) + case 0: return 0x1f0; +#elif defined(CONFIG_PLAT_MAPPI3) + case 0: return 0x1f0; + case 1: return 0x170; +#else case 0: return 0x1f0; case 1: return 0x170; case 2: return 0x1e8; case 3: return 0x168; case 4: return 0x1e0; case 5: return 0x160; +#endif default: return 0; } -- cgit v1.2.3 From dbdec839c4c2bfc8f2da8e50c06b9947e5ad0394 Mon Sep 17 00:00:00 2001 From: Bartlomiej Zolnierkiewicz Date: Thu, 24 Jul 2008 22:53:28 +0200 Subject: ide-generic: minor fix for mips Move ide_probe_legacy() call to ide_generic_init() so it fails early if necessary and returns the proper error value (nowadays ide_default_io_base() is used only by ide-generic). Cc: Ralf Baechle Signed-off-by: Bartlomiej Zolnierkiewicz --- drivers/ide/ide-generic.c | 4 ++++ include/asm-mips/mach-generic/ide.h | 2 -- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/drivers/ide/ide-generic.c b/drivers/ide/ide-generic.c index 31d98fec775f..567fd843c7ff 100644 --- a/drivers/ide/ide-generic.c +++ b/drivers/ide/ide-generic.c @@ -87,6 +87,10 @@ static int __init ide_generic_init(void) unsigned long io_addr; int i, rc; +#ifdef CONFIG_MIPS + if (!ide_probe_legacy()) + return -ENODEV; +#endif printk(KERN_INFO DRV_NAME ": please use \"probe_mask=0x3f\" module " "parameter for probing all legacy ISA IDE ports\n"); diff --git a/include/asm-mips/mach-generic/ide.h b/include/asm-mips/mach-generic/ide.h index 0f6c251f5fec..71a01c5aec16 100644 --- a/include/asm-mips/mach-generic/ide.h +++ b/include/asm-mips/mach-generic/ide.h @@ -72,8 +72,6 @@ static __inline__ int ide_default_irq(unsigned long base) static __inline__ unsigned long ide_default_io_base(int index) { - if (!ide_probe_legacy()) - return 0; /* * If PCI is present then it is not safe to poke around * the other legacy IDE ports. Only 0x1f0 and 0x170 are -- cgit v1.2.3 From b6cd7da5be2522b62bbc48d41b36c828b88e02fe Mon Sep 17 00:00:00 2001 From: Bartlomiej Zolnierkiewicz Date: Thu, 24 Jul 2008 22:53:28 +0200 Subject: ide-generic: remove "no_pci_devices()" quirk from ide_default_io_base() Since the decision to probe for ISA ide2-6 is now left to the user "no_pci_devices()" quirk is no longer needed and may be removed. Signed-off-by: Bartlomiej Zolnierkiewicz --- include/asm-mips/mach-generic/ide.h | 18 ++++-------------- include/asm-x86/ide.h | 18 ++++-------------- 2 files changed, 8 insertions(+), 28 deletions(-) (limited to 'include') diff --git a/include/asm-mips/mach-generic/ide.h b/include/asm-mips/mach-generic/ide.h index 71a01c5aec16..f34740ee6775 100644 --- a/include/asm-mips/mach-generic/ide.h +++ b/include/asm-mips/mach-generic/ide.h @@ -72,23 +72,13 @@ static __inline__ int ide_default_irq(unsigned long base) static __inline__ unsigned long ide_default_io_base(int index) { - /* - * If PCI is present then it is not safe to poke around - * the other legacy IDE ports. Only 0x1f0 and 0x170 are - * defined compatibility mode ports for PCI. A user can - * override this using ide= but we must default safe. - */ - if (no_pci_devices()) { - switch (index) { - case 2: return 0x1e8; - case 3: return 0x168; - case 4: return 0x1e0; - case 5: return 0x160; - } - } switch (index) { case 0: return 0x1f0; case 1: return 0x170; + case 2: return 0x1e8; + case 3: return 0x168; + case 4: return 0x1e0; + case 5: return 0x160; default: return 0; } diff --git a/include/asm-x86/ide.h b/include/asm-x86/ide.h index cf9c98e5bdb5..34050747f38c 100644 --- a/include/asm-x86/ide.h +++ b/include/asm-x86/ide.h @@ -36,23 +36,13 @@ static __inline__ int ide_default_irq(unsigned long base) static __inline__ unsigned long ide_default_io_base(int index) { - /* - * If PCI is present then it is not safe to poke around - * the other legacy IDE ports. Only 0x1f0 and 0x170 are - * defined compatibility mode ports for PCI. A user can - * override this using ide= but we must default safe. - */ - if (no_pci_devices()) { - switch(index) { - case 2: return 0x1e8; - case 3: return 0x168; - case 4: return 0x1e0; - case 5: return 0x160; - } - } switch (index) { case 0: return 0x1f0; case 1: return 0x170; + case 2: return 0x1e8; + case 3: return 0x168; + case 4: return 0x1e0; + case 5: return 0x160; default: return 0; } -- cgit v1.2.3 From 2c9d86438a0104800da2a8ecdc1e27baf38ba6a4 Mon Sep 17 00:00:00 2001 From: Bartlomiej Zolnierkiewicz Date: Thu, 24 Jul 2008 22:53:29 +0200 Subject: ide: remove Remove and . This has been a broken code for some time now and needs rewrite to match IDE core code / host driver model anyway. Cc: Jesper Nilsson Cc: Mikael Starvik Signed-off-by: Bartlomiej Zolnierkiewicz --- include/asm-cris/arch-v10/ide.h | 91 ----------------------------------------- include/asm-cris/arch-v32/ide.h | 56 ------------------------- include/asm-cris/ide.h | 1 - 3 files changed, 148 deletions(-) delete mode 100644 include/asm-cris/arch-v10/ide.h delete mode 100644 include/asm-cris/arch-v32/ide.h delete mode 100644 include/asm-cris/ide.h (limited to 'include') diff --git a/include/asm-cris/arch-v10/ide.h b/include/asm-cris/arch-v10/ide.h deleted file mode 100644 index 5366e6239328..000000000000 --- a/include/asm-cris/arch-v10/ide.h +++ /dev/null @@ -1,91 +0,0 @@ -/* - * linux/include/asm-cris/ide.h - * - * Copyright (C) 2000, 2001, 2002 Axis Communications AB - * - * Authors: Bjorn Wesen - * - */ - -/* - * This file contains the ETRAX 100LX specific IDE code. - */ - -#ifndef __ASMCRIS_IDE_H -#define __ASMCRIS_IDE_H - -#ifdef __KERNEL__ - -#include -#include -#include - - -/* ETRAX 100 can support 4 IDE busses on the same pins (serialized) */ - -#define MAX_HWIFS 4 - -static inline int ide_default_irq(unsigned long base) -{ - /* all IDE busses share the same IRQ, number 4. - * this has the side-effect that ide-probe.c will cluster our 4 interfaces - * together in a hwgroup, and will serialize accesses. this is good, because - * we can't access more than one interface at the same time on ETRAX100. - */ - return 4; -} - -static inline unsigned long ide_default_io_base(int index) -{ - /* we have no real I/O base address per interface, since all go through the - * same register. but in a bitfield in that register, we have the i/f number. - * so we can use the io_base to remember that bitfield. - */ - static const unsigned long io_bases[MAX_HWIFS] = { - IO_FIELD(R_ATA_CTRL_DATA, sel, 0), - IO_FIELD(R_ATA_CTRL_DATA, sel, 1), - IO_FIELD(R_ATA_CTRL_DATA, sel, 2), - IO_FIELD(R_ATA_CTRL_DATA, sel, 3) - }; - return io_bases[index]; -} - -/* this is called once for each interface, to setup the port addresses. data_port is the result - * of the ide_default_io_base call above. ctrl_port will be 0, but that is don't care for us. - */ - -static inline void ide_init_hwif_ports(hw_regs_t *hw, unsigned long data_port, unsigned long ctrl_port, int *irq) -{ - int i; - - /* fill in ports for ATA addresses 0 to 7 */ - for (i = 0; i <= 7; i++) { - hw->io_ports_array[i] = data_port | - IO_FIELD(R_ATA_CTRL_DATA, addr, i) | - IO_STATE(R_ATA_CTRL_DATA, cs0, active); - } - - /* the IDE control register is at ATA address 6, with CS1 active instead of CS0 */ - hw->io_ports.ctl_addr = data_port | - IO_FIELD(R_ATA_CTRL_DATA, addr, 6) | - IO_STATE(R_ATA_CTRL_DATA, cs1, active); - - /* whats this for ? */ - hw->io_ports.irq_addr = 0; -} - -static inline void ide_init_default_hwifs(void) -{ - hw_regs_t hw; - int index; - - for(index = 0; index < MAX_HWIFS; index++) { - ide_init_hwif_ports(&hw, ide_default_io_base(index), 0, NULL); - hw.irq = ide_default_irq(ide_default_io_base(index)); - ide_register_hw(&hw, NULL); - } -} - -#endif /* __KERNEL__ */ - -#endif /* __ASMCRIS_IDE_H */ diff --git a/include/asm-cris/arch-v32/ide.h b/include/asm-cris/arch-v32/ide.h deleted file mode 100644 index fb9c3627a5b4..000000000000 --- a/include/asm-cris/arch-v32/ide.h +++ /dev/null @@ -1,56 +0,0 @@ -/* - * linux/include/asm-cris/ide.h - * - * Copyright (C) 2000-2004 Axis Communications AB - * - * Authors: Bjorn Wesen, Mikael Starvik - * - */ - -/* - * This file contains the ETRAX FS specific IDE code. - */ - -#ifndef __ASMCRIS_IDE_H -#define __ASMCRIS_IDE_H - -#ifdef __KERNEL__ - -#include -#include -#include -#include - - -/* ETRAX FS can support 4 IDE busses on the same pins (serialized) */ - -#define MAX_HWIFS 4 - -static inline int ide_default_irq(unsigned long base) -{ - /* all IDE busses share the same IRQ, - * this has the side-effect that ide-probe.c will cluster our 4 interfaces - * together in a hwgroup, and will serialize accesses. this is good, because - * we can't access more than one interface at the same time on ETRAX100. - */ - return ATA_INTR_VECT; -} - -static inline unsigned long ide_default_io_base(int index) -{ - reg_ata_rw_ctrl2 ctrl2 = {.sel = index}; - /* we have no real I/O base address per interface, since all go through the - * same register. but in a bitfield in that register, we have the i/f number. - * so we can use the io_base to remember that bitfield. - */ - ctrl2.sel = index; - - return REG_TYPE_CONV(unsigned long, reg_ata_rw_ctrl2, ctrl2); -} - -#define IDE_ARCH_ACK_INTR -#define ide_ack_intr(hwif) ((hwif)->ack_intr(hwif)) - -#endif /* __KERNEL__ */ - -#endif /* __ASMCRIS_IDE_H */ diff --git a/include/asm-cris/ide.h b/include/asm-cris/ide.h deleted file mode 100644 index a894f66665f8..000000000000 --- a/include/asm-cris/ide.h +++ /dev/null @@ -1 +0,0 @@ -#include -- cgit v1.2.3 From d83b8b85cd56a083d30df73f3fd5e4714591b910 Mon Sep 17 00:00:00 2001 From: Bartlomiej Zolnierkiewicz Date: Thu, 24 Jul 2008 22:53:30 +0200 Subject: ide: define MAX_HWIFS in * Now that ide_hwif_t instances are allocated dynamically the difference between MAX_HWIFS == 2 and MAX_HWIFS == 10 is ~100 bytes (x86-32) so use MAX_HWIFS == 10 on all archs except these ones that use MAX_HWIFS == 1. * Define MAX_HWIFS in instead of . [ Please note that avr32/cris/v850 have no and alpha/ia64/sh always define CONFIG_IDE_MAX_HWIFS. ] Signed-off-by: Bartlomiej Zolnierkiewicz --- include/asm-arm/ide.h | 4 ---- include/asm-blackfin/ide.h | 2 -- include/asm-frv/ide.h | 4 ---- include/asm-h8300/ide.h | 2 -- include/asm-m32r/ide.h | 8 -------- include/asm-m68k/ide.h | 4 ---- include/asm-mips/mach-generic/ide.h | 8 -------- include/asm-mn10300/ide.h | 4 ---- include/asm-parisc/ide.h | 4 ---- include/asm-powerpc/ide.h | 8 -------- include/asm-sparc/ide.h | 3 --- include/asm-x86/ide.h | 9 --------- include/asm-xtensa/ide.h | 5 ----- include/linux/ide.h | 8 ++++++++ 14 files changed, 8 insertions(+), 65 deletions(-) (limited to 'include') diff --git a/include/asm-arm/ide.h b/include/asm-arm/ide.h index 88f4d231ce4f..a48019f99d08 100644 --- a/include/asm-arm/ide.h +++ b/include/asm-arm/ide.h @@ -13,10 +13,6 @@ #ifdef __KERNEL__ -#ifndef MAX_HWIFS -#define MAX_HWIFS 4 -#endif - #define __ide_mm_insw(port,addr,len) readsw(port,addr,len) #define __ide_mm_insl(port,addr,len) readsl(port,addr,len) #define __ide_mm_outsw(port,addr,len) writesw(port,addr,len) diff --git a/include/asm-blackfin/ide.h b/include/asm-blackfin/ide.h index 5b88de115bf4..90bc50bd22e9 100644 --- a/include/asm-blackfin/ide.h +++ b/include/asm-blackfin/ide.h @@ -17,8 +17,6 @@ #ifdef __KERNEL__ /****************************************************************************/ -#define MAX_HWIFS 1 - #include /****************************************************************************/ diff --git a/include/asm-frv/ide.h b/include/asm-frv/ide.h index 8c9a540d4344..7ebcc56a2229 100644 --- a/include/asm-frv/ide.h +++ b/include/asm-frv/ide.h @@ -18,10 +18,6 @@ #include #include -#ifndef MAX_HWIFS -#define MAX_HWIFS 8 -#endif - /****************************************************************************/ /* * some bits needed for parts of the IDE subsystem to compile diff --git a/include/asm-h8300/ide.h b/include/asm-h8300/ide.h index f8535ce7476e..8f79ba2ff929 100644 --- a/include/asm-h8300/ide.h +++ b/include/asm-h8300/ide.h @@ -16,8 +16,6 @@ #ifdef __KERNEL__ /****************************************************************************/ -#define MAX_HWIFS 1 - #include /****************************************************************************/ diff --git a/include/asm-m32r/ide.h b/include/asm-m32r/ide.h index 72798d624221..d755d41b9931 100644 --- a/include/asm-m32r/ide.h +++ b/include/asm-m32r/ide.h @@ -15,14 +15,6 @@ #include -#ifndef MAX_HWIFS -# ifdef CONFIG_BLK_DEV_IDEPCI -#define MAX_HWIFS 10 -# else -#define MAX_HWIFS 2 -# endif -#endif - static __inline__ int ide_default_irq(unsigned long base) { switch (base) { diff --git a/include/asm-m68k/ide.h b/include/asm-m68k/ide.h index 909c6dfd3851..1daf6cbdd9f0 100644 --- a/include/asm-m68k/ide.h +++ b/include/asm-m68k/ide.h @@ -45,10 +45,6 @@ #include #endif -#ifndef MAX_HWIFS -#define MAX_HWIFS 4 /* same as the other archs */ -#endif - /* * Get rid of defs from io.h - ide has its private and conflicting versions * Since so far no single m68k platform uses ISA/PCI I/O space for IDE, we diff --git a/include/asm-mips/mach-generic/ide.h b/include/asm-mips/mach-generic/ide.h index f34740ee6775..8ee6bff030d9 100644 --- a/include/asm-mips/mach-generic/ide.h +++ b/include/asm-mips/mach-generic/ide.h @@ -19,14 +19,6 @@ #include #include -#ifndef MAX_HWIFS -# ifdef CONFIG_BLK_DEV_IDEPCI -#define MAX_HWIFS 10 -# else -#define MAX_HWIFS 6 -# endif -#endif - static __inline__ int ide_probe_legacy(void) { #ifdef CONFIG_PCI diff --git a/include/asm-mn10300/ide.h b/include/asm-mn10300/ide.h index dc235121ec42..6adcdd92e83d 100644 --- a/include/asm-mn10300/ide.h +++ b/include/asm-mn10300/ide.h @@ -23,10 +23,6 @@ #undef SUPPORT_VLB_SYNC #define SUPPORT_VLB_SYNC 0 -#ifndef MAX_HWIFS -#define MAX_HWIFS 8 -#endif - /* * some bits needed for parts of the IDE subsystem to compile */ diff --git a/include/asm-parisc/ide.h b/include/asm-parisc/ide.h index db0c94410095..c246ef75017d 100644 --- a/include/asm-parisc/ide.h +++ b/include/asm-parisc/ide.h @@ -13,10 +13,6 @@ #ifdef __KERNEL__ -#ifndef MAX_HWIFS -#define MAX_HWIFS 2 -#endif - #define ide_request_irq(irq,hand,flg,dev,id) request_irq((irq),(hand),(flg),(dev),(id)) #define ide_free_irq(irq,dev_id) free_irq((irq), (dev_id)) #define ide_request_region(from,extent,name) request_region((from), (extent), (name)) diff --git a/include/asm-powerpc/ide.h b/include/asm-powerpc/ide.h index 3d90bf7d3d73..262def6a9f0a 100644 --- a/include/asm-powerpc/ide.h +++ b/include/asm-powerpc/ide.h @@ -14,14 +14,6 @@ #endif #include -#ifndef MAX_HWIFS -#ifdef __powerpc64__ -#define MAX_HWIFS 10 -#else -#define MAX_HWIFS 8 -#endif -#endif - #define __ide_mm_insw(p, a, c) readsw((void __iomem *)(p), (a), (c)) #define __ide_mm_insl(p, a, c) readsl((void __iomem *)(p), (a), (c)) #define __ide_mm_outsw(p, a, c) writesw((void __iomem *)(p), (a), (c)) diff --git a/include/asm-sparc/ide.h b/include/asm-sparc/ide.h index 879fcec72dc1..b7af3d658239 100644 --- a/include/asm-sparc/ide.h +++ b/include/asm-sparc/ide.h @@ -21,9 +21,6 @@ #include #endif -#undef MAX_HWIFS -#define MAX_HWIFS 2 - #define __ide_insl(data_reg, buffer, wcount) \ __ide_insw(data_reg, buffer, (wcount)<<1) #define __ide_outsl(data_reg, buffer, wcount) \ diff --git a/include/asm-x86/ide.h b/include/asm-x86/ide.h index 34050747f38c..bc54879daed1 100644 --- a/include/asm-x86/ide.h +++ b/include/asm-x86/ide.h @@ -11,15 +11,6 @@ #ifdef __KERNEL__ - -#ifndef MAX_HWIFS -# ifdef CONFIG_BLK_DEV_IDEPCI -#define MAX_HWIFS 10 -# else -#define MAX_HWIFS 6 -# endif -#endif - static __inline__ int ide_default_irq(unsigned long base) { switch (base) { diff --git a/include/asm-xtensa/ide.h b/include/asm-xtensa/ide.h index cb995701c42d..18342a2cc774 100644 --- a/include/asm-xtensa/ide.h +++ b/include/asm-xtensa/ide.h @@ -14,11 +14,6 @@ #ifdef __KERNEL__ - -#ifndef MAX_HWIFS -# define MAX_HWIFS 1 -#endif - #include #endif /* __KERNEL__ */ diff --git a/include/linux/ide.h b/include/linux/ide.h index dbd0aeb3a56d..76fe00b24b51 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h @@ -213,6 +213,14 @@ static inline int __ide_default_irq(unsigned long base) #include +#ifndef MAX_HWIFS +#if defined(CONFIG_BLACKFIN) || defined(CONFIG_H8300) || defined(CONFIG_XTENSA) +# define MAX_HWIFS 1 +#else +# define MAX_HWIFS 10 +#endif +#endif + #if !defined(MAX_HWIFS) || defined(CONFIG_EMBEDDED) #undef MAX_HWIFS #define MAX_HWIFS CONFIG_IDE_MAX_HWIFS -- cgit v1.2.3 From ffed0b6e1a6f5132681d4b521531d992f893190b Mon Sep 17 00:00:00 2001 From: Bartlomiej Zolnierkiewicz Date: Thu, 24 Jul 2008 22:53:30 +0200 Subject: ide-generic: remove broken PPC_PREP support PPC_PREP has been depending on BROKEN for some time now. Cc: Benjamin Herrenschmidt Signed-off-by: Bartlomiej Zolnierkiewicz --- include/asm-powerpc/ide.h | 18 ------------------ 1 file changed, 18 deletions(-) (limited to 'include') diff --git a/include/asm-powerpc/ide.h b/include/asm-powerpc/ide.h index 262def6a9f0a..1aaf27be8741 100644 --- a/include/asm-powerpc/ide.h +++ b/include/asm-powerpc/ide.h @@ -31,16 +31,6 @@ static __inline__ int ide_default_irq(unsigned long base) case 0x1f0: return 14; case 0x170: return 15; } -#endif -#ifdef CONFIG_PPC_PREP - switch (base) { - case 0x1f0: return 13; - case 0x170: return 13; - case 0x1e8: return 11; - case 0x168: return 10; - case 0xfff0: return 14; /* MCP(N)750 ide0 */ - case 0xffe0: return 15; /* MCP(N)750 ide1 */ - } #endif return 0; } @@ -53,14 +43,6 @@ static __inline__ unsigned long ide_default_io_base(int index) case 0: return 0x1f0; case 1: return 0x170; } -#endif -#ifdef CONFIG_PPC_PREP - switch (index) { - case 0: return 0x1f0; - case 1: return 0x170; - case 2: return 0x1e8; - case 3: return 0x168; - } #endif return 0; } -- cgit v1.2.3 From f01d35d87f39ab794ddcdefadb79c11054bcbfbc Mon Sep 17 00:00:00 2001 From: Bartlomiej Zolnierkiewicz Date: Thu, 24 Jul 2008 22:53:31 +0200 Subject: ide-generic: remove ide_default_{io_base,irq}() inlines (take 3) Replace ide_default_{io_base,irq}() inlines by legacy_{bases,irqs}[]. v2: Add missing zero-ing of hws[] (caught during testing by Borislav Petkov). v3: Fix zero-oing of hws[] for _real_ this time. There should be no functional changes caused by this patch. Signed-off-by: Bartlomiej Zolnierkiewicz --- drivers/ide/ide-generic.c | 32 +++++++++++++++++++++--- include/asm-alpha/ide.h | 24 ------------------ include/asm-ia64/ide.h | 29 --------------------- include/asm-m32r/ide.h | 50 ------------------------------------- include/asm-mips/mach-generic/ide.h | 28 --------------------- include/asm-x86/ide.h | 28 --------------------- 6 files changed, 29 insertions(+), 162 deletions(-) (limited to 'include') diff --git a/drivers/ide/ide-generic.c b/drivers/ide/ide-generic.c index 567fd843c7ff..8fe8b5b9cf7d 100644 --- a/drivers/ide/ide-generic.c +++ b/drivers/ide/ide-generic.c @@ -20,6 +20,11 @@ #include #include +/* FIXME: convert m32r to use ide_platform host driver */ +#ifdef CONFIG_M32R +#include +#endif + #define DRV_NAME "ide_generic" static int probe_mask = 0x03; @@ -80,6 +85,21 @@ static int __init ide_generic_sysfs_init(void) return 0; } +#if defined(CONFIG_PLAT_M32700UT) || defined(CONFIG_PLAT_MAPPI2) \ + || defined(CONFIG_PLAT_OPSPUT) +static const u16 legacy_bases[] = { 0x1f0 }; +static const int legacy_irqs[] = { PLD_IRQ_CFIREQ }; +#elif defined(CONFIG_PLAT_MAPPI3) +static const u16 legacy_bases[] = { 0x1f0, 0x170 }; +static const int legacy_irqs[] = { PLD_IRQ_CFIREQ, PLD_IRQ_IDEIREQ }; +#elif defined(CONFIG_ALPHA) +static const u16 legacy_bases[] = { 0x1f0, 0x170, 0x1e8, 0x168 }; +static const int legacy_irqs[] = { 14, 15, 11, 10 }; +#else +static const u16 legacy_bases[] = { 0x1f0, 0x170, 0x1e8, 0x168, 0x1e0, 0x160 }; +static const int legacy_irqs[] = { 14, 15, 11, 10, 8, 12 }; +#endif + static int __init ide_generic_init(void) { hw_regs_t hw[MAX_HWIFS], *hws[MAX_HWIFS]; @@ -94,8 +114,10 @@ static int __init ide_generic_init(void) printk(KERN_INFO DRV_NAME ": please use \"probe_mask=0x3f\" module " "parameter for probing all legacy ISA IDE ports\n"); - for (i = 0; i < MAX_HWIFS; i++) { - io_addr = ide_default_io_base(i); + memset(hws, 0, sizeof(hw_regs_t *) * MAX_HWIFS); + + for (i = 0; i < ARRAY_SIZE(legacy_bases); i++) { + io_addr = legacy_bases[i]; hws[i] = NULL; @@ -117,7 +139,11 @@ static int __init ide_generic_init(void) memset(&hw[i], 0, sizeof(hw[i])); ide_std_init_ports(&hw[i], io_addr, io_addr + 0x206); - hw[i].irq = ide_default_irq(io_addr); +#ifdef CONFIG_IA64 + hw[i].irq = isa_irq_to_vector(legacy_irqs[i]); +#else + hw[i].irq = legacy_irqs[i]; +#endif hw[i].chipset = ide_generic; hws[i] = &hw[i]; diff --git a/include/asm-alpha/ide.h b/include/asm-alpha/ide.h index f44129abc02c..55f9f6870249 100644 --- a/include/asm-alpha/ide.h +++ b/include/asm-alpha/ide.h @@ -13,30 +13,6 @@ #ifdef __KERNEL__ -static inline int ide_default_irq(unsigned long base) -{ - switch (base) { - case 0x1f0: return 14; - case 0x170: return 15; - case 0x1e8: return 11; - case 0x168: return 10; - default: - return 0; - } -} - -static inline unsigned long ide_default_io_base(int index) -{ - switch (index) { - case 0: return 0x1f0; - case 1: return 0x170; - case 2: return 0x1e8; - case 3: return 0x168; - default: - return 0; - } -} - #include #endif /* __KERNEL__ */ diff --git a/include/asm-ia64/ide.h b/include/asm-ia64/ide.h index 8fa3f8cd067a..5a0aedea4764 100644 --- a/include/asm-ia64/ide.h +++ b/include/asm-ia64/ide.h @@ -13,37 +13,8 @@ #ifdef __KERNEL__ - #include -static inline int ide_default_irq(unsigned long base) -{ - switch (base) { - case 0x1f0: return isa_irq_to_vector(14); - case 0x170: return isa_irq_to_vector(15); - case 0x1e8: return isa_irq_to_vector(11); - case 0x168: return isa_irq_to_vector(10); - case 0x1e0: return isa_irq_to_vector(8); - case 0x160: return isa_irq_to_vector(12); - default: - return 0; - } -} - -static inline unsigned long ide_default_io_base(int index) -{ - switch (index) { - case 0: return 0x1f0; - case 1: return 0x170; - case 2: return 0x1e8; - case 3: return 0x168; - case 4: return 0x1e0; - case 5: return 0x160; - default: - return 0; - } -} - #include #endif /* __KERNEL__ */ diff --git a/include/asm-m32r/ide.h b/include/asm-m32r/ide.h index d755d41b9931..0f1ec6973879 100644 --- a/include/asm-m32r/ide.h +++ b/include/asm-m32r/ide.h @@ -13,56 +13,6 @@ #ifdef __KERNEL__ -#include - -static __inline__ int ide_default_irq(unsigned long base) -{ - switch (base) { -#if defined(CONFIG_PLAT_M32700UT) || defined(CONFIG_PLAT_MAPPI2) \ - || defined(CONFIG_PLAT_OPSPUT) - case 0x1f0: return PLD_IRQ_CFIREQ; - default: - return 0; -#elif defined(CONFIG_PLAT_MAPPI3) - case 0x1f0: return PLD_IRQ_CFIREQ; - case 0x170: return PLD_IRQ_IDEIREQ; - default: - return 0; -#else - case 0x1f0: return 14; - case 0x170: return 15; - case 0x1e8: return 11; - case 0x168: return 10; - case 0x1e0: return 8; - case 0x160: return 12; - default: - return 0; -#endif - } -} - -static __inline__ unsigned long ide_default_io_base(int index) -{ - switch (index) { -#if defined(CONFIG_PLAT_M32700UT) || defined(CONFIG_PLAT_MAPPI2) \ - || defined(CONFIG_PLAT_OPSPUT) - case 0: return 0x1f0; -#elif defined(CONFIG_PLAT_MAPPI3) - case 0: return 0x1f0; - case 1: return 0x170; -#else - case 0: return 0x1f0; - case 1: return 0x170; - case 2: return 0x1e8; - case 3: return 0x168; - case 4: return 0x1e0; - case 5: return 0x160; -#endif - default: - return 0; - } -} - #include #endif /* __KERNEL__ */ diff --git a/include/asm-mips/mach-generic/ide.h b/include/asm-mips/mach-generic/ide.h index 8ee6bff030d9..73008f7bdc93 100644 --- a/include/asm-mips/mach-generic/ide.h +++ b/include/asm-mips/mach-generic/ide.h @@ -48,34 +48,6 @@ found: #endif } -static __inline__ int ide_default_irq(unsigned long base) -{ - switch (base) { - case 0x1f0: return 14; - case 0x170: return 15; - case 0x1e8: return 11; - case 0x168: return 10; - case 0x1e0: return 8; - case 0x160: return 12; - default: - return 0; - } -} - -static __inline__ unsigned long ide_default_io_base(int index) -{ - switch (index) { - case 0: return 0x1f0; - case 1: return 0x170; - case 2: return 0x1e8; - case 3: return 0x168; - case 4: return 0x1e0; - case 5: return 0x160; - default: - return 0; - } -} - /* MIPS port and memory-mapped I/O string operations. */ static inline void __ide_flush_prologue(void) { diff --git a/include/asm-x86/ide.h b/include/asm-x86/ide.h index bc54879daed1..0289baf9ce0a 100644 --- a/include/asm-x86/ide.h +++ b/include/asm-x86/ide.h @@ -11,34 +11,6 @@ #ifdef __KERNEL__ -static __inline__ int ide_default_irq(unsigned long base) -{ - switch (base) { - case 0x1f0: return 14; - case 0x170: return 15; - case 0x1e8: return 11; - case 0x168: return 10; - case 0x1e0: return 8; - case 0x160: return 12; - default: - return 0; - } -} - -static __inline__ unsigned long ide_default_io_base(int index) -{ - switch (index) { - case 0: return 0x1f0; - case 1: return 0x170; - case 2: return 0x1e8; - case 3: return 0x168; - case 4: return 0x1e0; - case 5: return 0x160; - default: - return 0; - } -} - #include #endif /* __KERNEL__ */ -- cgit v1.2.3 From 2a8f7450f828eaee49d66f41f99ac2e54f1160a6 Mon Sep 17 00:00:00 2001 From: Bartlomiej Zolnierkiewicz Date: Thu, 24 Jul 2008 22:53:31 +0200 Subject: ide: remove for some archs * Remove include from ( includes which is enough). * Remove for alpha/blackfin/h8300/ia64/m32r/sh/x86/xtensa (this leaves us with arm/frv/m68k/mips/mn10300/parisc/powerpc/sparc[64]). There should be no functional changes caused by this patch. Signed-off-by: Bartlomiej Zolnierkiewicz --- include/asm-alpha/ide.h | 20 -------------------- include/asm-blackfin/ide.h | 25 ------------------------- include/asm-h8300/ide.h | 24 ------------------------ include/asm-ia64/ide.h | 22 ---------------------- include/asm-m32r/ide.h | 20 -------------------- include/asm-sh/ide.h | 21 --------------------- include/asm-x86/ide.h | 18 ------------------ include/asm-xtensa/ide.h | 21 --------------------- include/linux/ide.h | 6 ++++++ 9 files changed, 6 insertions(+), 171 deletions(-) delete mode 100644 include/asm-alpha/ide.h delete mode 100644 include/asm-blackfin/ide.h delete mode 100644 include/asm-h8300/ide.h delete mode 100644 include/asm-ia64/ide.h delete mode 100644 include/asm-m32r/ide.h delete mode 100644 include/asm-sh/ide.h delete mode 100644 include/asm-x86/ide.h delete mode 100644 include/asm-xtensa/ide.h (limited to 'include') diff --git a/include/asm-alpha/ide.h b/include/asm-alpha/ide.h deleted file mode 100644 index 55f9f6870249..000000000000 --- a/include/asm-alpha/ide.h +++ /dev/null @@ -1,20 +0,0 @@ -/* - * linux/include/asm-alpha/ide.h - * - * Copyright (C) 1994-1996 Linus Torvalds & authors - */ - -/* - * This file contains the alpha architecture specific IDE code. - */ - -#ifndef __ASMalpha_IDE_H -#define __ASMalpha_IDE_H - -#ifdef __KERNEL__ - -#include - -#endif /* __KERNEL__ */ - -#endif /* __ASMalpha_IDE_H */ diff --git a/include/asm-blackfin/ide.h b/include/asm-blackfin/ide.h deleted file mode 100644 index 90bc50bd22e9..000000000000 --- a/include/asm-blackfin/ide.h +++ /dev/null @@ -1,25 +0,0 @@ -/****************************************************************************/ - -/* - * linux/include/asm-blackfin/ide.h - * - * Copyright (C) 1994-1996 Linus Torvalds & authors - * Copyright (C) 2001 Lineo Inc., davidm@snapgear.com - * Copyright (C) 2002 Greg Ungerer (gerg@snapgear.com) - * Copyright (C) 2002 Yoshinori Sato (ysato@users.sourceforge.jp) - * Copyright (C) 2005 Hennerich Michael (hennerich@blackfin.uclinux.org) - */ - -/****************************************************************************/ -#ifndef _BLACKFIN_IDE_H -#define _BLACKFIN_IDE_H -/****************************************************************************/ -#ifdef __KERNEL__ -/****************************************************************************/ - -#include - -/****************************************************************************/ -#endif /* __KERNEL__ */ -#endif /* _BLACKFIN_IDE_H */ -/****************************************************************************/ diff --git a/include/asm-h8300/ide.h b/include/asm-h8300/ide.h deleted file mode 100644 index 8f79ba2ff929..000000000000 --- a/include/asm-h8300/ide.h +++ /dev/null @@ -1,24 +0,0 @@ -/****************************************************************************/ - -/* - * linux/include/asm-h8300/ide.h - * - * Copyright (C) 1994-1996 Linus Torvalds & authors - * Copyright (C) 2001 Lineo Inc., davidm@snapgear.com - * Copyright (C) 2002 Greg Ungerer (gerg@snapgear.com) - * Copyright (C) 2002 Yoshinori Sato (ysato@users.sourceforge.jp) - */ - -/****************************************************************************/ -#ifndef _H8300_IDE_H -#define _H8300_IDE_H -/****************************************************************************/ -#ifdef __KERNEL__ -/****************************************************************************/ - -#include - -/****************************************************************************/ -#endif /* __KERNEL__ */ -#endif /* _H8300_IDE_H */ -/****************************************************************************/ diff --git a/include/asm-ia64/ide.h b/include/asm-ia64/ide.h deleted file mode 100644 index 5a0aedea4764..000000000000 --- a/include/asm-ia64/ide.h +++ /dev/null @@ -1,22 +0,0 @@ -/* - * linux/include/asm-ia64/ide.h - * - * Copyright (C) 1994-1996 Linus Torvalds & authors - */ - -/* - * This file contains the ia64 architecture specific IDE code. - */ - -#ifndef __ASM_IA64_IDE_H -#define __ASM_IA64_IDE_H - -#ifdef __KERNEL__ - -#include - -#include - -#endif /* __KERNEL__ */ - -#endif /* __ASM_IA64_IDE_H */ diff --git a/include/asm-m32r/ide.h b/include/asm-m32r/ide.h deleted file mode 100644 index 0f1ec6973879..000000000000 --- a/include/asm-m32r/ide.h +++ /dev/null @@ -1,20 +0,0 @@ -#ifndef _ASM_M32R_IDE_H -#define _ASM_M32R_IDE_H - -/* - * linux/include/asm-m32r/ide.h - * - * Copyright (C) 1994-1996 Linus Torvalds & authors - */ - -/* - * This file contains the i386 architecture specific IDE code. - */ - -#ifdef __KERNEL__ - -#include - -#endif /* __KERNEL__ */ - -#endif /* _ASM_M32R_IDE_H */ diff --git a/include/asm-sh/ide.h b/include/asm-sh/ide.h deleted file mode 100644 index 58e0bdd52be4..000000000000 --- a/include/asm-sh/ide.h +++ /dev/null @@ -1,21 +0,0 @@ -/* - * linux/include/asm-sh/ide.h - * - * Copyright (C) 1994-1996 Linus Torvalds & authors - */ - -/* - * This file contains the i386 architecture specific IDE code. - * In future, SuperH code. - */ - -#ifndef __ASM_SH_IDE_H -#define __ASM_SH_IDE_H - -#ifdef __KERNEL__ - -#include - -#endif /* __KERNEL__ */ - -#endif /* __ASM_SH_IDE_H */ diff --git a/include/asm-x86/ide.h b/include/asm-x86/ide.h deleted file mode 100644 index 0289baf9ce0a..000000000000 --- a/include/asm-x86/ide.h +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (C) 1994-1996 Linus Torvalds & authors - */ - -/* - * This file contains the i386 architecture specific IDE code. - */ - -#ifndef __ASMi386_IDE_H -#define __ASMi386_IDE_H - -#ifdef __KERNEL__ - -#include - -#endif /* __KERNEL__ */ - -#endif /* __ASMi386_IDE_H */ diff --git a/include/asm-xtensa/ide.h b/include/asm-xtensa/ide.h deleted file mode 100644 index 18342a2cc774..000000000000 --- a/include/asm-xtensa/ide.h +++ /dev/null @@ -1,21 +0,0 @@ -/* - * include/asm-xtensa/ide.h - * - * This file is subject to the terms and conditions of the GNU General Public - * License. See the file "COPYING" in the main directory of this archive - * for more details. - * - * Copyright (C) 1994 - 1996 Linus Torvalds & authors - * Copyright (C) 2001 - 2005 Tensilica Inc. - */ - -#ifndef _XTENSA_IDE_H -#define _XTENSA_IDE_H - -#ifdef __KERNEL__ - -#include - -#endif /* __KERNEL__ */ - -#endif /* _XTENSA_IDE_H */ diff --git a/include/linux/ide.h b/include/linux/ide.h index 76fe00b24b51..fd78b401b036 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h @@ -211,7 +211,13 @@ static inline int __ide_default_irq(unsigned long base) return 0; } +#if defined(CONFIG_ARM) || defined(CONFIG_FRV) || defined(CONFIG_M68K) || \ + defined(CONFIG_MIPS) || defined(CONFIG_MN10300) || defined(CONFIG_PARISC) \ + || defined(CONFIG_PPC) || defined(CONFIG_SPARC) || defined(CONFIG_SPARC64) #include +#else +#include +#endif #ifndef MAX_HWIFS #if defined(CONFIG_BLACKFIN) || defined(CONFIG_H8300) || defined(CONFIG_XTENSA) -- cgit v1.2.3 From a326b02b0c576001353dbc489154959b0889c6bf Mon Sep 17 00:00:00 2001 From: Bartlomiej Zolnierkiewicz Date: Thu, 24 Jul 2008 22:53:33 +0200 Subject: ide: drop 'name' parameter from ->init_chipset method There should be no functional changes caused by this patch. Signed-off-by: Bartlomiej Zolnierkiewicz --- drivers/ide/pci/aec62xx.c | 2 +- drivers/ide/pci/alim15x3.c | 5 ++--- drivers/ide/pci/amd74xx.c | 19 ++++++++----------- drivers/ide/pci/cmd64x.c | 2 +- drivers/ide/pci/cs5530.c | 7 +++---- drivers/ide/pci/cy82c693.c | 10 +++++----- drivers/ide/pci/hpt34x.c | 2 +- drivers/ide/pci/hpt366.c | 3 ++- drivers/ide/pci/it821x.c | 2 +- drivers/ide/pci/pdc202xx_new.c | 3 ++- drivers/ide/pci/pdc202xx_old.c | 3 +-- drivers/ide/pci/piix.c | 3 +-- drivers/ide/pci/serverworks.c | 6 +++--- drivers/ide/pci/siimage.c | 8 +++----- drivers/ide/pci/sis5513.c | 3 +-- drivers/ide/pci/sl82c105.c | 2 +- drivers/ide/pci/via82cxxx.c | 3 +-- drivers/ide/setup-pci.c | 2 +- include/linux/ide.h | 2 +- 19 files changed, 39 insertions(+), 48 deletions(-) (limited to 'include') diff --git a/drivers/ide/pci/aec62xx.c b/drivers/ide/pci/aec62xx.c index f6dc6c20f3af..e0c8fe7d9fea 100644 --- a/drivers/ide/pci/aec62xx.c +++ b/drivers/ide/pci/aec62xx.c @@ -140,7 +140,7 @@ static void aec_set_pio_mode(ide_drive_t *drive, const u8 pio) drive->hwif->port_ops->set_dma_mode(drive, pio + XFER_PIO_0); } -static unsigned int __devinit init_chipset_aec62xx(struct pci_dev *dev, const char *name) +static unsigned int __devinit init_chipset_aec62xx(struct pci_dev *dev) { /* These are necessary to get AEC6280 Macintosh cards to work */ if ((dev->device == PCI_DEVICE_ID_ARTOP_ATP865) || diff --git a/drivers/ide/pci/alim15x3.c b/drivers/ide/pci/alim15x3.c index a099c4dd599d..b582687e0cd4 100644 --- a/drivers/ide/pci/alim15x3.c +++ b/drivers/ide/pci/alim15x3.c @@ -209,13 +209,12 @@ static int ali15x3_dma_setup(ide_drive_t *drive) /** * init_chipset_ali15x3 - Initialise an ALi IDE controller * @dev: PCI device - * @name: Name of the controller * * This function initializes the ALI IDE controller and where * appropriate also sets up the 1533 southbridge. */ - -static unsigned int __devinit init_chipset_ali15x3 (struct pci_dev *dev, const char *name) + +static unsigned int __devinit init_chipset_ali15x3(struct pci_dev *dev) { unsigned long flags; u8 tmpbyte; diff --git a/drivers/ide/pci/amd74xx.c b/drivers/ide/pci/amd74xx.c index cbf78edfe00b..2cea7bf51a0f 100644 --- a/drivers/ide/pci/amd74xx.c +++ b/drivers/ide/pci/amd74xx.c @@ -112,15 +112,13 @@ static void amd_set_pio_mode(ide_drive_t *drive, const u8 pio) amd_set_drive(drive, XFER_PIO_0 + pio); } -static void __devinit amd7409_cable_detect(struct pci_dev *dev, - const char *name) +static void __devinit amd7409_cable_detect(struct pci_dev *dev) { /* no host side cable detection */ amd_80w = 0x03; } -static void __devinit amd7411_cable_detect(struct pci_dev *dev, - const char *name) +static void __devinit amd7411_cable_detect(struct pci_dev *dev) { int i; u32 u = 0; @@ -131,9 +129,9 @@ static void __devinit amd7411_cable_detect(struct pci_dev *dev, amd_80w = ((t & 0x3) ? 1 : 0) | ((t & 0xc) ? 2 : 0); for (i = 24; i >= 0; i -= 8) if (((u >> i) & 4) && !(amd_80w & (1 << (1 - (i >> 4))))) { - printk(KERN_WARNING "%s %s: BIOS didn't set cable bits " - "correctly. Enabling workaround.\n", - name, pci_name(dev)); + printk(KERN_WARNING DRV_NAME " %s: BIOS didn't set " + "cable bits correctly. Enabling workaround.\n", + pci_name(dev)); amd_80w |= (1 << (1 - (i >> 4))); } } @@ -142,8 +140,7 @@ static void __devinit amd7411_cable_detect(struct pci_dev *dev, * The initialization callback. Initialize drive independent registers. */ -static unsigned int __devinit init_chipset_amd74xx(struct pci_dev *dev, - const char *name) +static unsigned int __devinit init_chipset_amd74xx(struct pci_dev *dev) { u8 t = 0, offset = amd_offset(dev); @@ -156,9 +153,9 @@ static unsigned int __devinit init_chipset_amd74xx(struct pci_dev *dev, ; /* no UDMA > 2 */ else if (dev->vendor == PCI_VENDOR_ID_AMD && dev->device == PCI_DEVICE_ID_AMD_VIPER_7409) - amd7409_cable_detect(dev, name); + amd7409_cable_detect(dev); else - amd7411_cable_detect(dev, name); + amd7411_cable_detect(dev); /* * Take care of prefetch & postwrite. diff --git a/drivers/ide/pci/cmd64x.c b/drivers/ide/pci/cmd64x.c index 3d84debaf81f..1360b4fa9fd3 100644 --- a/drivers/ide/pci/cmd64x.c +++ b/drivers/ide/pci/cmd64x.c @@ -332,7 +332,7 @@ static int cmd646_1_dma_end(ide_drive_t *drive) return (dma_stat & 7) != 4; } -static unsigned int __devinit init_chipset_cmd64x(struct pci_dev *dev, const char *name) +static unsigned int __devinit init_chipset_cmd64x(struct pci_dev *dev) { u8 mrdmode = 0; diff --git a/drivers/ide/pci/cs5530.c b/drivers/ide/pci/cs5530.c index 5543c8677a5a..f235db8c678b 100644 --- a/drivers/ide/pci/cs5530.c +++ b/drivers/ide/pci/cs5530.c @@ -129,12 +129,11 @@ static void cs5530_set_dma_mode(ide_drive_t *drive, const u8 mode) /** * init_chipset_5530 - set up 5530 bridge * @dev: PCI device - * @name: device name * * Initialize the cs5530 bridge for reliable IDE DMA operation. */ -static unsigned int __devinit init_chipset_cs5530 (struct pci_dev *dev, const char *name) +static unsigned int __devinit init_chipset_cs5530(struct pci_dev *dev) { struct pci_dev *master_0 = NULL, *cs5530_0 = NULL; @@ -153,11 +152,11 @@ static unsigned int __devinit init_chipset_cs5530 (struct pci_dev *dev, const ch } } if (!master_0) { - printk(KERN_ERR "%s: unable to locate PCI MASTER function\n", name); + printk(KERN_ERR DRV_NAME ": unable to locate PCI MASTER function\n"); goto out; } if (!cs5530_0) { - printk(KERN_ERR "%s: unable to locate CS5530 LEGACY function\n", name); + printk(KERN_ERR DRV_NAME ": unable to locate CS5530 LEGACY function\n"); goto out; } diff --git a/drivers/ide/pci/cy82c693.c b/drivers/ide/pci/cy82c693.c index 41c7f3351eb6..bfae2f882f48 100644 --- a/drivers/ide/pci/cy82c693.c +++ b/drivers/ide/pci/cy82c693.c @@ -332,7 +332,7 @@ static void cy82c693_set_pio_mode(ide_drive_t *drive, const u8 pio) /* * this function is called during init and is used to setup the cy82c693 chip */ -static unsigned int __devinit init_chipset_cy82c693(struct pci_dev *dev, const char *name) +static unsigned int __devinit init_chipset_cy82c693(struct pci_dev *dev) { if (PCI_FUNC(dev->devfn) != 1) return 0; @@ -351,8 +351,8 @@ static unsigned int __devinit init_chipset_cy82c693(struct pci_dev *dev, const c data = inb(CY82_DATA_PORT); #if CY82C693_DEBUG_INFO - printk(KERN_INFO "%s: Peripheral Configuration Register: 0x%X\n", - name, data); + printk(KERN_INFO DRV_NAME ": Peripheral Configuration Register: 0x%X\n", + data); #endif /* CY82C693_DEBUG_INFO */ /* @@ -373,8 +373,8 @@ static unsigned int __devinit init_chipset_cy82c693(struct pci_dev *dev, const c outb(data, CY82_DATA_PORT); #if CY82C693_DEBUG_INFO - printk(KERN_INFO "%s: New Peripheral Configuration Register: 0x%X\n", - name, data); + printk(KERN_INFO ": New Peripheral Configuration Register: 0x%X\n", + data); #endif /* CY82C693_DEBUG_INFO */ #endif /* CY82C693_SETDMA_CLOCK */ diff --git a/drivers/ide/pci/hpt34x.c b/drivers/ide/pci/hpt34x.c index baabb4ce0d78..6009b0b9655d 100644 --- a/drivers/ide/pci/hpt34x.c +++ b/drivers/ide/pci/hpt34x.c @@ -79,7 +79,7 @@ static void hpt34x_set_pio_mode(ide_drive_t *drive, const u8 pio) */ #define HPT34X_PCI_INIT_REG 0x80 -static unsigned int __devinit init_chipset_hpt34x(struct pci_dev *dev, const char *name) +static unsigned int __devinit init_chipset_hpt34x(struct pci_dev *dev) { int i = 0; unsigned long hpt34xIoBase = pci_resource_start(dev, 4); diff --git a/drivers/ide/pci/hpt366.c b/drivers/ide/pci/hpt366.c index 6a1c65c3be3e..5271b246b88c 100644 --- a/drivers/ide/pci/hpt366.c +++ b/drivers/ide/pci/hpt366.c @@ -970,11 +970,12 @@ static int __devinit hpt37x_calibrate_dpll(struct pci_dev *dev, u16 f_low, u16 f return 1; } -static unsigned int __devinit init_chipset_hpt366(struct pci_dev *dev, const char *name) +static unsigned int __devinit init_chipset_hpt366(struct pci_dev *dev) { unsigned long io_base = pci_resource_start(dev, 4); struct ide_host *host = pci_get_drvdata(dev); struct hpt_info *info = host->host_priv + (&dev->dev == host->dev[1]); + const char *name = DRV_NAME; u8 pci_clk, dpll_clk = 0; /* PCI and DPLL clock in MHz */ u8 chip_type; enum ata_clock clock; diff --git a/drivers/ide/pci/it821x.c b/drivers/ide/pci/it821x.c index 74173352741f..e16a1d113a2a 100644 --- a/drivers/ide/pci/it821x.c +++ b/drivers/ide/pci/it821x.c @@ -605,7 +605,7 @@ static void __devinit it8212_disable_raid(struct pci_dev *dev) pci_write_config_byte(dev, PCI_LATENCY_TIMER, 0x20); } -static unsigned int __devinit init_chipset_it821x(struct pci_dev *dev, const char *name) +static unsigned int __devinit init_chipset_it821x(struct pci_dev *dev) { u8 conf; static char *mode[2] = { "pass through", "smart" }; diff --git a/drivers/ide/pci/pdc202xx_new.c b/drivers/ide/pci/pdc202xx_new.c index 1f6791957227..998615fa285f 100644 --- a/drivers/ide/pci/pdc202xx_new.c +++ b/drivers/ide/pci/pdc202xx_new.c @@ -326,8 +326,9 @@ static void __devinit apple_kiwi_init(struct pci_dev *pdev) } #endif /* CONFIG_PPC_PMAC */ -static unsigned int __devinit init_chipset_pdcnew(struct pci_dev *dev, const char *name) +static unsigned int __devinit init_chipset_pdcnew(struct pci_dev *dev) { + const char *name = DRV_NAME; unsigned long dma_base = pci_resource_start(dev, 4); unsigned long sec_dma_base = dma_base + 0x08; long pll_input, pll_output, ratio; diff --git a/drivers/ide/pci/pdc202xx_old.c b/drivers/ide/pci/pdc202xx_old.c index da92d127868f..6ff2def58da0 100644 --- a/drivers/ide/pci/pdc202xx_old.c +++ b/drivers/ide/pci/pdc202xx_old.c @@ -265,8 +265,7 @@ static void pdc202xx_dma_timeout(ide_drive_t *drive) ide_dma_timeout(drive); } -static unsigned int __devinit init_chipset_pdc202xx(struct pci_dev *dev, - const char *name) +static unsigned int __devinit init_chipset_pdc202xx(struct pci_dev *dev) { unsigned long dmabase = pci_resource_start(dev, 4); u8 udma_speed_flag = 0, primary_mode = 0, secondary_mode = 0; diff --git a/drivers/ide/pci/piix.c b/drivers/ide/pci/piix.c index 9eb411f5c358..7fc3022dcf68 100644 --- a/drivers/ide/pci/piix.c +++ b/drivers/ide/pci/piix.c @@ -200,13 +200,12 @@ static void piix_set_dma_mode(ide_drive_t *drive, const u8 speed) /** * init_chipset_ich - set up the ICH chipset * @dev: PCI device to set up - * @name: Name of the device * * Initialize the PCI device as required. For the ICH this turns * out to be nice and simple. */ -static unsigned int __devinit init_chipset_ich(struct pci_dev *dev, const char *name) +static unsigned int __devinit init_chipset_ich(struct pci_dev *dev) { u32 extra = 0; diff --git a/drivers/ide/pci/serverworks.c b/drivers/ide/pci/serverworks.c index e26bc8326dbb..d173f2937722 100644 --- a/drivers/ide/pci/serverworks.c +++ b/drivers/ide/pci/serverworks.c @@ -174,7 +174,7 @@ static void svwks_set_dma_mode(ide_drive_t *drive, const u8 speed) pci_write_config_byte(dev, 0x54, ultra_enable); } -static unsigned int __devinit init_chipset_svwks (struct pci_dev *dev, const char *name) +static unsigned int __devinit init_chipset_svwks(struct pci_dev *dev) { unsigned int reg; u8 btr; @@ -190,8 +190,8 @@ static unsigned int __devinit init_chipset_svwks (struct pci_dev *dev, const cha pci_read_config_dword(isa_dev, 0x64, ®); reg &= ~0x00002000; /* disable 600ns interrupt mask */ if(!(reg & 0x00004000)) - printk(KERN_DEBUG "%s %s: UDMA not BIOS " - "enabled.\n", name, pci_name(dev)); + printk(KERN_DEBUG DRV_NAME " %s: UDMA not BIOS " + "enabled.\n", pci_name(dev)); reg |= 0x00004000; /* enable UDMA/33 support */ pci_write_config_dword(isa_dev, 0x64, reg); } diff --git a/drivers/ide/pci/siimage.c b/drivers/ide/pci/siimage.c index 572b479a3922..b8ad9ad6cf0d 100644 --- a/drivers/ide/pci/siimage.c +++ b/drivers/ide/pci/siimage.c @@ -457,14 +457,12 @@ static void sil_sata_pre_reset(ide_drive_t *drive) /** * init_chipset_siimage - set up an SI device * @dev: PCI device - * @name: device name * * Perform the initial PCI set up for this device. Attempt to switch * to 133 MHz clocking if the system isn't already set up to do it. */ -static unsigned int __devinit init_chipset_siimage(struct pci_dev *dev, - const char *name) +static unsigned int __devinit init_chipset_siimage(struct pci_dev *dev) { struct ide_host *host = pci_get_drvdata(dev); void __iomem *ioaddr = host->host_priv; @@ -541,8 +539,8 @@ static unsigned int __devinit init_chipset_siimage(struct pci_dev *dev, { "== 100", "== 133", "== 2X PCI", "DISABLED!" }; tmp >>= 4; - printk(KERN_INFO "%s %s: BASE CLOCK %s\n", - name, pci_name(dev), clk_str[tmp & 3]); + printk(KERN_INFO DRV_NAME " %s: BASE CLOCK %s\n", + pci_name(dev), clk_str[tmp & 3]); } return 0; diff --git a/drivers/ide/pci/sis5513.c b/drivers/ide/pci/sis5513.c index 6fcb46c87871..cc95f90b53b7 100644 --- a/drivers/ide/pci/sis5513.c +++ b/drivers/ide/pci/sis5513.c @@ -448,8 +448,7 @@ static int __devinit sis_find_family(struct pci_dev *dev) return chipset_family; } -static unsigned int __devinit init_chipset_sis5513(struct pci_dev *dev, - const char *name) +static unsigned int __devinit init_chipset_sis5513(struct pci_dev *dev) { /* Make general config ops here 1/ tell IDE channels to operate in Compatibility mode only diff --git a/drivers/ide/pci/sl82c105.c b/drivers/ide/pci/sl82c105.c index fa720db3de10..73905bcc08fb 100644 --- a/drivers/ide/pci/sl82c105.c +++ b/drivers/ide/pci/sl82c105.c @@ -272,7 +272,7 @@ static u8 sl82c105_bridge_revision(struct pci_dev *dev) * channel 0 here at least, but channel 1 has to be enabled by * firmware or arch code. We still set both to 16 bits mode. */ -static unsigned int __devinit init_chipset_sl82c105(struct pci_dev *dev, const char *msg) +static unsigned int __devinit init_chipset_sl82c105(struct pci_dev *dev) { u32 val; diff --git a/drivers/ide/pci/via82cxxx.c b/drivers/ide/pci/via82cxxx.c index 170e058f1fbd..454d2bf62dce 100644 --- a/drivers/ide/pci/via82cxxx.c +++ b/drivers/ide/pci/via82cxxx.c @@ -262,13 +262,12 @@ static void __devinit via_cable_detect(struct via82cxxx_dev *vdev, u32 u) /** * init_chipset_via82cxxx - initialization handler * @dev: PCI device - * @name: Name of interface * * The initialization callback. Here we determine the IDE chip type * and initialize its drive independent registers. */ -static unsigned int __devinit init_chipset_via82cxxx(struct pci_dev *dev, const char *name) +static unsigned int __devinit init_chipset_via82cxxx(struct pci_dev *dev) { struct ide_host *host = pci_get_drvdata(dev); struct via82cxxx_dev *vdev = host->host_priv; diff --git a/drivers/ide/setup-pci.c b/drivers/ide/setup-pci.c index d9655aeb013b..a8e9e8a69a52 100644 --- a/drivers/ide/setup-pci.c +++ b/drivers/ide/setup-pci.c @@ -515,7 +515,7 @@ static int do_ide_setup_pci_device(struct pci_dev *dev, * space, place chipset into init-mode, and/or preserve * an interrupt if the card is not native ide support. */ - ret = d->init_chipset ? d->init_chipset(dev, d->name) : 0; + ret = d->init_chipset ? d->init_chipset(dev) : 0; if (ret < 0) goto out; diff --git a/include/linux/ide.h b/include/linux/ide.h index fd78b401b036..b846bc44a27e 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h @@ -1206,7 +1206,7 @@ enum { struct ide_port_info { char *name; - unsigned int (*init_chipset)(struct pci_dev *, const char *); + unsigned int (*init_chipset)(struct pci_dev *); void (*init_iops)(ide_hwif_t *); void (*init_hwif)(ide_hwif_t *); int (*init_dma)(ide_hwif_t *, -- cgit v1.2.3