From patchwork Fri Aug 28 06:07:50 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 248457 Delivered-To: patch@linaro.org Received: by 2002:a92:5b9c:0:0:0:0:0 with SMTP id c28csp799111ilg; Thu, 27 Aug 2020 23:08:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwNeR9fuK/YY1HSH/LAsSHi6FEZMI6g36v8wNXls2pBDvfYsSIa8d88ERWv8TRQ6gaqI/Sh X-Received: by 2002:a17:906:f107:: with SMTP id gv7mr150174ejb.519.1598594917641; Thu, 27 Aug 2020 23:08:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598594917; cv=none; d=google.com; s=arc-20160816; b=YFfL8Km3g0wD0RScCdVSi/Pen9ug/tp9duQA1ZRxcS59+Dx3zzuwVRqEIoufPFUoNJ gIDztLHIUgfgmPnRaNWPmVROp48PsNBU21O7jjlwldb0jZtfuXnWHU7HbJHFT3jz7C9Y YMNZYhhDoT45ZY3pU9I6cLowx/qr8Ju6kk1WWav0TvEvjKPMK/E/l5XO1orA3AG9wkSh Pe5N0LcxJYFb5gLlHg3gq1xpDrszf9j9/1+lkqTv3UklB2gUCjIzuDUO2AYQzfKzspOd 94IpohRjszNBqR8dGlb7NFldnX4HaRxdq7oSaQk5sdUf76F7hOxiCSYRRrnkwXnXiRbW ayjA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=qLAjxAlrCMxjNqyejiXq+bbcpAkao+Zf6GfSzx0XooU=; b=aIrbBJJnrd+gxcWM6m1Xe87tpB3o6aMr4a985MAC884D2yZgg3keydYpctDJzNSNnC h/xrooyr+MBBHIJiYYv1J3BYJ13z0VfRIJCgrvPuEnU8dyMYdjEmAHkQ7vK894Ty1oOc A/ba2GMrJOz9sKh0m/xQZPLLYfDiWJfHdQXU5pXD4okX8ApjHyLLeAcmE7AoQd+7Wriz CF9ThNyMhJc+C9abTIk40L4dz5Fw2SE6TOcXuFqQjte4f1R/Nnj13ktghgG878emX8xQ Lf0SubYL0oKNLeShlrwN8/2kk//UU4iKzKmUIPgeafUDkA5YF2EdFPcM6rumpwg3kqnJ rlyw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=nswnWFQb; spf=pass (google.com: domain of linux-arm-msm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x14si2943878edv.549.2020.08.27.23.08.37; Thu, 27 Aug 2020 23:08:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-arm-msm-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=@linaro.org header.s=google header.b=nswnWFQb; spf=pass (google.com: domain of linux-arm-msm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728379AbgH1GIg (ORCPT + 15 others); Fri, 28 Aug 2020 02:08:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34532 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728355AbgH1GId (ORCPT ); Fri, 28 Aug 2020 02:08:33 -0400 Received: from mail-pf1-x444.google.com (mail-pf1-x444.google.com [IPv6:2607:f8b0:4864:20::444]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 515CBC061235 for ; Thu, 27 Aug 2020 23:08:30 -0700 (PDT) Received: by mail-pf1-x444.google.com with SMTP id d22so120334pfn.5 for ; Thu, 27 Aug 2020 23:08:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=qLAjxAlrCMxjNqyejiXq+bbcpAkao+Zf6GfSzx0XooU=; b=nswnWFQbby8eZequAZEvYr5Jjuak9S+823ghqqWSTOTx7ja8VvGzt34RFq7Gzj5Abi mqqgRT9USNbs7wAf6cAaSnQZr+w/4wYerRcnbL0oOEWM6hCcY3Vocb/SSmcZPg78yRE6 q75+qzqdofCkOZl0rpSPtLVi0c8EVv9FLOS+Zx6tMtvpWUMnEdb7ZWmLnZgV3ycdstGM r9XQWao1BfH0AB4xtBxP222lSqQy1FDwukTDHWeDDY70cCjFlBWLkUKv4awU1xLUWw3b Dur0w0aqQ2Pmdxn7V2PB6RKn1yWMuRkcK+mf+/9QcVmjV88175vdUHylZ2X32cRE1u8W mR1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=qLAjxAlrCMxjNqyejiXq+bbcpAkao+Zf6GfSzx0XooU=; b=SKG2zBFX3XMCdmnULp0ZPPFZzgn/6/UfLQKBMo4THW5+v42VfEmCrb1oiYPXb/tjGD VR50L1UkAyt8ltxrvDn3qouG5P+b+8hV2WklbtqFREoA8lvqqJS6/Tu1z5nC7xYyIjnV i+5oOnfQr0KJARePAGrjYxhxX3Na+Lx0HRWJQuORgckfisbUElpvua67yDo5sUcTgf60 RHYShUTJmVE6V5CQlpObsC0jLGG6SvF2bzDtvy3FinfpNGAXOUVT0B9ek6E8pDe6DJET sQAx51HGH5cpx7WePKN8cRo/zojxB7nmX8qfNuPPScXgbocdb2lBjKfj4IjIfR6USBmx bHdg== X-Gm-Message-State: AOAM530BgNgO9s5aYgdiu2CusmOu6H0i+D/GHumz21HqmmxZus53Ma5i vrEeHBdQnSd0zaSWLv4nT01X4A== X-Received: by 2002:a63:1d5c:: with SMTP id d28mr96622pgm.82.1598594909878; Thu, 27 Aug 2020 23:08:29 -0700 (PDT) Received: from localhost ([122.167.135.199]) by smtp.gmail.com with ESMTPSA id cv3sm92193pjb.45.2020.08.27.23.08.28 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 27 Aug 2020 23:08:29 -0700 (PDT) From: Viresh Kumar To: rnayak@codeaurora.org, Andy Gross , Bjorn Andersson , Mark Brown Cc: Viresh Kumar , linux-pm@vger.kernel.org, Vincent Guittot , Rafael Wysocki , Stephen Boyd , Nishanth Menon , Douglas Anderson , Naresh Kamboju , linux-arm-msm@vger.kernel.org, linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH V2 5/8] spi: spi-geni-qcom: Unconditionally call dev_pm_opp_of_remove_table() Date: Fri, 28 Aug 2020 11:37:50 +0530 Message-Id: X-Mailer: git-send-email 2.25.0.rc1.19.g042ed3e048af In-Reply-To: References: MIME-Version: 1.0 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org dev_pm_opp_of_remove_table() doesn't report any errors when it fails to find the OPP table with error -ENODEV (i.e. OPP table not present for the device). And we can call dev_pm_opp_of_remove_table() unconditionally here. While at it, create a new label and put clkname on errors. Signed-off-by: Viresh Kumar --- V2: - Compare with -ENODEV only for failures. - Create new label to put clkname. --- drivers/spi/spi-geni-qcom.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) -- 2.25.0.rc1.19.g042ed3e048af diff --git a/drivers/spi/spi-geni-qcom.c b/drivers/spi/spi-geni-qcom.c index 80cea5cd3612..0dc3f4c55b0b 100644 --- a/drivers/spi/spi-geni-qcom.c +++ b/drivers/spi/spi-geni-qcom.c @@ -613,11 +613,9 @@ static int spi_geni_probe(struct platform_device *pdev) return PTR_ERR(mas->se.opp_table); /* OPP table is optional */ ret = dev_pm_opp_of_add_table(&pdev->dev); - if (!ret) { - mas->se.has_opp_table = true; - } else if (ret != -ENODEV) { + if (ret && ret != -ENODEV) { dev_err(&pdev->dev, "invalid OPP table in device tree\n"); - return ret; + goto put_clkname; } spi->bus_num = -1; @@ -669,8 +667,8 @@ static int spi_geni_probe(struct platform_device *pdev) spi_geni_probe_runtime_disable: pm_runtime_disable(dev); spi_master_put(spi); - if (mas->se.has_opp_table) - dev_pm_opp_of_remove_table(&pdev->dev); + dev_pm_opp_of_remove_table(&pdev->dev); +put_clkname: dev_pm_opp_put_clkname(mas->se.opp_table); return ret; } @@ -685,8 +683,7 @@ static int spi_geni_remove(struct platform_device *pdev) free_irq(mas->irq, spi); pm_runtime_disable(&pdev->dev); - if (mas->se.has_opp_table) - dev_pm_opp_of_remove_table(&pdev->dev); + dev_pm_opp_of_remove_table(&pdev->dev); dev_pm_opp_put_clkname(mas->se.opp_table); return 0; }