From patchwork Wed Sep 21 15:45:49 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shawn Guo X-Patchwork-Id: 4221 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id ADA8523EF6 for ; Wed, 21 Sep 2011 15:36:35 +0000 (UTC) Received: from mail-fx0-f52.google.com (mail-fx0-f52.google.com [209.85.161.52]) by fiordland.canonical.com (Postfix) with ESMTP id A29CFA18A87 for ; Wed, 21 Sep 2011 15:36:35 +0000 (UTC) Received: by fxe23 with SMTP id 23so2483459fxe.11 for ; Wed, 21 Sep 2011 08:36:35 -0700 (PDT) Received: by 10.223.61.66 with SMTP id s2mr1253992fah.27.1316619395477; Wed, 21 Sep 2011 08:36:35 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.152.18.198 with SMTP id y6cs130278lad; Wed, 21 Sep 2011 08:36:35 -0700 (PDT) Received: by 10.224.202.135 with SMTP id fe7mr762219qab.378.1316619394503; Wed, 21 Sep 2011 08:36:34 -0700 (PDT) Received: from ch1outboundpool.messaging.microsoft.com (ch1ehsobe001.messaging.microsoft.com. [216.32.181.181]) by mx.google.com with ESMTPS id fc6si4155357qab.63.2011.09.21.08.36.33 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 21 Sep 2011 08:36:34 -0700 (PDT) Received-SPF: neutral (google.com: 216.32.181.181 is neither permitted nor denied by best guess record for domain of shawn.guo@linaro.org) client-ip=216.32.181.181; Authentication-Results: mx.google.com; spf=neutral (google.com: 216.32.181.181 is neither permitted nor denied by best guess record for domain of shawn.guo@linaro.org) smtp.mail=shawn.guo@linaro.org Received: from mail18-ch1-R.bigfish.com (216.32.181.168) by CH1EHSOBE002.bigfish.com (10.43.70.52) with Microsoft SMTP Server id 14.1.225.22; Wed, 21 Sep 2011 15:36:33 +0000 Received: from mail18-ch1 (localhost.localdomain [127.0.0.1]) by mail18-ch1-R.bigfish.com (Postfix) with ESMTP id 29582C2024E; Wed, 21 Sep 2011 15:36:33 +0000 (UTC) X-SpamScore: 0 X-BigFish: VS0(zzzz1202hzz8275dhz2dh87h2a8h668h839h63h) X-Spam-TCS-SCL: 2:0 X-Forefront-Antispam-Report: CIP:70.37.183.190; KIP:(null); UIP:(null); IPVD:NLI; H:mail.freescale.net; RD:none; EFVD:NLI X-FB-DOMAIN-IP-MATCH: fail Received: from mail18-ch1 (localhost.localdomain [127.0.0.1]) by mail18-ch1 (MessageSwitch) id 1316619389779376_6551; Wed, 21 Sep 2011 15:36:29 +0000 (UTC) Received: from CH1EHSMHS022.bigfish.com (snatpool1.int.messaging.microsoft.com [10.43.68.252]) by mail18-ch1.bigfish.com (Postfix) with ESMTP id AA18018D804F; Wed, 21 Sep 2011 15:36:29 +0000 (UTC) Received: from mail.freescale.net (70.37.183.190) by CH1EHSMHS022.bigfish.com (10.43.70.22) with Microsoft SMTP Server (TLS) id 14.1.225.22; Wed, 21 Sep 2011 15:36:28 +0000 Received: from az33smr02.freescale.net (10.64.34.200) by 039-SN1MMR1-001.039d.mgd.msft.net (10.84.1.13) with Microsoft SMTP Server id 14.1.323.7; Wed, 21 Sep 2011 10:36:15 -0500 Received: from S2100-06.ap.freescale.net (S2100-06.ap.freescale.net [10.192.242.125]) by az33smr02.freescale.net (8.13.1/8.13.0) with ESMTP id p8LFa8sL001890; Wed, 21 Sep 2011 10:36:12 -0500 (CDT) From: Shawn Guo To: "David S. Miller" CC: Francois Romieu , =?UTF-8?q?Lothar=20Wa=C3=9Fmann?= , Troy Kisky , Wolfram Sang , , Shawn Guo Subject: [PATCH v3 1/3] net/fec: fec_reset_phy() does not need to always succeed Date: Wed, 21 Sep 2011 23:45:49 +0800 Message-ID: <1316619951-27751-2-git-send-email-shawn.guo@linaro.org> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1316619951-27751-1-git-send-email-shawn.guo@linaro.org> References: <1316619951-27751-1-git-send-email-shawn.guo@linaro.org> MIME-Version: 1.0 X-OriginatorOrg: sigmatel.com FEC can work without a phy reset on some platforms, which means not very platform necessarily have a phy-reset gpio encoded in device tree. Even on the platforms that have the gpio, FEC can work without resetting phy for some cases, e.g. boot loader has done that. So it makes more sense to have the phy-reset-gpio request failure as a debug message rather than a warning, and get fec_reset_phy() return void since the caller does not check the return anyway. Signed-off-by: Shawn Guo Acked-by: Wolfram Sang --- drivers/net/ethernet/freescale/fec.c | 13 +++++-------- 1 files changed, 5 insertions(+), 8 deletions(-) diff --git a/drivers/net/ethernet/freescale/fec.c b/drivers/net/ethernet/freescale/fec.c index 158b82e..9c1d059 100644 --- a/drivers/net/ethernet/freescale/fec.c +++ b/drivers/net/ethernet/freescale/fec.c @@ -1411,24 +1411,22 @@ static int __devinit fec_get_phy_mode_dt(struct platform_device *pdev) return -ENODEV; } -static int __devinit fec_reset_phy(struct platform_device *pdev) +static void __devinit fec_reset_phy(struct platform_device *pdev) { int err, phy_reset; struct device_node *np = pdev->dev.of_node; if (!np) - return -ENODEV; + return; phy_reset = of_get_named_gpio(np, "phy-reset-gpios", 0); err = gpio_request_one(phy_reset, GPIOF_OUT_INIT_LOW, "phy-reset"); if (err) { - pr_warn("FEC: failed to get gpio phy-reset: %d\n", err); - return err; + pr_debug("FEC: failed to get gpio phy-reset: %d\n", err); + return; } msleep(1); gpio_set_value(phy_reset, 1); - - return 0; } #else /* CONFIG_OF */ static inline int fec_get_phy_mode_dt(struct platform_device *pdev) @@ -1436,13 +1434,12 @@ static inline int fec_get_phy_mode_dt(struct platform_device *pdev) return -ENODEV; } -static inline int fec_reset_phy(struct platform_device *pdev) +static inline void fec_reset_phy(struct platform_device *pdev) { /* * In case of platform probe, the reset has been done * by machine code. */ - return 0; } #endif /* CONFIG_OF */