[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20111125134708.GM15531@game.jcrosoft.org>
Date: Fri, 25 Nov 2011 14:47:08 +0100
From: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@...osoft.com>
To: Jamie Iles <jamie@...ieiles.com>
Cc: Nicolas Ferre <nicolas.ferre@...el.com>, netdev@...r.kernel.org,
sfr@...b.auug.org.au, linux-next@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org
Subject: Re: [PATCH] at91_ether: use gpio_is_valid for phy IRQ line
On 22:28 Thu 24 Nov , Jamie Iles wrote:
> Hi Nicolas,
>
> On Thu, Nov 24, 2011 at 10:21:14PM +0100, Nicolas Ferre wrote:
> > Use the generic gpiolib gpio_is_valid() function to test
> > if the phy IRQ line GPIO is actually provided.
> >
> > For non-connected or non-existing phy IRQ lines, -EINVAL
> > value is used for phy_irq_pin field of struct at91_eth_data.
> >
> > Signed-off-by: Nicolas Ferre <nicolas.ferre@...el.com>
> > ---
> > drivers/net/ethernet/cadence/at91_ether.c | 23 +++++++++++++----------
> > 1 files changed, 13 insertions(+), 10 deletions(-)
> >
> > diff --git a/drivers/net/ethernet/cadence/at91_ether.c b/drivers/net/ethernet/cadence/at91_ether.c
> > index 56624d3..a1c4143 100644
> > --- a/drivers/net/ethernet/cadence/at91_ether.c
> > +++ b/drivers/net/ethernet/cadence/at91_ether.c
> > @@ -255,8 +255,7 @@ static void enable_phyirq(struct net_device *dev)
> > unsigned int dsintr, irq_number;
> > int status;
> >
> > - irq_number = lp->board_data.phy_irq_pin;
> > - if (!irq_number) {
> > + if (!gpio_is_valid(lp->board_data.phy_irq_pin)) {
> > /*
> > * PHY doesn't have an IRQ pin (RTL8201, DP83847, AC101L),
> > * or board does not have it connected.
> > @@ -265,6 +264,7 @@ static void enable_phyirq(struct net_device *dev)
> > return;
> > }
> >
> > + irq_number = lp->board_data.phy_irq_pin;
>
> Does this need to be:
>
> irq_number = gpio_to_irq(lp->board_data.phy_irq_pin);
>
> and the same for the other occurrences? Otherwise this looks like the
> right thing to me.
yes
Acked-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@...osoft.com>
Best Regards,
J.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists