Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1378545 > unrolled thread

[PATCH] pata_artop: Use ioread8.

Started byYoshinori Sato <ysato@users.sourceforge.jp>
First post2016-04-14 09:30 +0200
Last post2016-04-14 17:50 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] pata_artop: Use ioread8. Yoshinori Sato <ysato@users.sourceforge.jp> - 2016-04-14 09:30 +0200
    Re: [PATCH] pata_artop: Use ioread8. Tejun Heo <tj@kernel.org> - 2016-04-14 17:50 +0200

#1378545 — [PATCH] pata_artop: Use ioread8.

FromYoshinori Sato <ysato@users.sourceforge.jp>
Date2016-04-14 09:30 +0200
Subject[PATCH] pata_artop: Use ioread8.
Message-ID<rnJSW-6wh-11@gated-at.bofh.it>
Support for non x86 targets.

Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp>
---
 drivers/ata/pata_artop.c | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)

diff --git a/drivers/ata/pata_artop.c b/drivers/ata/pata_artop.c
index 96c05c9..3731dea 100644
--- a/drivers/ata/pata_artop.c
+++ b/drivers/ata/pata_artop.c
@@ -340,6 +340,18 @@ static void atp8xx_fixup(struct pci_dev *pdev)
 	}
 }
 
+static int is_fast(struct pci_dev *pdev)
+{
+	int ret = 0;
+	void __iomem *addr;
+
+	addr = pci_iomap(pdev, 4, 1);
+	if (ioread8(addr) & 0x10)
+		ret = 1;
+	pci_iounmap(pdev, addr);
+
+	return ret;
+}
 /**
  *	artop_init_one - Register ARTOP ATA PCI device with kernel services
  *	@pdev: PCI device to register
@@ -398,10 +410,8 @@ static int artop_init_one (struct pci_dev *pdev, const struct pci_device_id *id)
 	else if (id->driver_data == 1)	/* 6260 */
 		ppi[0] = &info_626x;
 	else if (id->driver_data == 2)	{ /* 6280 or 6280 + fast */
-		unsigned long io = pci_resource_start(pdev, 4);
-
 		ppi[0] = &info_628x;
-		if (inb(io) & 0x10)
+		if (is_fast(pdev))
 			ppi[0] = &info_628x_fast;
 	}
 
-- 
2.7.0

[toc] | [next] | [standalone]


#1379040

FromTejun Heo <tj@kernel.org>
Date2016-04-14 17:50 +0200
Message-ID<rnRGO-44y-9@gated-at.bofh.it>
In reply to#1378545
Hello,

On Thu, Apr 14, 2016 at 04:26:03PM +0900, Yoshinori Sato wrote:
> Support for non x86 targets.

Being a bit more detailed would be nice.

> Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp>
> ---
>  drivers/ata/pata_artop.c | 16 +++++++++++++---
>  1 file changed, 13 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/ata/pata_artop.c b/drivers/ata/pata_artop.c
> index 96c05c9..3731dea 100644
> --- a/drivers/ata/pata_artop.c
> +++ b/drivers/ata/pata_artop.c
> @@ -340,6 +340,18 @@ static void atp8xx_fixup(struct pci_dev *pdev)
>  	}
>  }
>  
> +static int is_fast(struct pci_dev *pdev)

Can you please make the name a bit more descriptive?

Thanks.

-- 
tejun

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web