From 23d8e72c3a813f2121878120bc49de2cd390119b Mon Sep 17 00:00:00 2001 From: Bartlomiej Zolnierkiewicz Date: Sat, 26 Jan 2008 20:13:04 +0100 Subject: rapide: set hwif->chipset hwif->chipset should be set if the hwif is claimed by host driver. Cc: Russell King Acked-by: Sergei Shtylyov Signed-off-by: Bartlomiej Zolnierkiewicz --- drivers/ide/arm/rapide.c | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers/ide/arm/rapide.c') diff --git a/drivers/ide/arm/rapide.c b/drivers/ide/arm/rapide.c index 0775a3afef4..c709d37ec09 100644 --- a/drivers/ide/arm/rapide.c +++ b/drivers/ide/arm/rapide.c @@ -55,6 +55,7 @@ rapide_probe(struct expansion_card *ec, const struct ecard_id *id) hwif = rapide_locate_hwif(base, base + 0x818, 1 << 6, ec->irq); if (hwif) { + hwif->chipset = ide_generic; hwif->hwif_data = base; hwif->gendev.parent = &ec->dev; hwif->noprobe = 0; -- cgit v1.2.3 From 57c802e84f9c759c3d1794a9dbe81bc10444df62 Mon Sep 17 00:00:00 2001 From: Bartlomiej Zolnierkiewicz Date: Sat, 26 Jan 2008 20:13:05 +0100 Subject: ide: add ide_init_port_hw() helper * Add ide_init_port_hw() helper. * rapide.c: convert rapide_locate_hwif() to rapide_setup_ports() and use ide_init_port_hw(). * ide_platform.c: convert plat_ide_locate_hwif() to plat_ide_setup_ports() and use ide_init_port_hw(). * sgiioc4.c: use ide_init_port_hw(). * pmac.c: add 'hw_regs_t *hw' argument to pmac_ide_setup_device(), setup 'hw' in pmac_ide_{macio,pci}_attach() and use ide_init_port_hw() in pmac_ide_setup_device(). This patch is a preparation for the future changes in the IDE probing code. There should be no functionality changes caused by this patch. Cc: Russell King Cc: Anton Vorontsov Cc: Jeremy Higdon Cc: Benjamin Herrenschmidt Acked-by: Sergei Shtylyov Signed-off-by: Bartlomiej Zolnierkiewicz --- drivers/ide/arm/rapide.c | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) (limited to 'drivers/ide/arm/rapide.c') diff --git a/drivers/ide/arm/rapide.c b/drivers/ide/arm/rapide.c index c709d37ec09..0267467d179 100644 --- a/drivers/ide/arm/rapide.c +++ b/drivers/ide/arm/rapide.c @@ -13,26 +13,18 @@ #include -static ide_hwif_t * -rapide_locate_hwif(void __iomem *base, void __iomem *ctrl, unsigned int sz, int irq) +static void rapide_setup_ports(hw_regs_t *hw, void __iomem *base, + void __iomem *ctrl, unsigned int sz, int irq) { unsigned long port = (unsigned long)base; - ide_hwif_t *hwif = ide_find_port(port); int i; - if (hwif == NULL) - goto out; - for (i = IDE_DATA_OFFSET; i <= IDE_STATUS_OFFSET; i++) { - hwif->io_ports[i] = port; + hw->io_ports[i] = port; port += sz; } - hwif->io_ports[IDE_CONTROL_OFFSET] = (unsigned long)ctrl; - hwif->irq = irq; - hwif->mmio = 1; - default_hwif_mmiops(hwif); -out: - return hwif; + hw->io_ports[IDE_CONTROL_OFFSET] = (unsigned long)ctrl; + hw->irq = irq; } static int __devinit @@ -42,6 +34,7 @@ rapide_probe(struct expansion_card *ec, const struct ecard_id *id) void __iomem *base; int ret; u8 idx[4] = { 0xff, 0xff, 0xff, 0xff }; + hw_regs_t hw; ret = ecard_request_resources(ec); if (ret) @@ -53,12 +46,19 @@ rapide_probe(struct expansion_card *ec, const struct ecard_id *id) goto release; } - hwif = rapide_locate_hwif(base, base + 0x818, 1 << 6, ec->irq); + hwif = ide_find_port((unsigned long)base); if (hwif) { - hwif->chipset = ide_generic; + memset(&hw, 0, sizeof(hw)); + rapide_setup_ports(&hw, base, base + 0x818, 1 << 6, ec->irq); + hw.chipset = ide_generic; + hw.dev = &ec->dev; + + ide_init_port_hw(hwif, &hw); + + hwif->mmio = 1; + default_hwif_mmiops(hwif); + hwif->hwif_data = base; - hwif->gendev.parent = &ec->dev; - hwif->noprobe = 0; idx[0] = hwif->index; -- cgit v1.2.3 From ce635f605e52a0d47aea5313ba406ada20e6028a Mon Sep 17 00:00:00 2001 From: Bartlomiej Zolnierkiewicz Date: Sat, 26 Jan 2008 20:13:08 +0100 Subject: rapide: remove write-only hwif->hwif_data Cc: Russell King Acked-by: Sergei Shtylyov Signed-off-by: Bartlomiej Zolnierkiewicz --- drivers/ide/arm/rapide.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'drivers/ide/arm/rapide.c') diff --git a/drivers/ide/arm/rapide.c b/drivers/ide/arm/rapide.c index 0267467d179..e6b56d1d48f 100644 --- a/drivers/ide/arm/rapide.c +++ b/drivers/ide/arm/rapide.c @@ -58,8 +58,6 @@ rapide_probe(struct expansion_card *ec, const struct ecard_id *id) hwif->mmio = 1; default_hwif_mmiops(hwif); - hwif->hwif_data = base; - idx[0] = hwif->index; ide_device_add(idx); -- cgit v1.2.3 From fadd11c71b5a100fb7560b84a6272b8883082726 Mon Sep 17 00:00:00 2001 From: Bartlomiej Zolnierkiewicz Date: Fri, 1 Feb 2008 23:09:33 +0100 Subject: au1xxx-ide/rapide: use hwif->index for ide_unregister() Cc: Russell King Signed-off-by: Bartlomiej Zolnierkiewicz --- drivers/ide/arm/rapide.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers/ide/arm/rapide.c') diff --git a/drivers/ide/arm/rapide.c b/drivers/ide/arm/rapide.c index e6b56d1d48f..b5b6ed8b82b 100644 --- a/drivers/ide/arm/rapide.c +++ b/drivers/ide/arm/rapide.c @@ -78,8 +78,8 @@ static void __devexit rapide_remove(struct expansion_card *ec) ecard_set_drvdata(ec, NULL); - /* there must be a better way */ - ide_unregister(hwif - ide_hwifs); + ide_unregister(hwif->index); + ecard_release_resources(ec); } -- cgit v1.2.3 From 58f189fccc72bb8a91de1854e519b47d64fbdbaa Mon Sep 17 00:00:00 2001 From: Bartlomiej Zolnierkiewicz Date: Fri, 1 Feb 2008 23:09:33 +0100 Subject: ide: delete filenames/versions from comments Delete filenames/versions from comments. I'm leaving decisions about adding DRV_VERSION defines and MODULE_VERSION()-s to maintainers of the respective drivers. While at it: * Remove unused VERSION define from ide.c. * Remove unused/stale DRV_VERSION define from au1xxx-ide.c. Signed-off-by: Bartlomiej Zolnierkiewicz --- drivers/ide/arm/rapide.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'drivers/ide/arm/rapide.c') diff --git a/drivers/ide/arm/rapide.c b/drivers/ide/arm/rapide.c index b5b6ed8b82b..c8b6581e624 100644 --- a/drivers/ide/arm/rapide.c +++ b/drivers/ide/arm/rapide.c @@ -1,6 +1,4 @@ /* - * linux/drivers/ide/arm/rapide.c - * * Copyright (c) 1996-2002 Russell King. */ -- cgit v1.2.3 From c413b9b94d9a8e7548cc4b2e04b7df0439ce76fd Mon Sep 17 00:00:00 2001 From: Bartlomiej Zolnierkiewicz Date: Sat, 2 Feb 2008 19:56:31 +0100 Subject: ide: add struct ide_port_info instances to legacy host drivers * Remove 'struct pci_dev *dev' argument from ide_hwif_setup_dma(). * Un-static ide_hwif_setup_dma() and add CONFIG_BLK_DEV_IDEDMA_PCI=n version. * Add 'const struct ide_port_info *d' argument to ide_device_add[_all](). * Factor out generic ports init from ide_pci_setup_ports() to ide_init_port(), move it to ide-probe.c and call it in in ide_device_add_all() instead of ide_pci_setup_ports(). * Move ->mate setup to ide_device_add_all() from ide_port_init(). * Add IDE_HFLAG_NO_AUTOTUNE host flag for host drivers that don't enable ->autotune currently. * Setup hwif->chipset in ide_init_port() but iff pi->chipset is set (to not override setup done by ide_hwif_configure()). * Add ETRAX host handling to ide_device_add_all(). * cmd640.c: set IDE_HFLAG_ABUSE_* also for CONFIG_BLK_DEV_CMD640_ENHANCED=n. * pmac.c: make pmac_ide_setup_dma() return an error value and move DMA masks setup to pmac_ide_setup_device(). * Add 'struct ide_port_info' instances to legacy host drivers, pass them to ide_device_add() calls and then remove open-coded ports initialization. Reviewed-by: Sergei Shtylyov Signed-off-by: Bartlomiej Zolnierkiewicz --- drivers/ide/arm/rapide.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/ide/arm/rapide.c') diff --git a/drivers/ide/arm/rapide.c b/drivers/ide/arm/rapide.c index c8b6581e624..b30adcf321c 100644 --- a/drivers/ide/arm/rapide.c +++ b/drivers/ide/arm/rapide.c @@ -58,7 +58,7 @@ rapide_probe(struct expansion_card *ec, const struct ecard_id *id) idx[0] = hwif->index; - ide_device_add(idx); + ide_device_add(idx, NULL); ecard_set_drvdata(ec, hwif); goto out; -- cgit v1.2.3 From f82c2b171905b6d5af92395d8159546351ab602f Mon Sep 17 00:00:00 2001 From: Bartlomiej Zolnierkiewicz Date: Sat, 2 Feb 2008 19:56:39 +0100 Subject: ide: add 'init_default' and 'restore' arguments to ide_unregister() * Add 'init_default' (flag for calling init_hwif_default()) and 'restore' (flag for calling ide_hwif_restore()) arguments to ide_unregister(). * Update ide_unregister() users to set 'init_default' and 'restore' flags. * No need to set 'init_default' flag in ide_register_hw() if the setup done by init_hwif_default() is going to be overridden by ide_init_port_hw(). * No need to set 'init_default' and 'restore' flags in cleanup_module(). There should be no functionality changes caused by this patch. Signed-off-by: Bartlomiej Zolnierkiewicz --- drivers/ide/arm/rapide.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/ide/arm/rapide.c') diff --git a/drivers/ide/arm/rapide.c b/drivers/ide/arm/rapide.c index b30adcf321c..823d3331318 100644 --- a/drivers/ide/arm/rapide.c +++ b/drivers/ide/arm/rapide.c @@ -76,7 +76,7 @@ static void __devexit rapide_remove(struct expansion_card *ec) ecard_set_drvdata(ec, NULL); - ide_unregister(hwif->index); + ide_unregister(hwif->index, 1, 1); ecard_release_resources(ec); } -- cgit v1.2.3 From 909f4369bca30f9a186316a3bf2b4a9c1e702a25 Mon Sep 17 00:00:00 2001 From: Bartlomiej Zolnierkiewicz Date: Sat, 2 Feb 2008 19:56:39 +0100 Subject: ide: fix ide_unregister() usage in host drivers bast-ide.c/ide-cs.c/delkin_cb.c: * Don't set 'restore' flag for ide_unregister() when initializing new interface. rapide.c/ide-pnp.c/ide-cs.c/ide_platform.c/au1xxx-ide.c/delkin_cb.c/scc_pata.c: * Don't set 'init_default' and 'restore' flags for ide_unregister() when removing interface. Signed-off-by: Bartlomiej Zolnierkiewicz --- drivers/ide/arm/rapide.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/ide/arm/rapide.c') diff --git a/drivers/ide/arm/rapide.c b/drivers/ide/arm/rapide.c index 823d3331318..efba00d2fc3 100644 --- a/drivers/ide/arm/rapide.c +++ b/drivers/ide/arm/rapide.c @@ -76,7 +76,7 @@ static void __devexit rapide_remove(struct expansion_card *ec) ecard_set_drvdata(ec, NULL); - ide_unregister(hwif->index, 1, 1); + ide_unregister(hwif->index, 0, 0); ecard_release_resources(ec); } -- cgit v1.2.3