LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
To: linux-ide@vger.kernel.org
Cc: linuxppc-dev@ozlabs.org,
	Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	linux-kernel@vger.kernel.org
Subject: [PATCH 04/11] ppc/pmac: remove ppc_ide_md hooks
Date: Thu, 14 Feb 2008 01:36:49 +0100	[thread overview]
Message-ID: <20080214003649.12879.54140.sendpatchset@localhost.localdomain> (raw)
In-Reply-To: <20080214003621.12879.33868.sendpatchset@localhost.localdomain>

* Add pmac_ide_init_ports() helper and use it instead of
  pmac_ide_init_hwif_ports().

* Remove ppc_ide_md hooks - no need for them
  (IDE pmac host driver takes care of all this setup).

* Then remove no longer needed <linux/ide.h> include
  from arch/powerpc/platforms/powermac/pmac.h.

Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
---
 arch/powerpc/platforms/powermac/pmac.h  |    5 ---
 arch/powerpc/platforms/powermac/setup.c |    8 -----
 drivers/ide/ppc/pmac.c                  |   50 +++++++-------------------------
 3 files changed, 11 insertions(+), 52 deletions(-)

Index: b/arch/powerpc/platforms/powermac/pmac.h
===================================================================
--- a/arch/powerpc/platforms/powermac/pmac.h
+++ b/arch/powerpc/platforms/powermac/pmac.h
@@ -2,7 +2,6 @@
 #define __PMAC_H__
 
 #include <linux/pci.h>
-#include <linux/ide.h>
 #include <linux/irq.h>
 
 /*
@@ -35,10 +34,6 @@ extern void pmac_check_ht_link(void);
 
 extern void pmac_setup_smp(void);
 
-extern unsigned long pmac_ide_get_base(int index);
-extern void pmac_ide_init_hwif_ports(hw_regs_t *hw,
-	unsigned long data_port, unsigned long ctrl_port, int *irq);
-
 extern int pmac_nvram_init(void);
 extern void pmac_pic_init(void);
 
Index: b/arch/powerpc/platforms/powermac/setup.c
===================================================================
--- a/arch/powerpc/platforms/powermac/setup.c
+++ b/arch/powerpc/platforms/powermac/setup.c
@@ -574,14 +574,6 @@ static int __init pmac_probe(void)
 	ISA_DMA_THRESHOLD = ~0L;
 	DMA_MODE_READ = 1;
 	DMA_MODE_WRITE = 2;
-
-#if defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE)
-#ifdef CONFIG_BLK_DEV_IDE_PMAC
-        ppc_ide_md.ide_init_hwif	= pmac_ide_init_hwif_ports;
-        ppc_ide_md.default_io_base	= pmac_ide_get_base;
-#endif /* CONFIG_BLK_DEV_IDE_PMAC */
-#endif /* defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE) */
-
 #endif /* CONFIG_PPC32 */
 
 #ifdef CONFIG_PMAC_SMU
Index: b/drivers/ide/ppc/pmac.c
===================================================================
--- a/drivers/ide/ppc/pmac.c
+++ b/drivers/ide/ppc/pmac.c
@@ -418,37 +418,6 @@ static void pmac_ide_kauai_selectproc(id
 
 #endif /* CONFIG_BLK_DEV_IDEDMA_PMAC */
 
-/*
- * N.B. this can't be an initfunc, because the media-bay task can
- * call ide_[un]register at any time.
- */
-void
-pmac_ide_init_hwif_ports(hw_regs_t *hw,
-			      unsigned long data_port, unsigned long ctrl_port,
-			      int *irq)
-{
-	int i, ix;
-
-	if (data_port == 0)
-		return;
-
-	for (ix = 0; ix < MAX_HWIFS; ++ix)
-		if (data_port == pmac_ide[ix].regbase)
-			break;
-
-	if (ix >= MAX_HWIFS)
-		return;		/* not an IDE PMAC interface */
-
-	for (i = 0; i < 8; ++i)
-		hw->io_ports[i] = data_port + i * 0x10;
-	hw->io_ports[8] = data_port + 0x160;
-
-	if (irq != NULL)
-		*irq = pmac_ide[ix].irq;
-
-	hw->dev = &pmac_ide[ix].mdev->ofdev.dev;
-}
-
 #define PMAC_IDE_REG(x) \
 	((void __iomem *)((drive)->hwif->io_ports[IDE_DATA_OFFSET] + (x)))
 
@@ -886,12 +855,6 @@ sanitize_timings(pmac_ide_hwif_t *pmif)
 	pmif->timings[2] = pmif->timings[3] = value2;
 }
 
