Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1718565ybl; Wed, 28 Aug 2019 20:18:54 -0700 (PDT) X-Google-Smtp-Source: APXvYqz2nYY62Jrf72kEXgDvdu/AicX/tmS/4qjfPu4BDy1oi1l1pdgzBXbLTsyKyQgAH2L9KW5v X-Received: by 2002:a62:6489:: with SMTP id y131mr8417476pfb.124.1567048734679; Wed, 28 Aug 2019 20:18:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567048734; cv=none; d=google.com; s=arc-20160816; b=ws7lECAuF1/kK4YU6bJRRIdjr0OEmrKX58yc3lNDHxKJTu9IvYrCQwdHY0BmzojU+U LibAj4sDT3caHzvu3o3puCZX/3+cQ/5l6pJnELPAoynsbuLSJxMgU4Mni2xrA9dTXqPp 943+Votrecp7HWrC4cSbEMdMqgoCVHiyKpKBneA4evdLS68aCP5yO2IAybf+msxyTgdp Q1HJlFbU9ARj13k91CbyPEQgNZ2BrHYWlWOfhxeHgWA8H0OFx1LCXq1EzGRbAM82JzDf 322two8LGWn/7Q0oh9f0e1jiHSTbwo4Rm/OEuFQg4M7wKDhcF7+whuo5ViyoNRw1Tc6H du2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=LuoEJL0xfWh8sKmDplGP6DDbhJUhXVxpwhKO/opDE8Y=; b=twyf6V9++xnOL5ejxql4ldZimdcaRoRLKEUcw8dj7JqnGkttYrucFU+DG9HlvQaBxg X/cx3RcXNt/sLIi/hIGXbxCxGTA7Ft19QbTDeuaQvy0zT57feTS21WPXtGyR/3p08Z1t qLKC/JloVrhHqcGmCMxwwXR3fPm4y9Kl34jRjgeY8fifHG5F0q9LGQkKcBwDxiRCoFc5 IuPkAlQAeVaPY/6AozCHcJtD965Mz0mojqA3dCEgbIC1nBR/Rk60r7WGK1a/6ront/t+ qmZCAKAswEqR6J/yBaoi2lPgFvwItT1d2UNcU3GMbQB+QGah0TyjbKawTRJxr8Et1geL qbdQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=HAD4xrCf; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 132si794429pgc.134.2019.08.28.20.18.38; Wed, 28 Aug 2019 20:18:54 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=HAD4xrCf; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727097AbfH2DRj (ORCPT + 99 others); Wed, 28 Aug 2019 23:17:39 -0400 Received: from mail.kernel.org ([198.145.29.99]:37208 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726081AbfH2DRj (ORCPT ); Wed, 28 Aug 2019 23:17:39 -0400 Received: from wens.tw (mirror2.csie.ntu.edu.tw [140.112.30.76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 5E9DB22CF8; Thu, 29 Aug 2019 03:17:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1567048658; bh=u98FcVu0HBkillng09TqWFlGgpgWVWpnghz9szhnReI=; h=From:To:Cc:Subject:Date:From; b=HAD4xrCfip0e9CQw3xO5Qsd40IdOaU7J/AldbwBXqtbzk8rjpl8hI756VTkNodh/u TBVn9ukdcGLCetH0FJeWue86+GoA3/LG0UkyCNfplVPqTMn8dzCqF1PTy5FJwAL/4s TIBsO4qGmnx83Y6eLXMQ9gHQfu+oUhFvlJ2Qz6jQ= Received: by wens.tw (Postfix, from userid 1000) id BA06A5FCC3; Thu, 29 Aug 2019 11:17:32 +0800 (CST) From: Chen-Yu Tsai To: Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , "David S. Miller" , Heiko Stuebner Cc: Chen-Yu Tsai , linux-rockchip@lists.infradead.org, linux-arm-kernel@lists.infradead.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH netdev] net: stmmac: dwmac-rk: Don't fail if phy regulator is absent Date: Thu, 29 Aug 2019 11:17:24 +0800 Message-Id: <20190829031724.20865-1-wens@kernel.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Chen-Yu Tsai The devicetree binding lists the phy phy as optional. As such, the driver should not bail out if it can't find a regulator. Instead it should just skip the remaining regulator related code and continue on normally. Skip the remainder of phy_power_on() if a regulator supply isn't available. This also gets rid of the bogus return code. Fixes: 2e12f536635f ("net: stmmac: dwmac-rk: Use standard devicetree property for phy regulator") Signed-off-by: Chen-Yu Tsai --- On a separate note, maybe we should add this file to the Rockchip entry in MAINTAINERS? --- drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c index 4644b2aeeba1..e2e469c37a4d 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c @@ -1194,10 +1194,8 @@ static int phy_power_on(struct rk_priv_data *bsp_priv, bool enable) int ret; struct device *dev = &bsp_priv->pdev->dev; - if (!ldo) { - dev_err(dev, "no regulator found\n"); - return -1; - } + if (!ldo) + return 0; if (enable) { ret = regulator_enable(ldo); -- 2.20.1