Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp4122072ybe; Mon, 9 Sep 2019 04:41:41 -0700 (PDT) X-Google-Smtp-Source: APXvYqwaEvcydFz4JKJO0GSQnlSY/TIGEomLwViUxUgzmpOWajFKRE39X4nPtIwm/J0JvFXFlYd5 X-Received: by 2002:a17:906:7e52:: with SMTP id z18mr18481556ejr.114.1568029301748; Mon, 09 Sep 2019 04:41:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568029301; cv=none; d=google.com; s=arc-20160816; b=03MgzXlEvOAR32cdHaUWn6X0gXy7rybK02deRgc7rSmLOSx60bykmog/DDoroptdj6 1I7RD8697+IvGTqb/kRPLujb2oCcA2e9kMGrzlIm3noLzKGQ58rFUQRmRnA+sE8C6tYS QnMRW/ICmp2V417VlysCibi7PA/2yewFntd47j784eXyrezkZwebLDUxj444BKeqLHPs RN4LtLSCvKKO3veP/PIDJ7vXfdGTAHHibtUyyrlpjfxdef2IDQE40j3CwhOjtD7V3Hha Q1Y1Yba2gqmHtnKXsHCsgEwgRAyw+87kDhojNZentQJwHHv0o+Hbpd6V24xkkDptnN1D haNA== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Pt4wTXltZMLRyGM/si2Z411om94w/+3jR6oWxVW6/yE=; b=e8nDHQ/b81Igi/Fe9S3rjy/kPpiwbI5KBKsaamxwjEpDP7Lebp9ELeodM3Ohxsfq+S HvyEKyyWsQilFdhIirvXNsd4Kbtul70dXXhLZGkzRSnXJYB0epc5vjcA06AJrV3CQkQ6 mtBb2H40/+JWJX8wW3ceOIvWShD1yJMhwf5vN6gg7ebovoxE5vXJYrGe0zWfZTE9dXJz Jy6WWyo0iibRbhWKPuJMzqQ3ISLJqw3SVRprGh73MfC1zgpMwUlVWIkf5WHTjSNsxQxe H1a6Fyq66+TRGgh1cjRJVn0l0Y6/SCWGtMvoITdm/vyRdeK2muOhZCMQPhyqD37r3cMw 6SJw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=b9I7SfUm; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y27si8590735edd.249.2019.09.09.04.41.18; Mon, 09 Sep 2019 04:41:41 -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=b9I7SfUm; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730863AbfIHMsB (ORCPT + 99 others); Sun, 8 Sep 2019 08:48:01 -0400 Received: from mail.kernel.org ([198.145.29.99]:36788 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730847AbfIHMr7 (ORCPT ); Sun, 8 Sep 2019 08:47:59 -0400 Received: from localhost (unknown [62.28.240.114]) (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 28218218AC; Sun, 8 Sep 2019 12:47:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1567946878; bh=C1/xTk2w9kLHGUjT2ARTupMkA1Nis33kKJuHdUq1S18=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=b9I7SfUmWXAprlnbkayk52Eml3c4JfsbmmE5XqJHQNo6o8uOln9JKutmkMhSAPc1B XUak4dXFnEXIGcASg6P11Y56VRGziYJeA85q0jc2fGAcqC26HZs9N1o9mfCqIggiMG N9erc6T71WZ1TZUCq3W7UB9YeRsupJ4xz15ig3LY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Chen-Yu Tsai , "David S. Miller" Subject: [PATCH 4.19 05/57] net: stmmac: dwmac-rk: Dont fail if phy regulator is absent Date: Sun, 8 Sep 2019 13:41:29 +0100 Message-Id: <20190908121127.550413578@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20190908121125.608195329@linuxfoundation.org> References: <20190908121125.608195329@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 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 [ Upstream commit 3b25528e1e355c803e73aa326ce657b5606cda73 ] 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 Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c @@ -1203,10 +1203,8 @@ static int phy_power_on(struct rk_priv_d 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);