From patchwork Thu Aug 20 10:43:53 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 248023 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:522:0:0:0:0 with SMTP id h2csp1233749ils; Thu, 20 Aug 2020 03:45:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx1g3yWKyRg4f/JM/WXxJxn99o8qqxeumDP2lXkPryTiCvHeYIO1di3dz8Lssoc37lL64UX X-Received: by 2002:a50:d74b:: with SMTP id i11mr2377949edj.136.1597920312522; Thu, 20 Aug 2020 03:45:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597920312; cv=none; d=google.com; s=arc-20160816; b=q6NYPA27mFAawlkr4d/oNgnpyUpWdoD9ZMisqn4bV1W1nwfNP8+bak8gpa2JAkAgp0 We6yrAxFaxyMobsQbDW8W3pg26/hXMew4g6b/5Wbo8eBIDZLb/ziKAFb4zmiNUVZZF96 qkVoONcFdPA/lgJycjKd0Qel0yjbfyOPblYuTaqOOkx6qpuiyL1LEBZhxeXTgspa+8Du MYzd8ZjA6h4pWpB/2t9kiqsFU5M52IOOnRcaKKbUHROctUViQcXXGgoEbOHGZCq1bbVD vCr/WBjn3cgdHR/0GSjpdBiRH83Y3q0/+KuBvLdau5QEMqGbrFALYN2iv/yNzkAOoNvC tHGQ== 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=/LOsg+FK0HYq6IcD/yEuwtjKnkS0z9yASmI3zpx6q2A=; b=RT5McKpk87gKF3L7Z6kJRnTmfkaqI560VAtDa/elFCH7LyVBRmjAOmjnMWL+9AvGfP l/jHzeVftuu55kAt5lZr7WPoY8PUPAB7X8UnGSP0hGK/lxYJp2fMV4rD3Lyi1lLOl2p1 5I+O6gsPWTeAAF/mIpGp1aQJ38z9rhfXv4rfwqnXrd5fbYpCgcSmt5MYaPi1AxnIdHrk OcL5IUabMDz0svhFQoGQGPL7OPjItUALWd+vjM0XSYiO3yfqbem762ZjrW3ixAy//hwX yjqjOUuDX+ylvqHhZVihyNi+yHHY18yMdtzENEnICfwGo1Rosv0Gv7J16qTA1cBKP8A/ SAsA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=JeiAOvt7; spf=pass (google.com: domain of linux-pm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-pm-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 zn8si1087475ejb.70.2020.08.20.03.45.12; Thu, 20 Aug 2020 03:45:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-pm-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=JeiAOvt7; spf=pass (google.com: domain of linux-pm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-pm-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 S1731288AbgHTKpJ (ORCPT + 10 others); Thu, 20 Aug 2020 06:45:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40256 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731897AbgHTKoh (ORCPT ); Thu, 20 Aug 2020 06:44:37 -0400 Received: from mail-pg1-x543.google.com (mail-pg1-x543.google.com [IPv6:2607:f8b0:4864:20::543]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 531AFC06134C for ; Thu, 20 Aug 2020 03:44:28 -0700 (PDT) Received: by mail-pg1-x543.google.com with SMTP id h12so934753pgm.7 for ; Thu, 20 Aug 2020 03:44:28 -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=/LOsg+FK0HYq6IcD/yEuwtjKnkS0z9yASmI3zpx6q2A=; b=JeiAOvt7RXm1vLlwduO6b/sWDGxWDZBlfXvUhtmlKqevYviiO5iuW0Dq4Y+IBeBu23 cToB2QPrKFqj/in4w4UJJbI46NRbCYY0NBi26HQdPui2dHUY4uvZZdxkdqn5mWHnhAn3 c4B0UBjRc/mRQJAE/EdSdu30LFedIxlAZSf1wfl0JaHFiB2I9UlGODYczefrXKJzKfe2 7KR6WT4os/o4nI3hewxkOGLjKmws6rfhkf673cbRFsP0xCkGsq94Z87OmSmOu6NB12wl 12gbw2p43q6l4BGM7DbjVf3r/cuyh3l8rJ+mH0f99CygvhowobayxBJxapUZTQa/z1P3 puEQ== 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=/LOsg+FK0HYq6IcD/yEuwtjKnkS0z9yASmI3zpx6q2A=; b=Njxb1OXZIcKG8VhgSjEtETKRZH4avU/JlOxfRUwy0V5biYezmCKVfl2IQyZ1OnYYew ir6P4pVW3ySRZkmEbLVdIIKNI3nKDVVkzD9XJDjaFU38RX8aSyhiaCRLZxIYISSiBYpb uIffTkLuDiFdg5xux1tFpxTOCmBoCTdFK2hLdJ2kmU+Z0PXhogR3k+Dg1TDQJgUBnEH3 t3IVPD7t5GlG5OQ+Uqv/yOa37qnuCT+swcMLkWdfrZ3B+hSHhiv9y+fufVDU2ZKdK/Ib qeg8nfjWWtrV37YdbOj2AAn5NswVzJmR9y6/0IRXBXttM8BEqyfR8mnAZVxYqGVq4RuH Csqg== X-Gm-Message-State: AOAM530QMnqFpnlljCz8mahB1YaVHytSXhZxu54C71rC7dp8Va7jpA/a QNniCg14o4HLLpCJzwHHKjVk6g== X-Received: by 2002:a63:7981:: with SMTP id u123mr1865493pgc.29.1597920267833; Thu, 20 Aug 2020 03:44:27 -0700 (PDT) Received: from localhost ([122.172.43.13]) by smtp.gmail.com with ESMTPSA id 20sm2109640pgz.20.2020.08.20.03.44.26 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 20 Aug 2020 03:44:27 -0700 (PDT) From: Viresh Kumar To: rnayak@codeaurora.org, Andy Gross , Bjorn Andersson , Adrian Hunter , Ulf Hansson Cc: Viresh Kumar , linux-pm@vger.kernel.org, Vincent Guittot , Rafael Wysocki , Stephen Boyd , Nishanth Menon , linux-arm-msm@vger.kernel.org, linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 4/8] mmc: sdhci-msm: Unconditionally call dev_pm_opp_of_remove_table() Date: Thu, 20 Aug 2020 16:13:53 +0530 Message-Id: X-Mailer: git-send-email 2.25.0.rc1.19.g042ed3e048af In-Reply-To: References: MIME-Version: 1.0 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@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. Signed-off-by: Viresh Kumar --- drivers/mmc/host/sdhci-msm.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) -- 2.25.0.rc1.19.g042ed3e048af diff --git a/drivers/mmc/host/sdhci-msm.c b/drivers/mmc/host/sdhci-msm.c index 5a33389037cd..b7e47107a31a 100644 --- a/drivers/mmc/host/sdhci-msm.c +++ b/drivers/mmc/host/sdhci-msm.c @@ -263,7 +263,6 @@ struct sdhci_msm_host { unsigned long clk_rate; struct mmc_host *mmc; struct opp_table *opp_table; - bool has_opp_table; bool use_14lpp_dll_reset; bool tuning_done; bool calibration_done; @@ -2285,9 +2284,7 @@ static int sdhci_msm_probe(struct platform_device *pdev) /* OPP table is optional */ ret = dev_pm_opp_of_add_table(&pdev->dev); - if (!ret) { - msm_host->has_opp_table = true; - } else if (ret != -ENODEV) { + if (ret != -ENODEV) { dev_err(&pdev->dev, "Invalid OPP table in Device tree\n"); goto opp_cleanup; } @@ -2453,8 +2450,7 @@ static int sdhci_msm_probe(struct platform_device *pdev) clk_bulk_disable_unprepare(ARRAY_SIZE(msm_host->bulk_clks), msm_host->bulk_clks); opp_cleanup: - if (msm_host->has_opp_table) - dev_pm_opp_of_remove_table(&pdev->dev); + dev_pm_opp_of_remove_table(&pdev->dev); dev_pm_opp_put_clkname(msm_host->opp_table); bus_clk_disable: if (!IS_ERR(msm_host->bus_clk)) @@ -2474,8 +2470,7 @@ static int sdhci_msm_remove(struct platform_device *pdev) sdhci_remove_host(host, dead); - if (msm_host->has_opp_table) - dev_pm_opp_of_remove_table(&pdev->dev); + dev_pm_opp_of_remove_table(&pdev->dev); dev_pm_opp_put_clkname(msm_host->opp_table); pm_runtime_get_sync(&pdev->dev); pm_runtime_disable(&pdev->dev);