-unsigned long
-pmac_ide_get_base(int index)
-{
-	return pmac_ide[index].regbase;
-}
-
 /* Suspend call back, should be called after the child devices
  * have actually been suspended
  */
@@ -1108,6 +1071,15 @@ pmac_ide_setup_device(pmac_ide_hwif_t *p
 	return 0;
 }
 
+static void __devinit pmac_ide_init_ports(hw_regs_t *hw, unsigned long base)
+{
+	int i;
+
+	for (i = 0; i < 8; ++i)
+		hw->io_ports[i] = base + i * 0x10;
+	hw->io_ports[8] = base + 0x160;
+}
+
 /*
  * Attach to a macio probed interface
  */
@@ -1181,7 +1153,7 @@ pmac_ide_macio_attach(struct macio_dev *
 	dev_set_drvdata(&mdev->ofdev.dev, hwif);
 
 	memset(&hw, 0, sizeof(hw));
-	pmac_ide_init_hwif_ports(&hw, pmif->regbase, 0, NULL);
+	pmac_ide_init_ports(&hw, pmif->regbase);
 	hw.irq = irq;
 	hw.dev = &mdev->ofdev.dev;
 
@@ -1295,7 +1267,7 @@ pmac_ide_pci_attach(struct pci_dev *pdev
 	pci_set_drvdata(pdev, hwif);
 
 	memset(&hw, 0, sizeof(hw));
-	pmac_ide_init_hwif_ports(&hw, pmif->regbase, 0, NULL);
+	pmac_ide_init_ports(&hw, pmif->regbase);
 	hw.irq = pdev->irq;
 	hw.dev = &pdev->dev;
 

  parent reply	other threads:[~2008-02-14  0:25 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-14  0:36 [PATCH 00/11] ide/ppc: remove PPC specific IDE hacks Bartlomiej Zolnierkiewicz
2008-02-14  0:36 ` [PATCH 01/11] ide-pmac: remove dead code Bartlomiej Zolnierkiewicz
2008-02-14  0:36 ` [PATCH 02/11] ppc/hdpu: remove dead IDE code Bartlomiej Zolnierkiewicz
2008-02-14  0:36 ` [PATCH 03/11] ppc/ppc4xx: remove ppc_ide_md hooks Bartlomiej Zolnierkiewicz
2008-02-14  0:36 ` Bartlomiej Zolnierkiewicz [this message]
2008-02-14  0:36 ` [PATCH 05/11] ppc/mpc8xx: " Bartlomiej Zolnierkiewicz
2008-02-14 20:46   ` Vitaly Bordug
2008-02-14  0:37 ` [PATCH 06/11] ppc/lopec: " Bartlomiej Zolnierkiewicz
2008-02-14  0:37 ` [PATCH 07/11] ppc/sandpoint: " Bartlomiej Zolnierkiewicz
2008-02-14  0:37 ` [PATCH 08/11] ppc/pplus: remove ppc_ide_md.ide_init_hwif hook Bartlomiej Zolnierkiewicz
2008-02-14  0:37 ` [PATCH 09/11] ppc: remove ppc_ide_md Bartlomiej Zolnierkiewicz
2008-02-14  0:37 ` [PATCH 10/11] ppc: don't include <linux/ide.h> Bartlomiej Zolnierkiewicz
2008-02-14  0:37 ` [PATCH 11/11] ppc/pmac: remove no longer needed IDE quirk Bartlomiej Zolnierkiewicz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080214003649.12879.54140.sendpatchset@localhost.localdomain \
    --to=bzolnier@gmail.com \
    --cc=benh@kernel.crashing.org \
    --cc=linux-ide@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@ozlabs.org \
    --subject='Re: [PATCH 04/11] ppc/pmac: remove ppc_ide_md hooks' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).