From patchwork Mon Oct 27 21:11:34 2008 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Brownell X-Patchwork-Id: 5969 X-Patchwork-Delegate: jgarzik@pobox.com Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by ozlabs.org (Postfix) with ESMTP id 42189DDDF0 for ; Tue, 28 Oct 2008 08:38:12 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752734AbYJ0ViK (ORCPT ); Mon, 27 Oct 2008 17:38:10 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752621AbYJ0ViJ (ORCPT ); Mon, 27 Oct 2008 17:38:09 -0400 Received: from smtp115.sbc.mail.sp1.yahoo.com ([69.147.64.88]:42639 "HELO smtp115.sbc.mail.sp1.yahoo.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1752323AbYJ0ViI (ORCPT ); Mon, 27 Oct 2008 17:38:08 -0400 Received: (qmail 49445 invoked from network); 27 Oct 2008 21:38:07 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=pacbell.net; h=Received:X-YMail-OSG:X-Yahoo-Newman-Property:From:To:Subject:Date:User-Agent:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:Content-Disposition:Message-Id; b=A5Kr0o5PxzVudkj0BWO7/MQCHP65lL+0/S339j1dIGTGtMVBYtQ/oyqWIw44XWCL4hEC2w5U9vj2hFix+U6WTCNP4abYrKLVUdZYdNGq29tqCu4qU4yGMIrvf5/pqRZPLZMg/kafmLNS1cRn3qR42k6QilTTunghtdeoTdXgGLs= ; Received: from unknown (HELO pogo.local) (david-b@69.226.222.107 with plain) by smtp115.sbc.mail.sp1.yahoo.com with SMTP; 27 Oct 2008 21:38:07 -0000 X-YMail-OSG: xL3rLa8VM1keSfG3xa4QnIb2ZkaUguIdToioCwhiNuqZrYjTdYTZYOmmpePfhX.OuPWtJwbA5rQ1O51orJmr.nmExN_vxzc6vpyqWPUVZBW8Vj7R1qLslKs5kO60EZxA48Z4uZ__LbgOD7OR1FMynOI9 X-Yahoo-Newman-Property: ymail-3 From: David Brownell To: netdev@vger.kernel.org Subject: [patch 2.6.28-rc2] at91_ether: request/free GPIO for PHY interrupt Date: Mon, 27 Oct 2008 14:11:34 -0700 User-Agent: KMail/1.9.10 Cc: Andrew Victor , Jeff Garzik MIME-Version: 1.0 Content-Disposition: inline Message-Id: <200810271411.34492.david-b@pacbell.net> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: David Brownell When the at91_ether driver is using a GPIO for its PHY interrupt, be sure to request (and later, if needed, free) that GPIO. Signed-off-by: David Brownell --- drivers/net/arm/at91_ether.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html --- a/drivers/net/arm/at91_ether.c +++ b/drivers/net/arm/at91_ether.c @@ -1080,7 +1080,8 @@ static int __init at91ether_setup(unsign init_timer(&lp->check_timer); lp->check_timer.data = (unsigned long)dev; lp->check_timer.function = at91ether_check_link; - } + } else if (lp->board_data.phy_irq_pin >= 32) + gpio_request(lp->board_data.phy_irq_pin, "ethernet_phy"); /* Display ethernet banner */ printk(KERN_INFO "%s: AT91 ethernet at 0x%08x int=%d %s%s (%s)\n", @@ -1167,6 +1168,9 @@ static int __devexit at91ether_remove(st struct net_device *dev = platform_get_drvdata(pdev); struct at91_private *lp = netdev_priv(dev); + if (lp->board_data.phy_irq_pin >= 32) + gpio_free(lp->board_data.phy_irq_pin); + unregister_netdev(dev); free_irq(dev->irq, dev); dma_free_coherent(NULL, sizeof(struct recv_desc_bufs), lp->dlist, (dma_addr_t)lp->dlist_phys);