Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp3990309pxb; Tue, 2 Mar 2021 04:04:52 -0800 (PST) X-Google-Smtp-Source: ABdhPJxgP0S+GppDY+HQP/nBFCtTrYaewZHQil1iF9yFmXnd2cvvdGyIiarfO2cVXl5VhQm07v8M X-Received: by 2002:a05:6402:38d:: with SMTP id o13mr18957177edv.337.1614686692171; Tue, 02 Mar 2021 04:04:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614686692; cv=none; d=google.com; s=arc-20160816; b=Iup92TH5rhm+Kq8o2pmN4FMlYdyYsJFSKeCQkILOQhGjQzdPWaj2PHqxV+WncDnML7 tWUjmTxNWQy8Tt+npYHNb7PNfoLLy7d6NaYRDnOV+oA2SW2stUpEFpt5wjf4F7noZHj9 oCQvz+wh2D2zJD+W8QY+202VDXvWDnjkqREe3vDCSvt3jPjf7VRKkvFglZsCsSZES/kE rhsDqhqZDiUgiggPaKfliLTOT/yaV+I8DDEdducXEajsEqu0sw90DNhRhICo3Vz0YkLG AAMnEoUPwfllKxOCZ8ywXNNQ7MhAeZAZW9GSfL7g5JoDLAoVFagkVq0u4dgeoStMabxW eWzA== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=SK962QW/WprawHS5TYfcG2ABz2dWcoFUTSJ8WaQExQQ=; b=VoJu7ViVFKEmwl4tq0JAWTxV7D1gfpnHvRGmntjDqNN9exHYvkhp8gKUkeeiC3EEBD 3MDoLzA9KDIRKbHiluXv1dWhTzX/fOu2GCXtMkxtDS75sq5RpxVMLXjwXytaIvqbdH1A nc8ycjPSPDY5LxApmdsps8jFaxw4ztS0I/+9fPdYDGR/bI9V7kQBsKO0iUUitbYJtmr6 nlFUdwiJWm6xeXDOF+tSui76nBq9qZ5XtFrgcMWG2ujLk44MUUxVx0Y7DcwR8aVrElIO Ki/TlDASIGi6bPrRajwBwSkD8336e4/58QXIOfi4QHfype1VsWgw/Z9LSj1JplUYDL4j tfiA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Thk4ZAVg; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a1si1651674ejg.521.2021.03.02.04.04.28; Tue, 02 Mar 2021 04:04:52 -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; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Thk4ZAVg; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1442316AbhCBCMW (ORCPT + 99 others); Mon, 1 Mar 2021 21:12:22 -0500 Received: from mail.kernel.org ([198.145.29.99]:53026 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241744AbhCATix (ORCPT ); Mon, 1 Mar 2021 14:38:53 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id A83236521B; Mon, 1 Mar 2021 17:22:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1614619358; bh=QsTUp8bQsQpd8ulOBfV2MbPHQmo7AQ+qGIkRfCUfRSk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Thk4ZAVgzVlqU0af9SQSqqDpwDgv3/U32PH7sR1ay+s+DFi2OgMziee+JyrDEDxPA 4RD1/zC33R9NI0nN0cGTM4wPY8JZByDahvnV2VrXUaNBs45KopMDBgyEje5QGbuN9K ymTc2f5Upu26N1KVz13O35puKAYSIbKpKfawVHL0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Chris Ruehl , Douglas Anderson , Vinod Koul , Sasha Levin Subject: [PATCH 5.10 395/663] phy: rockchip-emmc: emmc_phy_init() always return 0 Date: Mon, 1 Mar 2021 17:10:43 +0100 Message-Id: <20210301161201.409530225@linuxfoundation.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210301161141.760350206@linuxfoundation.org> References: <20210301161141.760350206@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Chris Ruehl [ Upstream commit 39961bd6b70e5a5d7c4b5483ad8e1db6b5765c60 ] rockchip_emmc_phy_init() return variable is not set with the error value if clk_get() failed. 'emmcclk' is optional, thus use clk_get_optional() and if the return value != NULL make error processing and set the return code accordingly. Fixes: 52c0624a10cce phy: rockchip-emmc: Set phyctrl_frqsel based on card clock Signed-off-by: Chris Ruehl Reviewed-by: Douglas Anderson Link: https://lore.kernel.org/r/20201210080454.17379-1-chris.ruehl@gtsys.com.hk Signed-off-by: Vinod Koul Signed-off-by: Sasha Levin --- drivers/phy/rockchip/phy-rockchip-emmc.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/phy/rockchip/phy-rockchip-emmc.c b/drivers/phy/rockchip/phy-rockchip-emmc.c index 2dc19ddd120f5..a005fc58bbf02 100644 --- a/drivers/phy/rockchip/phy-rockchip-emmc.c +++ b/drivers/phy/rockchip/phy-rockchip-emmc.c @@ -240,15 +240,17 @@ static int rockchip_emmc_phy_init(struct phy *phy) * - SDHCI driver to get the PHY * - SDHCI driver to init the PHY * - * The clock is optional, so upon any error we just set to NULL. + * The clock is optional, using clk_get_optional() to get the clock + * and do error processing if the return value != NULL * * NOTE: we don't do anything special for EPROBE_DEFER here. Given the * above expected use case, EPROBE_DEFER isn't sensible to expect, so * it's just like any other error. */ - rk_phy->emmcclk = clk_get(&phy->dev, "emmcclk"); + rk_phy->emmcclk = clk_get_optional(&phy->dev, "emmcclk"); if (IS_ERR(rk_phy->emmcclk)) { - dev_dbg(&phy->dev, "Error getting emmcclk: %d\n", ret); + ret = PTR_ERR(rk_phy->emmcclk); + dev_err(&phy->dev, "Error getting emmcclk: %d\n", ret); rk_phy->emmcclk = NULL; } -- 2.27.0