From patchwork Tue Apr 2 19:35:10 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guenter Roeck X-Patchwork-Id: 233126 X-Patchwork-Delegate: davem@davemloft.net 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.180.67]) by ozlabs.org (Postfix) with ESMTP id D11D62C00B6 for ; Wed, 3 Apr 2013 06:36:51 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933037Ab3DBTf7 (ORCPT ); Tue, 2 Apr 2013 15:35:59 -0400 Received: from mail.active-venture.com ([67.228.131.205]:59321 "EHLO mail.active-venture.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932631Ab3DBTfN (ORCPT ); Tue, 2 Apr 2013 15:35:13 -0400 Received: (qmail 29462 invoked by uid 399); 2 Apr 2013 19:35:08 -0000 X-Virus-Scan: Scanned by ClamAV 0.97.2 (no viruses); Tue, 02 Apr 2013 14:35:08 -0500 Received: from unknown (HELO localhost) (guenter@roeck-us.net@108.223.40.66) by mail.active-venture.com with ESMTPAM; 2 Apr 2013 19:35:08 -0000 X-Originating-IP: 108.223.40.66 X-Sender: guenter@roeck-us.net From: Guenter Roeck To: "David S. Miller" , Nicolas Ferre , Grant Likely Cc: Rob Herring , David Daney , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree-discuss@lists.ozlabs.org, Guenter Roeck Subject: [PATCH 4/5] net/freescale/fec: Simplify OF dependencies Date: Tue, 2 Apr 2013 12:35:10 -0700 Message-Id: <1364931311-30603-5-git-send-email-linux@roeck-us.net> X-Mailer: git-send-email 1.7.9.7 In-Reply-To: <1364931311-30603-1-git-send-email-linux@roeck-us.net> References: <1364931311-30603-1-git-send-email-linux@roeck-us.net> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Since of_get_mac_address() is now defined even if CONFIG_OF_NET is not configured, the ifdef around the code calling it is no longer necessary and can be removed. Similar, since of_get_phy_mode() is now defined as dummy function if OF_NET is not configured, it is no longer necessary to provide an OF dependent function as front-end. Also, the function depends on OF_NET, not on OF, so the conditional code was not correct anyway. Drop the front-end function and call of_get_phy_mode() directly. Signed-off-by: Guenter Roeck --- drivers/net/ethernet/freescale/fec.c | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/drivers/net/ethernet/freescale/fec.c b/drivers/net/ethernet/freescale/fec.c index 911d025..d374a94 100644 --- a/drivers/net/ethernet/freescale/fec.c +++ b/drivers/net/ethernet/freescale/fec.c @@ -868,7 +868,6 @@ static void fec_get_mac(struct net_device *ndev) */ iap = macaddr; -#ifdef CONFIG_OF /* * 2) from device tree data */ @@ -880,7 +879,6 @@ static void fec_get_mac(struct net_device *ndev) iap = (unsigned char *) mac; } } -#endif /* * 3) from flash or fuse (via platform data) @@ -1666,16 +1664,6 @@ static int fec_enet_init(struct net_device *ndev) } #ifdef CONFIG_OF -static int fec_get_phy_mode_dt(struct platform_device *pdev) -{ - struct device_node *np = pdev->dev.of_node; - - if (np) - return of_get_phy_mode(np); - - return -ENODEV; -} - static void fec_reset_phy(struct platform_device *pdev) { int err, phy_reset; @@ -1704,11 +1692,6 @@ static void fec_reset_phy(struct platform_device *pdev) gpio_set_value(phy_reset, 1); } #else /* CONFIG_OF */ -static int fec_get_phy_mode_dt(struct platform_device *pdev) -{ - return -ENODEV; -} - static void fec_reset_phy(struct platform_device *pdev) { /* @@ -1773,7 +1756,7 @@ fec_probe(struct platform_device *pdev) platform_set_drvdata(pdev, ndev); - ret = fec_get_phy_mode_dt(pdev); + ret = of_get_phy_mode(pdev->dev.of_node); if (ret < 0) { pdata = pdev->dev.platform_data; if (pdata)