* [PATCH 02/14] ide: ->port_init_devs -> ->init_dev
2008-06-10 20:50 [PATCH 01/14] cmd640: fix warm-plug support for the secondary interface Bartlomiej Zolnierkiewicz
@ 2008-06-10 20:51 ` Bartlomiej Zolnierkiewicz
2008-06-10 20:51 ` [PATCH 03/14] cmd640: add ->init_dev method Bartlomiej Zolnierkiewicz
` (11 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2008-06-10 20:51 UTC (permalink / raw)
To: linux-ide; +Cc: Bartlomiej Zolnierkiewicz, linux-kernel
Change ->port_init_devs method to take 'ide_drive_t *' as an argument
instead of 'ide_hwif_t *' and rename it to ->init_dev.
There should be no functional changes caused by this patch.
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
---
drivers/ide/ide-probe.c | 6 +++---
drivers/ide/legacy/ht6560b.c | 8 ++++----
drivers/ide/legacy/ide-4drives.c | 10 ++++------
drivers/ide/legacy/qd65xx.c | 16 ++++++++--------
drivers/ide/pci/opti621.c | 7 +++----
include/linux/ide.h | 4 ++--
6 files changed, 24 insertions(+), 27 deletions(-)
Index: b/drivers/ide/ide-probe.c
===================================================================
--- a/drivers/ide/ide-probe.c
+++ b/drivers/ide/ide-probe.c
@@ -1326,10 +1326,10 @@ static void ide_port_init_devices(ide_hw
drive->unmask = 1;
if (hwif->host_flags & IDE_HFLAG_NO_UNMASK_IRQS)
drive->no_unmask = 1;
- }
- if (port_ops && port_ops->port_init_devs)
- port_ops->port_init_devs(hwif);
+ if (port_ops && port_ops->init_dev)
+ port_ops->init_dev(drive);
+ }
}
static void ide_init_port(ide_hwif_t *hwif, unsigned int port,
Index: b/drivers/ide/legacy/ht6560b.c
===================================================================
--- a/drivers/ide/legacy/ht6560b.c
+++ b/drivers/ide/legacy/ht6560b.c
@@ -310,16 +310,16 @@ static void ht6560b_set_pio_mode(ide_dri
#endif
}
-static void __init ht6560b_port_init_devs(ide_hwif_t *hwif)
+static void __init ht6560b_init_dev(ide_drive_t *drive)
{
+ ide_hwif_t *hwif = drive->hwif;
/* Setting default configurations for drives. */
int t = (HT_CONFIG_DEFAULT << 8) | HT_TIMING_DEFAULT;
if (hwif->channel)
t |= (HT_SECONDARY_IF << 8);
- hwif->drives[0].drive_data = t;
- hwif->drives[1].drive_data = t;
+ drive->drive_data = t;
}
static int probe_ht6560b;
@@ -328,7 +328,7 @@ module_param_named(probe, probe_ht6560b,
MODULE_PARM_DESC(probe, "probe for HT6560B chipset");
static const struct ide_port_ops ht6560b_port_ops = {
- .port_init_devs = ht6560b_port_init_devs,
+ .init_dev = ht6560b_init_dev,
.set_pio_mode = ht6560b_set_pio_mode,
.selectproc = ht6560b_selectproc,
};
Index: b/drivers/ide/legacy/ide-4drives.c
===================================================================
--- a/drivers/ide/legacy/ide-4drives.c
+++ b/drivers/ide/legacy/ide-4drives.c
@@ -11,16 +11,14 @@ static int probe_4drives;
module_param_named(probe, probe_4drives, bool, 0);
MODULE_PARM_DESC(probe, "probe for generic IDE chipset with 4 drives/port");
-static void ide_4drives_port_init_devs(ide_hwif_t *hwif)
+static void ide_4drives_init_dev(ide_drive_t *drive)
{
- if (hwif->channel) {
- hwif->drives[0].select.all ^= 0x20;
- hwif->drives[1].select.all ^= 0x20;
- }
+ if (drive->hwif->channel)
+ drive->select.all ^= 0x20;
}
static const struct ide_port_ops ide_4drives_port_ops = {
- .port_init_devs = ide_4drives_port_init_devs,
+ .init_dev = ide_4drives_init_dev,
};
static const struct ide_port_info ide_4drives_port_info = {
Index: b/drivers/ide/legacy/qd65xx.c
===================================================================
--- a/drivers/ide/legacy/qd65xx.c
+++ b/drivers/ide/legacy/qd65xx.c
@@ -282,17 +282,18 @@ static int __init qd_testreg(int port)
return (readreg != QD_TESTVAL);
}
-static void __init qd6500_port_init_devs(ide_hwif_t *hwif)
+static void __init qd6500_init_dev(ide_drive_t *drive)
{
+ ide_hwif_t *hwif = drive->hwif;
u8 base = (hwif->config_data & 0xff00) >> 8;
u8 config = QD_CONFIG(hwif);
- hwif->drives[0].drive_data = QD6500_DEF_DATA;
- hwif->drives[1].drive_data = QD6500_DEF_DATA;
+ drive->drive_data = QD6500_DEF_DATA;
}
-static void __init qd6580_port_init_devs(ide_hwif_t *hwif)
+static void __init qd6580_init_dev(ide_drive_t *drive)
{
+ ide_hwif_t *hwif = drive->hwif;
u16 t1, t2;
u8 base = (hwif->config_data & 0xff00) >> 8;
u8 config = QD_CONFIG(hwif);
@@ -303,18 +304,17 @@ static void __init qd6580_port_init_devs
} else
t2 = t1 = hwif->channel ? QD6580_DEF_DATA2 : QD6580_DEF_DATA;
- hwif->drives[0].drive_data = t1;
- hwif->drives[1].drive_data = t2;
+ drive->drive_data = drive->select.b.unit ? t2 : t1;
}
static const struct ide_port_ops qd6500_port_ops = {
- .port_init_devs = qd6500_port_init_devs,
+ .init_dev = qd6500_init_dev,
.set_pio_mode = qd6500_set_pio_mode,
.selectproc = qd65xx_select,
};
static const struct ide_port_ops qd6580_port_ops = {
- .port_init_devs = qd6580_port_init_devs,
+ .init_dev = qd6580_init_dev,
.set_pio_mode = qd6580_set_pio_mode,
.selectproc = qd65xx_select,
};
Index: b/drivers/ide/pci/opti621.c
===================================================================
--- a/drivers/ide/pci/opti621.c
+++ b/drivers/ide/pci/opti621.c
@@ -319,14 +319,13 @@ static void opti621_set_pio_mode(ide_dri
spin_unlock_irqrestore(&opti621_lock, flags);
}
-static void __devinit opti621_port_init_devs(ide_hwif_t *hwif)
+static void __devinit opti621_init_dev(ide_drive_t *drive)
{
- hwif->drives[0].drive_data = PIO_DONT_KNOW;
- hwif->drives[1].drive_data = PIO_DONT_KNOW;
+ drive->drive_data = PIO_DONT_KNOW;
}
static const struct ide_port_ops opti621_port_ops = {
- .port_init_devs = opti621_port_init_devs,
+ .init_dev = opti621_init_dev,
.set_pio_mode = opti621_set_pio_mode,
};
Index: b/include/linux/ide.h
===================================================================
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -390,8 +390,8 @@ typedef struct ide_drive_s {
struct ide_port_info;
struct ide_port_ops {
- /* host specific initialization of devices on a port */
- void (*port_init_devs)(struct hwif_s *);
+ /* host specific initialization of a device */
+ void (*init_dev)(ide_drive_t *);
/* routine to program host for PIO mode */
void (*set_pio_mode)(ide_drive_t *, const u8);
/* routine to program host for DMA mode */
^ permalink raw reply [flat|nested] 14+ messages in thread* [PATCH 03/14] cmd640: add ->init_dev method
2008-06-10 20:50 [PATCH 01/14] cmd640: fix warm-plug support for the secondary interface Bartlomiej Zolnierkiewicz
2008-06-10 20:51 ` [PATCH 02/14] ide: ->port_init_devs -> ->init_dev Bartlomiej Zolnierkiewicz
@ 2008-06-10 20:51 ` Bartlomiej Zolnierkiewicz
2008-06-10 20:51 ` [PATCH 04/14] rapide: use struct ide_port_info Bartlomiej Zolnierkiewicz
` (10 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2008-06-10 20:51 UTC (permalink / raw)
To: linux-ide; +Cc: Bartlomiej Zolnierkiewicz, linux-kernel
Convert the driver to use ->init_dev method instead of open-coding devices
init in cmd640x_init().
While at it:
- fix printk()-s to use KERN_INFO level instead of the default KERN_ERR
- use DRV_NAME define in printk()-s
- set proper ->pio_mask also for CONFIG_BLK_DEV_CMD640_ENHANCED=n
There should be no functional changes caused by this patch
(except fixing printk()-s levels).
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
---
drivers/ide/pci/cmd640.c | 72 +++++++++++++++++++----------------------------
1 file changed, 30 insertions(+), 42 deletions(-)
Index: b/drivers/ide/pci/cmd640.c
===================================================================
--- a/drivers/ide/pci/cmd640.c
+++ b/drivers/ide/pci/cmd640.c
@@ -611,11 +611,40 @@ static void cmd640_set_pio_mode(ide_driv
display_clocks(index);
}
+#endif /* CONFIG_BLK_DEV_CMD640_ENHANCED */
+
+static void cmd640_init_dev(ide_drive_t *drive)
+{
+ unsigned int i = drive->hwif->channel * 2 + drive->select.b.unit;
+
+#ifdef CONFIG_BLK_DEV_CMD640_ENHANCED
+ /*
+ * Reset timing to the slowest speed and turn off prefetch.
+ * This way, the drive identify code has a better chance.
+ */
+ setup_counts[i] = 4; /* max possible */
+ active_counts[i] = 16; /* max possible */
+ recovery_counts[i] = 16; /* max possible */
+ program_drive_counts(drive, i);
+ set_prefetch_mode(drive, i, 0);
+ printk(KERN_INFO DRV_NAME ": drive%d timings/prefetch cleared\n", i);
+#else
+ /*
+ * Set the drive unmask flags to match the prefetch setting.
+ */
+ check_prefetch(drive, i);
+ printk(KERN_INFO DRV_NAME ": drive%d timings/prefetch(%s) preserved\n",
+ i, drive->no_io_32bit ? "off" : "on");
+#endif /* CONFIG_BLK_DEV_CMD640_ENHANCED */
+}
+
static const struct ide_port_ops cmd640_port_ops = {
+ .init_dev = cmd640_init_dev,
+#ifdef CONFIG_BLK_DEV_CMD640_ENHANCED
.set_pio_mode = cmd640_set_pio_mode,
+#endif
};
-#endif /* CONFIG_BLK_DEV_CMD640_ENHANCED */
static int pci_conf1(void)
{
@@ -658,10 +687,8 @@ static const struct ide_port_info cmd640
IDE_HFLAG_NO_DMA |
IDE_HFLAG_ABUSE_PREFETCH |
IDE_HFLAG_ABUSE_FAST_DEVSEL,
-#ifdef CONFIG_BLK_DEV_CMD640_ENHANCED
.port_ops = &cmd640_port_ops,
.pio_mask = ATA_PIO5,
-#endif
};
static int cmd640x_init_one(unsigned long base, unsigned long ctl)
@@ -689,7 +716,6 @@ static int __init cmd640x_init(void)
{
int second_port_cmd640 = 0, rc;
const char *bus_type, *port2;
- unsigned int index;
u8 b, cfr;
u8 idx[4] = { 0xff, 0xff, 0xff, 0xff };
hw_regs_t hw[2];
@@ -813,44 +839,6 @@ static int __init cmd640x_init(void)
printk(KERN_INFO "cmd640: %sserialized, secondary interface %s\n",
second_port_cmd640 ? "" : "not ", port2);
- /*
- * Establish initial timings/prefetch for all drives.
- * Do not unnecessarily disturb any prior BIOS setup of these.
- */
- for (index = 0; index < (2 + (second_port_cmd640 << 1)); index++) {
- ide_drive_t *drive;
-
- if (index > 1) {
- if (cmd_hwif1 == NULL)
- continue;
- drive = &cmd_hwif1->drives[index & 1];
- } else {
- if (cmd_hwif0 == NULL)
- continue;
- drive = &cmd_hwif0->drives[index & 1];
- }
-
-#ifdef CONFIG_BLK_DEV_CMD640_ENHANCED
- /*
- * Reset timing to the slowest speed and turn off prefetch.
- * This way, the drive identify code has a better chance.
- */
- setup_counts [index] = 4; /* max possible */
- active_counts [index] = 16; /* max possible */
- recovery_counts [index] = 16; /* max possible */
- program_drive_counts(drive, index);
- set_prefetch_mode(drive, index, 0);
- printk("cmd640: drive%d timings/prefetch cleared\n", index);
-#else
- /*
- * Set the drive unmask flags to match the prefetch setting
- */
- check_prefetch(drive, index);
- printk("cmd640: drive%d timings/prefetch(%s) preserved\n",
- index, drive->no_io_32bit ? "off" : "on");
-#endif /* CONFIG_BLK_DEV_CMD640_ENHANCED */
- }
-
#ifdef CMD640_DUMP_REGS
cmd640_dump_regs();
#endif
^ permalink raw reply [flat|nested] 14+ messages in thread* [PATCH 04/14] rapide: use struct ide_port_info
2008-06-10 20:50 [PATCH 01/14] cmd640: fix warm-plug support for the secondary interface Bartlomiej Zolnierkiewicz
2008-06-10 20:51 ` [PATCH 02/14] ide: ->port_init_devs -> ->init_dev Bartlomiej Zolnierkiewicz
2008-06-10 20:51 ` [PATCH 03/14] cmd640: add ->init_dev method Bartlomiej Zolnierkiewicz
@ 2008-06-10 20:51 ` Bartlomiej Zolnierkiewicz
2008-06-10 20:51 ` [PATCH 05/14] ide-h8300: " Bartlomiej Zolnierkiewicz
` (9 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2008-06-10 20:51 UTC (permalink / raw)
To: linux-ide; +Cc: Bartlomiej Zolnierkiewicz, linux-kernel
Convert the driver to use struct ide_port_info.
There should be no functional changes caused by this patch.
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
---
drivers/ide/arm/rapide.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
Index: b/drivers/ide/arm/rapide.c
===================================================================
--- a/drivers/ide/arm/rapide.c
+++ b/drivers/ide/arm/rapide.c
@@ -11,6 +11,10 @@
#include <asm/ecard.h>
+static struct const ide_port_info rapide_port_info = {
+ .host_flags = IDE_HFLAG_MMIO | IDE_HFLAG_NO_DMA,
+};
+
static void rapide_setup_ports(hw_regs_t *hw, void __iomem *base,
void __iomem *ctrl, unsigned int sz, int irq)
{
@@ -53,12 +57,11 @@ rapide_probe(struct expansion_card *ec,
ide_init_port_hw(hwif, &hw);
- hwif->host_flags = IDE_HFLAG_MMIO;
default_hwif_mmiops(hwif);
idx[0] = hwif->index;
- ide_device_add(idx, NULL);
+ ide_device_add(idx, &rapide_port_info);
ecard_set_drvdata(ec, hwif);
goto out;
^ permalink raw reply [flat|nested] 14+ messages in thread* [PATCH 05/14] ide-h8300: use struct ide_port_info
2008-06-10 20:50 [PATCH 01/14] cmd640: fix warm-plug support for the secondary interface Bartlomiej Zolnierkiewicz
` (2 preceding siblings ...)
2008-06-10 20:51 ` [PATCH 04/14] rapide: use struct ide_port_info Bartlomiej Zolnierkiewicz
@ 2008-06-10 20:51 ` Bartlomiej Zolnierkiewicz
2008-06-10 20:51 ` [PATCH 06/14] ide_platform: " Bartlomiej Zolnierkiewicz
` (8 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2008-06-10 20:51 UTC (permalink / raw)
To: linux-ide; +Cc: Bartlomiej Zolnierkiewicz, linux-kernel
Convert the driver to use struct ide_port_info.
There should be no functional changes caused by this patch.
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
---
drivers/ide/h8300/ide-h8300.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
Index: b/drivers/ide/h8300/ide-h8300.c
===================================================================
--- a/drivers/ide/h8300/ide-h8300.c
+++ b/drivers/ide/h8300/ide-h8300.c
@@ -176,6 +176,10 @@ static inline void hwif_setup(ide_hwif_t
hwif->output_data = h8300_output_data;
}
+static const struct ide_port_info h8300_port_info = {
+ .host_flags = IDE_HFLAG_NO_IO_32BIT | IDE_HFLAG_NO_DMA,
+};
+
static int __init h8300_ide_init(void)
{
hw_regs_t hw;
@@ -201,12 +205,11 @@ static int __init h8300_ide_init(void)
index = hwif->index;
ide_init_port_hw(hwif, &hw);
hwif_setup(hwif);
- hwif->host_flags = IDE_HFLAG_NO_IO_32BIT;
printk(KERN_INFO "ide%d: H8/300 generic IDE interface\n", index);
idx[0] = index;
- ide_device_add(idx, NULL);
+ ide_device_add(idx, &h8300_port_info);
return 0;
^ permalink raw reply [flat|nested] 14+ messages in thread* [PATCH 06/14] ide_platform: use struct ide_port_info
2008-06-10 20:50 [PATCH 01/14] cmd640: fix warm-plug support for the secondary interface Bartlomiej Zolnierkiewicz
` (3 preceding siblings ...)
2008-06-10 20:51 ` [PATCH 05/14] ide-h8300: " Bartlomiej Zolnierkiewicz
@ 2008-06-10 20:51 ` Bartlomiej Zolnierkiewicz
2008-06-10 20:51 ` [PATCH 07/14] ide: print message on error in ide_find_port_slot() Bartlomiej Zolnierkiewicz
` (7 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2008-06-10 20:51 UTC (permalink / raw)
To: linux-ide; +Cc: Bartlomiej Zolnierkiewicz, linux-kernel
Convert the driver to use struct ide_port_info.
There should be no functional changes caused by this patch.
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
---
drivers/ide/legacy/ide_platform.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
Index: b/drivers/ide/legacy/ide_platform.c
===================================================================
--- a/drivers/ide/legacy/ide_platform.c
+++ b/drivers/ide/legacy/ide_platform.c
@@ -44,6 +44,10 @@ static void __devinit plat_ide_setup_por
hw->chipset = ide_generic;
}
+static const struct ide_port_info platform_ide_port_info = {
+ .host_flags = IDE_HFLAG_NO_DMA,
+};
+
static int __devinit plat_ide_probe(struct platform_device *pdev)
{
struct resource *res_base, *res_alt, *res_irq;
@@ -54,6 +58,7 @@ static int __devinit plat_ide_probe(stru
int ret = 0;
int mmio = 0;
hw_regs_t hw;
+ struct ide_port_info d = platform_ide_port_info;
pdata = pdev->dev.platform_data;
@@ -102,13 +107,13 @@ static int __devinit plat_ide_probe(stru
ide_init_port_hw(hwif, &hw);
if (mmio) {
- hwif->host_flags = IDE_HFLAG_MMIO;
+ d.host_flags |= IDE_HFLAG_MMIO;
default_hwif_mmiops(hwif);
}
idx[0] = hwif->index;
- ide_device_add(idx, NULL);
+ ide_device_add(idx, &d);
platform_set_drvdata(pdev, hwif);
^ permalink raw reply [flat|nested] 14+ messages in thread* [PATCH 07/14] ide: print message on error in ide_find_port_slot()
2008-06-10 20:50 [PATCH 01/14] cmd640: fix warm-plug support for the secondary interface Bartlomiej Zolnierkiewicz
` (4 preceding siblings ...)
2008-06-10 20:51 ` [PATCH 06/14] ide_platform: " Bartlomiej Zolnierkiewicz
@ 2008-06-10 20:51 ` Bartlomiej Zolnierkiewicz
2008-06-10 20:52 ` [PATCH 08/14] ide-h8300: print driver banner message early Bartlomiej Zolnierkiewicz
` (6 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2008-06-10 20:51 UTC (permalink / raw)
To: linux-ide; +Cc: Bartlomiej Zolnierkiewicz, linux-kernel
* Add DRV_NAME define to ide-h8300.c.
* Fix ide-h8300.c, swarm.c and sgiioc4.c to set .name field in
struct ide_port_info to DRV_NAME, then convert these host drivers
to use ide_find_port_slot() instead of ide_find_port().
* Print message on error in ide_find_port_slot().
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
---
drivers/ide/h8300/ide-h8300.c | 8 ++++----
drivers/ide/ide-probe.c | 3 +++
drivers/ide/mips/swarm.c | 7 +++----
drivers/ide/pci/scc_pata.c | 7 ++-----
drivers/ide/pci/sgiioc4.c | 8 +++-----
drivers/ide/setup-pci.c | 5 +----
6 files changed, 16 insertions(+), 22 deletions(-)
Index: b/drivers/ide/h8300/ide-h8300.c
===================================================================
--- a/drivers/ide/h8300/ide-h8300.c
+++ b/drivers/ide/h8300/ide-h8300.c
@@ -8,6 +8,8 @@
#include <asm/io.h>
#include <asm/irq.h>
+#define DRV_NAME "ide-h8300"
+
#define bswap(d) \
({ \
u16 r; \
@@ -196,11 +198,9 @@ static int __init h8300_ide_init(void)
hw_setup(&hw);
- hwif = ide_find_port();
- if (hwif == NULL) {
- printk(KERN_ERR "ide-h8300: IDE I/F register failed\n");
+ hwif = ide_find_port_slot(&h8300_port_info);
+ if (hwif == NULL)
return -ENOENT;
- }
index = hwif->index;
ide_init_port_hw(hwif, &hw);
Index: b/drivers/ide/ide-probe.c
===================================================================
--- a/drivers/ide/ide-probe.c
+++ b/drivers/ide/ide-probe.c
@@ -1496,6 +1496,9 @@ ide_hwif_t *ide_find_port_slot(const str
}
}
+ printk(KERN_ERR "%s: no free slot for interface\n",
+ d ? d->name : "ide");
+
return NULL;
out_found:
Index: b/drivers/ide/mips/swarm.c
===================================================================
--- a/drivers/ide/mips/swarm.c
+++ b/drivers/ide/mips/swarm.c
@@ -62,6 +62,7 @@ static struct resource swarm_ide_resourc
static struct platform_device *swarm_ide_dev;
static const struct ide_port_info swarm_port_info = {
+ .name = DRV_NAME,
.host_flags = IDE_HFLAG_MMIO | IDE_HFLAG_NO_DMA,
};
@@ -81,11 +82,9 @@ static int __devinit swarm_ide_probe(str
if (!SIBYTE_HAVE_IDE)
return -ENODEV;
- hwif = ide_find_port();
- if (hwif == NULL) {
- printk(KERN_ERR DRV_NAME ": no free slot for interface\n");
+ hwif = ide_find_port_slot(&swarm_port_info);
+ if (hwif == NULL)
return -ENOMEM;
- }
base = ioremap(A_IO_EXT_BASE, 0x800);
offset = __raw_readq(base + R_IO_EXT_REG(R_IO_EXT_START_ADDR, IDE_CS));
Index: b/drivers/ide/pci/scc_pata.c
===================================================================
--- a/drivers/ide/pci/scc_pata.c
+++ b/drivers/ide/pci/scc_pata.c
@@ -558,12 +558,9 @@ static int scc_ide_setup_pci_device(stru
u8 idx[4] = { 0xff, 0xff, 0xff, 0xff };
int i;
- hwif = ide_find_port();
- if (hwif == NULL) {
- printk(KERN_ERR "%s: too many IDE interfaces, "
- "no room in table\n", SCC_PATA_NAME);
+ hwif = ide_find_port_slot(d);
+ if (hwif == NULL)
return -ENOMEM;
- }
memset(&hw, 0, sizeof(hw));
for (i = 0; i <= 8; i++)
Index: b/drivers/ide/pci/sgiioc4.c
===================================================================
--- a/drivers/ide/pci/sgiioc4.c
+++ b/drivers/ide/pci/sgiioc4.c
@@ -568,6 +568,7 @@ static const struct ide_dma_ops sgiioc4_
};
static const struct ide_port_info sgiioc4_port_info __devinitdata = {
+ .name = DRV_NAME,
.chipset = ide_pci,
.init_dma = ide_dma_sgiioc4,
.port_ops = &sgiioc4_port_ops,
@@ -587,12 +588,9 @@ sgiioc4_ide_setup_pci_device(struct pci_
hw_regs_t hw;
struct ide_port_info d = sgiioc4_port_info;
- hwif = ide_find_port();
- if (hwif == NULL) {
- printk(KERN_ERR "%s: too many IDE interfaces, no room in table\n",
- DRV_NAME);
+ hwif = ide_find_port_slot(&d);
+ if (hwif == NULL)
return -ENOMEM;
- }
/* Get the CmdBlk and CtrlBlk Base Registers */
bar0 = pci_resource_start(dev, 0);
Index: b/drivers/ide/setup-pci.c
===================================================================
--- a/drivers/ide/setup-pci.c
+++ b/drivers/ide/setup-pci.c
@@ -332,11 +332,8 @@ static ide_hwif_t *ide_hwif_configure(st
}
hwif = ide_find_port_slot(d);
- if (hwif == NULL) {
- printk(KERN_ERR "%s: too many IDE interfaces, no room in "
- "table\n", d->name);
+ if (hwif == NULL)
return NULL;
- }
memset(&hw, 0, sizeof(hw));
hw.irq = irq;
^ permalink raw reply [flat|nested] 14+ messages in thread* [PATCH 08/14] ide-h8300: print driver banner message early
2008-06-10 20:50 [PATCH 01/14] cmd640: fix warm-plug support for the secondary interface Bartlomiej Zolnierkiewicz
` (5 preceding siblings ...)
2008-06-10 20:51 ` [PATCH 07/14] ide: print message on error in ide_find_port_slot() Bartlomiej Zolnierkiewicz
@ 2008-06-10 20:52 ` Bartlomiej Zolnierkiewicz
2008-06-10 20:52 ` [PATCH 09/14] ide-pnp: " Bartlomiej Zolnierkiewicz
` (5 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2008-06-10 20:52 UTC (permalink / raw)
To: linux-ide; +Cc: Bartlomiej Zolnierkiewicz, linux-kernel
Print driver banner message early and without interface number.
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
---
drivers/ide/h8300/ide-h8300.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
Index: b/drivers/ide/h8300/ide-h8300.c
===================================================================
--- a/drivers/ide/h8300/ide-h8300.c
+++ b/drivers/ide/h8300/ide-h8300.c
@@ -189,6 +189,8 @@ static int __init h8300_ide_init(void)
int index;
u8 idx[4] = { 0xff, 0xff, 0xff, 0xff };
+ printk(KERN_INFO DRV_NAME ": H8/300 generic IDE interface\n");
+
if (!request_region(CONFIG_H8300_IDE_BASE, H8300_IDE_GAP*8, "ide-h8300"))
goto out_busy;
if (!request_region(CONFIG_H8300_IDE_ALT, H8300_IDE_GAP, "ide-h8300")) {
@@ -205,7 +207,6 @@ static int __init h8300_ide_init(void)
index = hwif->index;
ide_init_port_hw(hwif, &hw);
hwif_setup(hwif);
- printk(KERN_INFO "ide%d: H8/300 generic IDE interface\n", index);
idx[0] = index;
^ permalink raw reply [flat|nested] 14+ messages in thread* [PATCH 09/14] ide-pnp: print driver banner message early
2008-06-10 20:50 [PATCH 01/14] cmd640: fix warm-plug support for the secondary interface Bartlomiej Zolnierkiewicz
` (6 preceding siblings ...)
2008-06-10 20:52 ` [PATCH 08/14] ide-h8300: print driver banner message early Bartlomiej Zolnierkiewicz
@ 2008-06-10 20:52 ` Bartlomiej Zolnierkiewicz
2008-06-10 20:52 ` [PATCH 10/14] ide: allow any command requesting DMA data phase for HDIO_DRIVE_TASKFILE Bartlomiej Zolnierkiewicz
` (4 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2008-06-10 20:52 UTC (permalink / raw)
To: linux-ide; +Cc: Bartlomiej Zolnierkiewicz, linux-kernel
Print driver banner message early and without interface number.
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
---
drivers/ide/ide-pnp.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
Index: b/drivers/ide/ide-pnp.c
===================================================================
--- a/drivers/ide/ide-pnp.c
+++ b/drivers/ide/ide-pnp.c
@@ -33,6 +33,8 @@ static int idepnp_probe(struct pnp_dev *
ide_hwif_t *hwif;
unsigned long base, ctl;
+ printk(KERN_INFO DRV_NAME ": generic PnP IDE interface\n");
+
if (!(pnp_port_valid(dev, 0) && pnp_port_valid(dev, 1) && pnp_irq_valid(dev, 0)))
return -1;
@@ -64,7 +66,6 @@ static int idepnp_probe(struct pnp_dev *
ide_init_port_hw(hwif, &hw);
- printk(KERN_INFO "ide%d: generic PnP IDE interface\n", index);
pnp_set_drvdata(dev, hwif);
ide_device_add(idx, NULL);
^ permalink raw reply [flat|nested] 14+ messages in thread* [PATCH 10/14] ide: allow any command requesting DMA data phase for HDIO_DRIVE_TASKFILE
2008-06-10 20:50 [PATCH 01/14] cmd640: fix warm-plug support for the secondary interface Bartlomiej Zolnierkiewicz
` (7 preceding siblings ...)
2008-06-10 20:52 ` [PATCH 09/14] ide-pnp: " Bartlomiej Zolnierkiewicz
@ 2008-06-10 20:52 ` Bartlomiej Zolnierkiewicz
2008-06-10 20:52 ` [PATCH 11/14] ide: remove superfluous BUG_ON() from set_geometry_intr() Bartlomiej Zolnierkiewicz
` (3 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2008-06-10 20:52 UTC (permalink / raw)
To: linux-ide; +Cc: Bartlomiej Zolnierkiewicz, linux-kernel
Allow any command requesting DMA data phase for HDIO_DRIVE_TASKFILE ioctl
and remove no longer needed task_dma_ok()
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
---
drivers/ide/ide-taskfile.c | 22 +---------------------
1 file changed, 1 insertion(+), 21 deletions(-)
Index: b/drivers/ide/ide-taskfile.c
===================================================================
--- a/drivers/ide/ide-taskfile.c
+++ b/drivers/ide/ide-taskfile.c
@@ -62,25 +62,6 @@ int taskfile_lib_get_identify (ide_drive
return ide_raw_taskfile(drive, &args, buf, 1);
}
-static int inline task_dma_ok(ide_task_t *task)
-{
- if (blk_fs_request(task->rq) || (task->tf_flags & IDE_TFLAG_FLAGGED))
- return 1;
-
- switch (task->tf.command) {
- case WIN_WRITEDMA_ONCE:
- case WIN_WRITEDMA:
- case WIN_WRITEDMA_EXT:
- case WIN_READDMA_ONCE:
- case WIN_READDMA:
- case WIN_READDMA_EXT:
- case WIN_IDENTIFY_DMA:
- return 1;
- }
-
- return 0;
-}
-
static ide_startstop_t task_no_data_intr(ide_drive_t *);
static ide_startstop_t set_geometry_intr(ide_drive_t *);
static ide_startstop_t recal_intr(ide_drive_t *);
@@ -139,8 +120,7 @@ ide_startstop_t do_rw_taskfile (ide_driv
WAIT_WORSTCASE, NULL);
return ide_started;
default:
- if (task_dma_ok(task) == 0 || drive->using_dma == 0 ||
- dma_ops->dma_setup(drive))
+ if (drive->using_dma == 0 || dma_ops->dma_setup(drive))
return ide_stopped;
dma_ops->dma_exec_cmd(drive, tf->command);
dma_ops->dma_start(drive);
^ permalink raw reply [flat|nested] 14+ messages in thread* [PATCH 11/14] ide: remove superfluous BUG_ON() from set_geometry_intr()
2008-06-10 20:50 [PATCH 01/14] cmd640: fix warm-plug support for the secondary interface Bartlomiej Zolnierkiewicz
` (8 preceding siblings ...)
2008-06-10 20:52 ` [PATCH 10/14] ide: allow any command requesting DMA data phase for HDIO_DRIVE_TASKFILE Bartlomiej Zolnierkiewicz
@ 2008-06-10 20:52 ` Bartlomiej Zolnierkiewicz
2008-06-10 20:52 ` [PATCH 12/14] ide: remove needless includes from ide.c Bartlomiej Zolnierkiewicz
` (2 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2008-06-10 20:52 UTC (permalink / raw)
To: linux-ide; +Cc: Bartlomiej Zolnierkiewicz, linux-kernel
ide_set_handler() bugs on ->handler == NULL so no need to do it
in set_geometry_intr().
There should be no functional changes caused by this patch.
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
---
drivers/ide/ide-taskfile.c | 1 -
1 file changed, 1 deletion(-)
Index: b/drivers/ide/ide-taskfile.c
===================================================================
--- a/drivers/ide/ide-taskfile.c
+++ b/drivers/ide/ide-taskfile.c
@@ -163,7 +163,6 @@ static ide_startstop_t set_geometry_intr
if (stat & (ERR_STAT|DRQ_STAT))
return ide_error(drive, "set_geometry_intr", stat);
- BUG_ON(HWGROUP(drive)->handler != NULL);
ide_set_handler(drive, &set_geometry_intr, WAIT_WORSTCASE, NULL);
return ide_started;
}
^ permalink raw reply [flat|nested] 14+ messages in thread* [PATCH 12/14] ide: remove needless includes from ide.c
2008-06-10 20:50 [PATCH 01/14] cmd640: fix warm-plug support for the secondary interface Bartlomiej Zolnierkiewicz
` (9 preceding siblings ...)
2008-06-10 20:52 ` [PATCH 11/14] ide: remove superfluous BUG_ON() from set_geometry_intr() Bartlomiej Zolnierkiewicz
@ 2008-06-10 20:52 ` Bartlomiej Zolnierkiewicz
2008-06-10 20:52 ` [PATCH 13/14] ide: remove needless includes from ide-taskfile.c Bartlomiej Zolnierkiewicz
2008-06-10 20:53 ` [PATCH 14/14] ide: remove needless includes from setup-pci.c Bartlomiej Zolnierkiewicz
12 siblings, 0 replies; 14+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2008-06-10 20:52 UTC (permalink / raw)
To: linux-ide; +Cc: Bartlomiej Zolnierkiewicz, linux-kernel
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
---
drivers/ide/ide.c | 13 -------------
1 file changed, 13 deletions(-)
Index: b/drivers/ide/ide.c
===================================================================
--- a/drivers/ide/ide.c
+++ b/drivers/ide/ide.c
@@ -50,29 +50,16 @@
#include <linux/types.h>
#include <linux/string.h>
#include <linux/kernel.h>
-#include <linux/timer.h>
-#include <linux/mm.h>
#include <linux/interrupt.h>
#include <linux/major.h>
#include <linux/errno.h>
#include <linux/genhd.h>
-#include <linux/blkpg.h>
#include <linux/slab.h>
#include <linux/init.h>
#include <linux/pci.h>
-#include <linux/delay.h>
#include <linux/ide.h>
#include <linux/completion.h>
-#include <linux/reboot.h>
-#include <linux/cdrom.h>
-#include <linux/seq_file.h>
#include <linux/device.h>
-#include <linux/bitops.h>
-
-#include <asm/byteorder.h>
-#include <asm/irq.h>
-#include <asm/uaccess.h>
-#include <asm/io.h>
/* default maximum number of failures */
^ permalink raw reply [flat|nested] 14+ messages in thread* [PATCH 13/14] ide: remove needless includes from ide-taskfile.c
2008-06-10 20:50 [PATCH 01/14] cmd640: fix warm-plug support for the secondary interface Bartlomiej Zolnierkiewicz
` (10 preceding siblings ...)
2008-06-10 20:52 ` [PATCH 12/14] ide: remove needless includes from ide.c Bartlomiej Zolnierkiewicz
@ 2008-06-10 20:52 ` Bartlomiej Zolnierkiewicz
2008-06-10 20:53 ` [PATCH 14/14] ide: remove needless includes from setup-pci.c Bartlomiej Zolnierkiewicz
12 siblings, 0 replies; 14+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2008-06-10 20:52 UTC (permalink / raw)
To: linux-ide; +Cc: Bartlomiej Zolnierkiewicz, linux-kernel
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
---
drivers/ide/ide-taskfile.c | 11 -----------
1 file changed, 11 deletions(-)
Index: b/drivers/ide/ide-taskfile.c
===================================================================
--- a/drivers/ide/ide-taskfile.c
+++ b/drivers/ide/ide-taskfile.c
@@ -8,28 +8,17 @@
* The big the bad and the ugly.
*/
-#include <linux/module.h>
#include <linux/types.h>
#include <linux/string.h>
#include <linux/kernel.h>
-#include <linux/timer.h>
-#include <linux/mm.h>
#include <linux/sched.h>
#include <linux/interrupt.h>
-#include <linux/major.h>
#include <linux/errno.h>
-#include <linux/genhd.h>
-#include <linux/blkpg.h>
#include <linux/slab.h>
-#include <linux/pci.h>
#include <linux/delay.h>
#include <linux/hdreg.h>
#include <linux/ide.h>
-#include <linux/bitops.h>
-#include <linux/scatterlist.h>
-#include <asm/byteorder.h>
-#include <asm/irq.h>
#include <asm/uaccess.h>
#include <asm/io.h>
^ permalink raw reply [flat|nested] 14+ messages in thread* [PATCH 14/14] ide: remove needless includes from setup-pci.c
2008-06-10 20:50 [PATCH 01/14] cmd640: fix warm-plug support for the secondary interface Bartlomiej Zolnierkiewicz
` (11 preceding siblings ...)
2008-06-10 20:52 ` [PATCH 13/14] ide: remove needless includes from ide-taskfile.c Bartlomiej Zolnierkiewicz
@ 2008-06-10 20:53 ` Bartlomiej Zolnierkiewicz
12 siblings, 0 replies; 14+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2008-06-10 20:53 UTC (permalink / raw)
To: linux-ide; +Cc: Bartlomiej Zolnierkiewicz, linux-kernel
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
---
drivers/ide/setup-pci.c | 5 -----
1 file changed, 5 deletions(-)
Index: b/drivers/ide/setup-pci.c
===================================================================
--- a/drivers/ide/setup-pci.c
+++ b/drivers/ide/setup-pci.c
@@ -6,19 +6,14 @@
* May be copied or modified under the terms of the GNU General Public License
*/
-#include <linux/module.h>
#include <linux/types.h>
#include <linux/kernel.h>
#include <linux/pci.h>
#include <linux/init.h>
-#include <linux/timer.h>
-#include <linux/mm.h>
#include <linux/interrupt.h>
#include <linux/ide.h>
-#include <linux/dma-mapping.h>
#include <asm/io.h>
-#include <asm/irq.h>
/**
* ide_setup_pci_baseregs - place a PCI IDE controller native
^ permalink raw reply [flat|nested] 14+ messages in thread