netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] au1000_eth: use write accessors
@ 2009-07-28 21:06 Florian Fainelli
  2009-07-29  7:51 ` Manuel Lauss
  0 siblings, 1 reply; 2+ messages in thread
From: Florian Fainelli @ 2009-07-28 21:06 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, Manuel Lauss

Hi David,

The next 3 patches apply to on top of the patch series that I
sent earlier converting au1000_eth to become a platform_driver.
Thanks !
--
From: Florian Fainelli <florian@openwrt.org>
This patch replaces all occurences of *aup->enable = val
by writel(val, &aup->enable)

Signed-off-by: Florian Fainelli <florian@openwrt.org>
---
diff --git a/drivers/net/au1000_eth.c b/drivers/net/au1000_eth.c
index 57cc4f6..1f724da 100644
--- a/drivers/net/au1000_eth.c
+++ b/drivers/net/au1000_eth.c
@@ -155,10 +155,10 @@ static void enable_mac(struct net_device *dev, int force_reset)
 	spin_lock_irqsave(&aup->lock, flags);
 
 	if(force_reset || (!aup->mac_enabled)) {
-		*aup->enable = MAC_EN_CLOCK_ENABLE;
+		writel(MAC_EN_CLOCK_ENABLE, &aup->enable);
 		au_sync_delay(2);
-		*aup->enable = (MAC_EN_RESET0 | MAC_EN_RESET1 | MAC_EN_RESET2
-				| MAC_EN_CLOCK_ENABLE);
+		writel((MAC_EN_RESET0 | MAC_EN_RESET1 | MAC_EN_RESET2
+			| MAC_EN_CLOCK_ENABLE), &aup->enable);
 		au_sync_delay(2);
 
 		aup->mac_enabled = 1;
@@ -486,9 +486,9 @@ static void reset_mac_unlocked(struct net_device *dev)
 
 	hard_stop(dev);
 
-	*aup->enable = MAC_EN_CLOCK_ENABLE;
+	writel(MAC_EN_CLOCK_ENABLE, &aup->enable);
 	au_sync_delay(2);
-	*aup->enable = 0;
+	writel(0, &aup->enable);
 	au_sync_delay(2);
 
 	aup->tx_full = 0;
@@ -1103,7 +1103,7 @@ static int __devinit au1000_probe(struct platform_device *pdev)
 	memcpy(dev->dev_addr, au1000_mac_addr, sizeof(au1000_mac_addr));
 	dev->dev_addr[5] += pdev->id;
 
-	*aup->enable = 0;
+	writel(0, &aup->enable);
 	aup->mac_enabled = 0;
 
 	pd = pdev->dev.platform_data;

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 1/3] au1000_eth: use write accessors
  2009-07-28 21:06 [PATCH 1/3] au1000_eth: use write accessors Florian Fainelli
@ 2009-07-29  7:51 ` Manuel Lauss
  0 siblings, 0 replies; 2+ messages in thread
From: Manuel Lauss @ 2009-07-29  7:51 UTC (permalink / raw)
  To: Florian Fainelli; +Cc: David Miller, netdev

Hi Florian,

On Tue, Jul 28, 2009 at 11:06 PM, Florian Fainelli<florian@openwrt.org> wrote:
> Hi David,
>
> The next 3 patches apply to on top of the patch series that I
> sent earlier converting au1000_eth to become a platform_driver.
> Thanks !
> --
> From: Florian Fainelli <florian@openwrt.org>
> This patch replaces all occurences of *aup->enable = val
> by writel(val, &aup->enable)
>
> Signed-off-by: Florian Fainelli <florian@openwrt.org>
> ---
> diff --git a/drivers/net/au1000_eth.c b/drivers/net/au1000_eth.c
> index 57cc4f6..1f724da 100644
> --- a/drivers/net/au1000_eth.c
> +++ b/drivers/net/au1000_eth.c
> @@ -155,10 +155,10 @@ static void enable_mac(struct net_device *dev, int force_reset)
>        spin_lock_irqsave(&aup->lock, flags);
>
>        if(force_reset || (!aup->mac_enabled)) {
> -               *aup->enable = MAC_EN_CLOCK_ENABLE;
> +               writel(MAC_EN_CLOCK_ENABLE, &aup->enable);
>                au_sync_delay(2);
> -               *aup->enable = (MAC_EN_RESET0 | MAC_EN_RESET1 | MAC_EN_RESET2
> -                               | MAC_EN_CLOCK_ENABLE);
> +               writel((MAC_EN_RESET0 | MAC_EN_RESET1 | MAC_EN_RESET2
> +                       | MAC_EN_CLOCK_ENABLE), &aup->enable);
>                au_sync_delay(2);

While you're at it, please also replace all "au_sync_delay()" with
mmiowb() + msleep()

Thanks!
      Manuel Lauss

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-07-29  7:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-28 21:06 [PATCH 1/3] au1000_eth: use write accessors Florian Fainelli
2009-07-29  7:51 ` Manuel Lauss

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).