netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Hemminger <shemminger@osdl.org>
To: Andrew Victor <andrew@sanpeople.com>
Cc: netdev@vger.kernel.org, jgarzik@pobox.com
Subject: Re: [PATCH 2.6.19] AT91RM9200 Ethernet update 1
Date: Mon, 4 Dec 2006 10:00:04 -0800	[thread overview]
Message-ID: <20061204100004.3538d7ff@freekitty> (raw)
In-Reply-To: <1165235217.4525.100.camel@fuzzie.sanpeople.com>

On 04 Dec 2006 14:26:57 +0200
Andrew Victor <andrew@sanpeople.com> wrote:

> This patch is an update to the Atmel AT91RM9200 Ethernet driver.
> 
> 1. Remove the global 'at91_dev' variable. 
> 2. Move the global 'check_timer' variable into the private data
> structure.
> 
> 
> Signed-off-by: Andrew Victor <andrew@sanpeople.com>
> 
> 
> diff -urN linux-2.6.19-final.orig/drivers/net/arm/at91_ether.c linux-2.6.19-final/drivers/net/arm/at91_ether.c
> --- linux-2.6.19-final.orig/drivers/net/arm/at91_ether.c	Sat Dec  2 17:28:27 2006
> +++ linux-2.6.19-final/drivers/net/arm/at91_ether.c	Mon Dec  4 14:13:01 2006
> @@ -41,9 +41,6 @@
>  #define DRV_NAME	"at91_ether"
>  #define DRV_VERSION	"1.0"
>  
> -static struct net_device *at91_dev;
> -
> -static struct timer_list check_timer;
>  #define LINK_POLL_INTERVAL	(HZ)
>  
>  /* ..................................................................... */
> @@ -252,8 +249,8 @@
>  		 * PHY doesn't have an IRQ pin (RTL8201, DP83847, AC101L),
>  		 * or board does not have it connected.
>  		 */
> -		check_timer.expires = jiffies + LINK_POLL_INTERVAL;
> -		add_timer(&check_timer);
> +		lp->check_timer.expires = jiffies + LINK_POLL_INTERVAL;
> +		add_timer(&lp->check_timer);
>  		return;
>  	}
>  
> @@ -300,7 +297,7 @@
>  
>  	irq_number = lp->board_data.phy_irq_pin;
>  	if (!irq_number) {
> -		del_timer_sync(&check_timer);
> +		del_timer_sync(&lp->check_timer);
>  		return;
>  	}
>  
> @@ -362,13 +359,14 @@
>  static void at91ether_check_link(unsigned long dev_id)
>  {
>  	struct net_device *dev = (struct net_device *) dev_id;
> +	struct at91_private *lp = (struct at91_private *) dev->priv;

No cast needed.
Use netdev_priv(dev) rather than dev->priv.  netdev_priv() is a constant
offset so the compiler can save a register.


-- 
Stephen Hemminger <shemminger@osdl.org>

  reply	other threads:[~2006-12-04 18:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-04 12:26 [PATCH 2.6.19] AT91RM9200 Ethernet update 1 Andrew Victor
2006-12-04 18:00 ` Stephen Hemminger [this message]
2006-12-04 23:41 ` Jeff Garzik

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=20061204100004.3538d7ff@freekitty \
    --to=shemminger@osdl.org \
    --cc=andrew@sanpeople.com \
    --cc=jgarzik@pobox.com \
    --cc=netdev@vger.kernel.org \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).