Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp4426811ybe; Mon, 9 Sep 2019 09:07:18 -0700 (PDT) X-Google-Smtp-Source: APXvYqxQh6Mkd1dY668B0FyPIUGLdw+6dUONhw9gnFa/PdL7PVV/EfyE6gzg1CzRYfyjXMiF5ZnI X-Received: by 2002:a50:e804:: with SMTP id e4mr20916598edn.91.1568045237877; Mon, 09 Sep 2019 09:07:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568045237; cv=none; d=google.com; s=arc-20160816; b=XkbG/XOOed/1ZwskLMIMtxWOb1k0YQFhUKdewZZvBWkmZjIj6ePlzjqvRnsmO5pqTe feXbLh41OnpkcXWUOLU8q0ez9SHf7D8EI4yytpytBxzTlSlZUyz6vO4TZS4W7j3jkIqx ZNPjEjSufZsipbqB3KDqZDknbXjo+jsHTHbk7qnqujt+UKBIoy8oiQip+zBxQ5Tg5IQP mF6vVSw+CqyfZwON2lmYj5v0c/JZo3cm3mQEoG4fDgXeuU5gCBnx4TIq6E1c37VHlBuH cpOFQUoVC+y2DUaj5p9A0qCAO1KrNW0Iep5wKmjGbA4NscdeXxC7GA8pIJB16020E5Ou LR/g== 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=hpXqyftqyLjehiYDCflcqcqaWXNjhQld2A5HnHvNMDM=; b=pGtWs6d+iaEOgx3Bu9gsjWt0Pxbv5AexhFgAaJXovq5b6CbefbQQGV6gA6P3cdghTO oWKo97bSIu7lSYJre9cUvByu9FifFH/jPH8d0kbNK5lh6I6khJHFx+N+ACq+dRX6cHeX aMgt56wXF+s32fU3CHTJgXnu6uTMdA5meJLByHVZIFiOd4mrZbbmpZM4khY4ESNxhj6Q y4v4yOB79/P4BwecveoYXJJmcHAWYb7fBVShS2mtzr6GyOTSiIflntX8Lmf/OvfIsc72 GU7WVYv4V0vpqiY4OM3s0idZBsYHZZjS4ylzGGwO1ao8mzYHyTKm2SOqOUgjWm9UEwlZ PSiw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=I26IUVBO; 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 r17si5878112ejh.315.2019.09.09.09.06.53; Mon, 09 Sep 2019 09:07:17 -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=I26IUVBO; 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 S1726826AbfIHM4a (ORCPT + 99 others); Sun, 8 Sep 2019 08:56:30 -0400 Received: from mail.kernel.org ([198.145.29.99]:39556 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731537AbfIHMtc (ORCPT ); Sun, 8 Sep 2019 08:49:32 -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 D6668218AF; Sun, 8 Sep 2019 12:49:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1567946972; bh=xzhvNgPOnKLO2KBOGOD9nwNjAXRdz3y0dUwmmtZ1gOo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=I26IUVBOHVSCMwZzyu8HtdeTMJ7rRXjo6l3gnEK696AAc6mRXxeTIf9ggtEfIA3Ob mkYv9zDSfkOlnBa24q2qTjglYAVnFgck9qP37hL8hl1yEVZoeGg4hyDL7VYi5RjSXd VqNP5OArYOzatL0dW+zRpdaGiF8mxh76ifRod53E= 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 5.2 05/94] net: stmmac: dwmac-rk: Dont fail if phy regulator is absent Date: Sun, 8 Sep 2019 13:41:01 +0100 Message-Id: <20190908121150.585264776@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20190908121150.420989666@linuxfoundation.org> References: <20190908121150.420989666@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 @@ -1194,10 +1194,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);