Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp2118609pxb; Mon, 11 Jan 2021 01:03:46 -0800 (PST) X-Google-Smtp-Source: ABdhPJy1mACZ41Aq4Hgid/rc2a8I1QD8XAT58r79M8KOae7qqousJbYRFSGZg4YZhIDa8oc/+2j7 X-Received: by 2002:a50:fc83:: with SMTP id f3mr13568105edq.219.1610355825796; Mon, 11 Jan 2021 01:03:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610355825; cv=none; d=google.com; s=arc-20160816; b=GH8PgYkF60RlgXy6DO6z5C10HD9A+33qFkQNocJrPLLrliodH+eY3v+pQfDKDajuMI vIhbZHD+mGuJ3XQS/2HqUSVKuDLaAS6uM/fIpwSfsS6iVH+FYonmtQuKCCXfaaci/OA+ qcSkH3SkbT0DGRS57eO2hDH4FXXJ4xicHqmfqbWzmkZ55c5KicMV8OYopjZqxtpXRKI5 /cs0r9m1gbxgf/F6CSbSDSPfWDOJEXNtMsSFX0S4am2JB/sLUYSuSpd/PNX3qBmXyZDi 1iqn6O7+x4Kqoty9YpHPZ9o/OJz07XBJHOreF2K5ZwR1rHOI5Hfpe953L5Y71D/Ut7gQ ux9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=eGKB0PqzJlFNl2tgFLPOTRCOHPeD0dp1vtD1nxTGfg4=; b=UH0vM+O9vcm9KjRYGHlgmX6G7DKmnMAdaZha7dVVGaovGLxr1sU60l3BDGCw7u9XIp UI7rGEzipzndd4gm9Iaqmby05cHm9/W47utsTkKcL/EVCPp6It8hRkXWBl2L8iywlU37 3+ZiesElUUll1YbiKxDhBC6S4EmB0LuamOdjDVLnN2mpBdRN21HGmKhmCufX/AbESTul FMdR5aMSmQp7S+9k6nokBssiRtFqU/TpuPMmBFVSo/gswVCzv2+7TQ4pv973bjcJWJ2P GuYegYX0EECOzqTR5S7/44PJnFnLynvj5ygeEhaPtivI1Mc2Drg+mQFadfG1FCWbHbSy yNew== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a15si6466636edm.287.2021.01.11.01.03.22; Mon, 11 Jan 2021 01:03:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728215AbhAKJAW (ORCPT + 99 others); Mon, 11 Jan 2021 04:00:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51580 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728190AbhAKJAV (ORCPT ); Mon, 11 Jan 2021 04:00:21 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5123DC061794 for ; Mon, 11 Jan 2021 00:59:41 -0800 (PST) Received: from dude02.hi.pengutronix.de ([2001:67c:670:100:1d::28]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kyt31-0007ue-AL; Mon, 11 Jan 2021 09:59:35 +0100 Received: from mfe by dude02.hi.pengutronix.de with local (Exim 4.92) (envelope-from ) id 1kyt30-0007Td-9U; Mon, 11 Jan 2021 09:59:34 +0100 From: Marco Felsch To: andrew@lunn.ch, hkallweit1@gmail.com, linux@armlinux.org.uk, davem@davemloft.net, kuba@kernel.org Cc: f.fainelli@gmail.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH] net: phy: smsc: fix clk error handling Date: Mon, 11 Jan 2021 09:59:32 +0100 Message-Id: <20210111085932.28680-1-m.felsch@pengutronix.de> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::28 X-SA-Exim-Mail-From: mfe@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit bedd8d78aba3 ("net: phy: smsc: LAN8710/20: add phy refclk in support") added the phy clk support. The commit already checks if clk_get_optional() throw an error but instead of returning the error it ignores it. Fixes: bedd8d78aba3 ("net: phy: smsc: LAN8710/20: add phy refclk in support") Suggested-by: Jakub Kicinski Signed-off-by: Marco Felsch --- drivers/net/phy/smsc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/phy/smsc.c b/drivers/net/phy/smsc.c index 0fc39ac5ca88..10722fed666d 100644 --- a/drivers/net/phy/smsc.c +++ b/drivers/net/phy/smsc.c @@ -284,7 +284,8 @@ static int smsc_phy_probe(struct phy_device *phydev) /* Make clk optional to keep DTB backward compatibility. */ priv->refclk = clk_get_optional(dev, NULL); if (IS_ERR(priv->refclk)) - dev_err_probe(dev, PTR_ERR(priv->refclk), "Failed to request clock\n"); + return dev_err_probe(dev, PTR_ERR(priv->refclk), + "Failed to request clock\n"); ret = clk_prepare_enable(priv->refclk); if (ret) -- 2.20.1