From patchwork Mon Sep 13 13:14:41 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 509769 Delivered-To: patch@linaro.org Received: by 2002:a02:c816:0:0:0:0:0 with SMTP id p22csp622479jao; Mon, 13 Sep 2021 07:39:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyRjxHdG+qXhx8o67NG4wY0a8zZtyiGLh1kbtcegnQuKR4YUssnT0EltpY8UHZKlzUzpkMY X-Received: by 2002:a05:6402:229c:: with SMTP id cw28mr10195313edb.356.1631543978622; Mon, 13 Sep 2021 07:39:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631543978; cv=none; d=google.com; s=arc-20160816; b=RlTDCij2GmU2Dk94Kg1+/o9jN/XnPAvFCRpVXhXojmgPSNfoNKGHlMiWiPbTCEevV/ xx7mlud2D5c9zDq1LjQoKsIfR+piGZFFh7O3iJk1GKWeAFQzKD9xqhjn/my3Q/A7OiCQ L2040bhxCMao6EeYGxkGtqf189G7IvUhsDhcsb2IW47PxZvpgee/3v2Y7JHkpRYSQ6dL 7jHM+UerCaRXJFqzTPYuw6Q76ahw2lWdYAi/Mdq0Wew151186bfXKLjCnLXoTXTg+Jjp tapRZFBlB/9avLpFE2cBxMVbD7SoNMIC8ygiUcJjzW1BKhFqAGGZ2I19a5A4ZfQh901n Eheg== 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=Q3sh6+wR4bQ99PwMiRC+/X8bDYPeg7+7CCfmmt7suPs=; b=tdr5zbbTMFQyC1sM2H2aBIih+1tifOcVbLKNzb37ZW0Hl1CO+ZwIJJYu3jE4tSF+9P OzhdtY0imcrbczLkhITB6ae4ruZTttWc5ww7PMDh8uKaWfYHQXwb9OcTi4g0LgAi7/Qe ypfywgY77B6y8KJBvGdg6TInAxkJxateOySLJS5yUzQ62XDceB0DL6jNEjp/uAw4uD3Z LRWc7/DaM6j2450RnNBsSovmNJAJWt5KKAQHStiGnQUtFV4hzlShnZ/NWAywbMjxMYql pKDQ6sdh79OF6Y2FOLbclkXEsJFoEIuFD4Wwww2oRKy5Qm2RoJOgnu2Ueoqf5nwHVoAk c9Dw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=TRE1+Wgt; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-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 s1si8765409ejn.348.2021.09.13.07.39.38; Mon, 13 Sep 2021 07:39:38 -0700 (PDT) Received-SPF: pass (google.com: domain of stable-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=TRE1+Wgt; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-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 S1347858AbhIMOkc (ORCPT + 11 others); Mon, 13 Sep 2021 10:40:32 -0400 Received: from mail.kernel.org ([198.145.29.99]:55828 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345049AbhIMOhN (ORCPT ); Mon, 13 Sep 2021 10:37:13 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 01D7A61BF8; Mon, 13 Sep 2021 13:54:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631541260; bh=4To1bOUCDLgmDWAARWr6k4/bL8hIqGaRJ22HHKwMkho=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TRE1+WgtslQxNvCfZvN19sBtuOsVOsjmWKJvoxlG/plI5jtoyJ2g5GWOpjQkVN/nC vPmLJkk+m5DMVWl61zJDoQTHjDmEApVlnEpY2NjjKhn9wzetZrfiZO4zwkCEFhGxXD i+wBXxLbq/bWOCDiB2cIJBSMjohs3BDm7YoeuH6w= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Shengjiu Wang , Mark Brown , Sasha Levin Subject: [PATCH 5.14 227/334] ASoC: fsl_rpmsg: Check -EPROBE_DEFER for getting clocks Date: Mon, 13 Sep 2021 15:14:41 +0200 Message-Id: <20210913131121.094265963@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210913131113.390368911@linuxfoundation.org> References: <20210913131113.390368911@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Shengjiu Wang [ Upstream commit 2fbbcffea5b6adbfe90ffc842a6b3eb2d7e381ed ] The devm_clk_get() may return -EPROBE_DEFER, then clocks will be assigned to NULL wrongly. As the clocks are optional so we can use devm_clk_get_optional() instead of devm_clk_get(). Fixes: b73d9e6225e8 ("ASoC: fsl_rpmsg: Add CPU DAI driver for audio base on rpmsg") Signed-off-by: Shengjiu Wang Link: https://lore.kernel.org/r/1629266614-6942-1-git-send-email-shengjiu.wang@nxp.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/fsl/fsl_rpmsg.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) -- 2.30.2 diff --git a/sound/soc/fsl/fsl_rpmsg.c b/sound/soc/fsl/fsl_rpmsg.c index ea5c973e2e84..d60f4dac6c1b 100644 --- a/sound/soc/fsl/fsl_rpmsg.c +++ b/sound/soc/fsl/fsl_rpmsg.c @@ -165,25 +165,25 @@ static int fsl_rpmsg_probe(struct platform_device *pdev) } /* Get the optional clocks */ - rpmsg->ipg = devm_clk_get(&pdev->dev, "ipg"); + rpmsg->ipg = devm_clk_get_optional(&pdev->dev, "ipg"); if (IS_ERR(rpmsg->ipg)) - rpmsg->ipg = NULL; + return PTR_ERR(rpmsg->ipg); - rpmsg->mclk = devm_clk_get(&pdev->dev, "mclk"); + rpmsg->mclk = devm_clk_get_optional(&pdev->dev, "mclk"); if (IS_ERR(rpmsg->mclk)) - rpmsg->mclk = NULL; + return PTR_ERR(rpmsg->mclk); - rpmsg->dma = devm_clk_get(&pdev->dev, "dma"); + rpmsg->dma = devm_clk_get_optional(&pdev->dev, "dma"); if (IS_ERR(rpmsg->dma)) - rpmsg->dma = NULL; + return PTR_ERR(rpmsg->dma); - rpmsg->pll8k = devm_clk_get(&pdev->dev, "pll8k"); + rpmsg->pll8k = devm_clk_get_optional(&pdev->dev, "pll8k"); if (IS_ERR(rpmsg->pll8k)) - rpmsg->pll8k = NULL; + return PTR_ERR(rpmsg->pll8k); - rpmsg->pll11k = devm_clk_get(&pdev->dev, "pll11k"); + rpmsg->pll11k = devm_clk_get_optional(&pdev->dev, "pll11k"); if (IS_ERR(rpmsg->pll11k)) - rpmsg->pll11k = NULL; + return PTR_ERR(rpmsg->pll11k); platform_set_drvdata(pdev, rpmsg); pm_runtime_enable(&pdev->dev);