From patchwork Fri Aug 28 06:07:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 248458 Delivered-To: patch@linaro.org Received: by 2002:a92:5b9c:0:0:0:0:0 with SMTP id c28csp799138ilg; Thu, 27 Aug 2020 23:08:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxG3ivvTJ7S7qiw/ABa8xcbKybvPoAE0qwgvEjoT5avloa1WF4NOop55JxyGV9WVfEQ3KNj X-Received: by 2002:a17:906:3b91:: with SMTP id u17mr163314ejf.305.1598594921496; Thu, 27 Aug 2020 23:08:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598594921; cv=none; d=google.com; s=arc-20160816; b=CDMVfJ9kPCP3c5Px6rjDyOrnxpkCtnnMVNrxRBpUqQPMLlYqx7j5nxiQYjl03qVLr5 vRtblXqneNyhdfeUGYU8gkgdJ/r0qEXvDEdR2NKanDPtTuEfROXqxrORyjo0YJKwMWvF n4lp2wGVkNyVjuKJVnXyDm9KhjRIBsqADo1IRY/wEx6PZ7SazHAnBZH5N3jYeHApN4/+ nuEuHjt0V/R0WiEwymbXcJ82eBwrK7bF9Mn2AfdYVtpaoaGo4YGhyVJGtUgjsGBE+Jaa z+XDxzgxOV7J+YsVp6/zLERoyAv1TLstyZ8oQWNaYC8S7Gt1ByXEjGL5cJp9HEkZ9SX4 aM+w== 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=6WRaTf2Gohs3TLDF3wGUQ9G9N5Tc23L6BtLjYGmLUEU=; b=ibjXbNGDWkA6YVyW7X9BUE+5S85+n17hdeSORjBwuHv8ep0WhAKuZSKY+q/d3kZdoK o0SMKHaSY3XVVIual84v6Gq254VLtJEET0Zyy9oEr7VHCc1DY4TVQfSosz0kPYGWT9FD uer3/exfsvnYMPYmblRFGeYo8A7XiFvjjDGc6pSchpY97TMgw1FvQz5t5ZDQG1UDKlUF 90RKck55pnKslvY4Z87btVsA+FygWo6xXQheMQvPDak77/Okp4Ks4+3cUgzIItOWYCEw R7Wf/gtbUYIPl+Al46TLy8bY/WtSj90VXBbK40pV6SOtfGJURS03oSJ5dQqYPEzUxXxr YdMA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=SrxGfjlS; 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 x14si2943878edv.549.2020.08.27.23.08.41; Thu, 27 Aug 2020 23:08:41 -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=SrxGfjlS; 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 S1728394AbgH1GIh (ORCPT + 10 others); Fri, 28 Aug 2020 02:08:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34554 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728376AbgH1GIg (ORCPT ); Fri, 28 Aug 2020 02:08:36 -0400 Received: from mail-pf1-x443.google.com (mail-pf1-x443.google.com [IPv6:2607:f8b0:4864:20::443]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2F4DFC06123A for ; Thu, 27 Aug 2020 23:08:36 -0700 (PDT) Received: by mail-pf1-x443.google.com with SMTP id m8so124530pfh.3 for ; Thu, 27 Aug 2020 23:08:36 -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=6WRaTf2Gohs3TLDF3wGUQ9G9N5Tc23L6BtLjYGmLUEU=; b=SrxGfjlSHtoZ53w0yyeRWoksRPUDvXuF1tQa3TC5eogwV/wMrojFJRLdBDMb3Ib8mD i7go8otHdJq4x1NpJaeFnV8xSSLxcGZmmVjFfAetnMo50XydrewRQU9KxK/sW22Myw4e tmyNlpYJIspq1QaTaVJ10pL2hyZ8S3nXjPJL8oF8taR7RmxlGBm5zCeVwAbMhSHzUlhd AMES7c2ZwjCskrC9mBKSuFz8eQWRRf1fi1SJEffyVFwIv1IPK4e2+OXNISP0w2pTv4cl HvUScEBmNMhQb1UA8GCjSvkzM+uhJaVzu5MJyPnEKm02E86ci7Zu1uetDtUuEV6VpBz0 MHvQ== 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=6WRaTf2Gohs3TLDF3wGUQ9G9N5Tc23L6BtLjYGmLUEU=; b=n1QaSgEh6fFp32JOffFHj49BPU02BxfnAiEDws88ggVGbKR+BzGKQ3iSamiPAhnGnG B/adu3i0BsKclJNm6UTpcnbMV1VP3B6M8P3+5pLp34slVd9egPBoHv5oL1Q2Exvg7Ptp gXG+p0QaruHuGhc+extwcyM4KXJeZH49ZCm9t4xeCHyhkkyRoGhF6s4fP2qV8OWYINeM 1ItsEv7M5FH9bZ2OeYfsJ7CheMwZWbVcoPtlWSHAlBzjNhIWC7ldxU/9srgRVEXitjNK j9hTd7HMs/bSVJ6PGBPo0SBcDiADDhKd6jclSW64LcoRiJ39YSUl0c0f7BfHqLgSBo8r XXiA== X-Gm-Message-State: AOAM531Sd5BaMeIYgv2hxjgOW4HrHkI1jjhNUB2lwsEEPe0tE1h06F91 umxWOD/BtlpQ233UZgZuzedwwA== X-Received: by 2002:a63:754:: with SMTP id 81mr61971pgh.435.1598594915684; Thu, 27 Aug 2020 23:08:35 -0700 (PDT) Received: from localhost ([122.167.135.199]) by smtp.gmail.com with ESMTPSA id t19sm125832pjy.22.2020.08.27.23.08.34 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 27 Aug 2020 23:08:35 -0700 (PDT) From: Viresh Kumar To: rnayak@codeaurora.org, Andy Gross , Bjorn Andersson , Greg Kroah-Hartman , Jiri Slaby 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-serial@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH V2 7/8] tty: serial: qcom_geni_serial: Unconditionally call dev_pm_opp_of_remove_table() Date: Fri, 28 Aug 2020 11:37:52 +0530 Message-Id: <583003f385a103b4c089ce8144a215c58cfb117a.1598594714.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-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. While at it, create a new label to put clkname on errors. Signed-off-by: Viresh Kumar --- V2: - Compare with -ENODEV only for failures. - Create new label to put clkname. --- drivers/tty/serial/qcom_geni_serial.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) -- 2.25.0.rc1.19.g042ed3e048af diff --git a/drivers/tty/serial/qcom_geni_serial.c b/drivers/tty/serial/qcom_geni_serial.c index 3aa29d201f54..33f1af6c61d1 100644 --- a/drivers/tty/serial/qcom_geni_serial.c +++ b/drivers/tty/serial/qcom_geni_serial.c @@ -1433,11 +1433,9 @@ static int qcom_geni_serial_probe(struct platform_device *pdev) return PTR_ERR(port->se.opp_table); /* OPP table is optional */ ret = dev_pm_opp_of_add_table(&pdev->dev); - if (!ret) { - port->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; } port->private_data.drv = drv; @@ -1478,8 +1476,8 @@ static int qcom_geni_serial_probe(struct platform_device *pdev) return 0; err: - if (port->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(port->se.opp_table); return ret; } @@ -1489,8 +1487,7 @@ static int qcom_geni_serial_remove(struct platform_device *pdev) struct qcom_geni_serial_port *port = platform_get_drvdata(pdev); struct uart_driver *drv = port->private_data.drv; - if (port->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(port->se.opp_table); dev_pm_clear_wake_irq(&pdev->dev); device_init_wakeup(&pdev->dev, false);