From patchwork Thu Aug 20 10:43:54 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 248024 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:522:0:0:0:0 with SMTP id h2csp1233808ils; Thu, 20 Aug 2020 03:45:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy/rC+iFKETviqTqBHBTAvN5pf+mwldZa9BcCNos0ENpWUW4Dc0WD5EnjjbGvoqmBJj0fks X-Received: by 2002:a17:906:7e06:: with SMTP id e6mr2746447ejr.236.1597920318068; Thu, 20 Aug 2020 03:45:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597920318; cv=none; d=google.com; s=arc-20160816; b=pejT64CjRYHAbp51TaU0E+IaIkG2pnJWWA8XUQvZme6Rr+ZYSU0inuqh5I1haS9BX6 VDIWvbOhhV2LOqgUH6Eehua9HFMY862M6HahKAMO8hT05QKHL0qnJsO/XX2aZ0f31J/R Ca6VDJg2nqX4/HB1OpWcUMjYPuyV8p3YZMk40hFL+M8hFXPHCH4BkXAg3nkOc4MHh8SL zjvwEkmY0da6JugFLrXpp8RXu7KXkJQWO0Knu6FBwlsQWpuaIT1Vb5z+y/TgZUMU4WBH I8kxmjt1Xjjyyo8LC8J9srkenpuR78aZnAhiX4RasY9coxOcIlfKqkZ9yHlXPdw6ssrg hHEg== 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=tBvIIVWSqLOvxm5DPjzeQaBDOBFgxxRxk7Pa8spcF4Y=; b=v4XKWVxLhcc1LZk/OEo4G6ZLbFsSQixZdEy7eyUq2ZfdFPgu8QS8yJhddX1dYbNxSx RcCSmvzvrRszlzauR/TPTUxX3mN46x/CY8SuyYata1YE0WrcPlQLx4tcL+b7gciq+svU pkqFeiwvosa1UdORfCV6WmJ5MZuYPOvGqrJQIh/ie3DL5UF75kn9lP/xrNp0aaamxBLH +QAysPUyeOJrZjsbGVUqSw4Y4GgoEkEIczPojQ7b/cLCR62gprNnUpJUozjaHwa5k/O2 5RNsr4BP84NOnqSXerukl6Il1byvA2mybSW+27OQeG0UnYvlRRPpN0UgHCqNuq5CGMGn i7/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=V874UKRv; spf=pass (google.com: domain of linux-spi-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-spi-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.17; Thu, 20 Aug 2020 03:45:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-spi-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=V874UKRv; spf=pass (google.com: domain of linux-spi-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-spi-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 S1728905AbgHTKpN (ORCPT + 2 others); Thu, 20 Aug 2020 06:45:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40264 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731360AbgHTKoi (ORCPT ); Thu, 20 Aug 2020 06:44:38 -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 539CFC061350 for ; Thu, 20 Aug 2020 03:44:31 -0700 (PDT) Received: by mail-pf1-x444.google.com with SMTP id 17so819066pfw.9 for ; Thu, 20 Aug 2020 03:44:31 -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=tBvIIVWSqLOvxm5DPjzeQaBDOBFgxxRxk7Pa8spcF4Y=; b=V874UKRvNzPN6yCv8qVBDzRdBiJEA270fWjz5BPet8N9PL05DbDPPGSBzOT4Y+iY/1 4d2DG05vPqpn16MzA1A+YMSq8cHlRMPn5JqZL3jVJih72dFB482zLOHksr4wnhik+uif WcXaSkGUZ4nY/8eKsNBikSG/6AXbZcr4EdezbYKrUzTJrY0yYz4d+Bb/FG/cV8ePqrwv dRyqQDFGT8c4oKA3pst29XRQ3/f3sIHW+cL2p7rERY/1sF3+Z6MTCvUuYSRYUwPPsd4+ AcusnBcReAvdqC0EVkWzaOONn61yPgQ5MBD3Nskh3CCbTi80YJwSyWZp2Gs9InhPlcP3 tmyw== 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=tBvIIVWSqLOvxm5DPjzeQaBDOBFgxxRxk7Pa8spcF4Y=; b=qYcsV+NDn4UlXsQNDwBJI9W2B5I5cnXdCMDblqDxAt50XIpapmrzxTkxMakbunid7O DEx35iSyZyeLEzTVHvi0j+hB4MbtoW8k/vu3G4oU0ldE4+7ApvCuX+RxFFgdhemeEOIQ mTlvUYjJBbg7jiCdD+2ZU6v7SpyE97yfKWiDFJZJmGnNi9dEJDLqFOEc67dQfA1Q+YMX d/RyvcwxUhMe7IxScKsgpbzUchWc8vsYXwVEYXIdvo+cm6Dq0eaz/1pi4vLb4YrY/A+s 8d0DzGT5MkWXjqZfvVRjq/vTyC4xUvI9CIgWjMK8ETdBLCkI0gblIKrtIDjCGGW8e2d8 9R1g== X-Gm-Message-State: AOAM531bAjktV+1zpDc9wRmA9c9oFMlngYircEfiq5+kq41yTkJA3N9e 5lGU+nB6m0mTQPGl1BCiTRjQVw== X-Received: by 2002:aa7:9f8a:: with SMTP id z10mr1853318pfr.176.1597920270879; Thu, 20 Aug 2020 03:44:30 -0700 (PDT) Received: from localhost ([122.172.43.13]) by smtp.gmail.com with ESMTPSA id d13sm1862811pjz.3.2020.08.20.03.44.30 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 20 Aug 2020 03:44:30 -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 , linux-arm-msm@vger.kernel.org, linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 5/8] spi: spi-geni-qcom: Unconditionally call dev_pm_opp_of_remove_table() Date: Thu, 20 Aug 2020 16:13:54 +0530 Message-Id: <91321ced21a5bbb98abc24c99e14b7f94f9045c0.1597919647.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.25.0.rc1.19.g042ed3e048af In-Reply-To: References: MIME-Version: 1.0 Sender: linux-spi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@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/spi/spi-geni-qcom.c | 10 +++------- 1 file changed, 3 insertions(+), 7 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..5d3904a0aff8 100644 --- a/drivers/spi/spi-geni-qcom.c +++ b/drivers/spi/spi-geni-qcom.c @@ -613,9 +613,7 @@ 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 != -ENODEV) { dev_err(&pdev->dev, "invalid OPP table in device tree\n"); return ret; } @@ -669,8 +667,7 @@ 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); dev_pm_opp_put_clkname(mas->se.opp_table); return ret; } @@ -685,8 +682,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; }