From patchwork Thu Aug 20 10:43:56 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 248025 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:522:0:0:0:0 with SMTP id h2csp1234124ils; Thu, 20 Aug 2020 03:45:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz53O1jQ82FsQ8ZkNSrC5HcUaoebS0XSQJ7fZIbSbwwH16S2BatojKnh8hk16xEC1HHJTkx X-Received: by 2002:aa7:c0d8:: with SMTP id j24mr2287711edp.338.1597920348644; Thu, 20 Aug 2020 03:45:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597920348; cv=none; d=google.com; s=arc-20160816; b=r+UyiZIKFneISUHlIxUQKxD38dswzGj6X2IpoEcEKZr2FNlay6464u1yBDvVfbW3Pb lcFl/eYlJVbUYRQeUEEJJjSxDYceDqTzDq9M8yv1yNJiiWX09jMxsMuIqPCayqT4W62s +kKGt4/dTg5PmOBbF3nTKlXbLVM1bLd77ASTfb9IyW3na81iV6Uqr4/sJbK2Vqu+Xxjq +65UuzcWRdQBSxK+dwaP2Nf75prxtrydklvC5KMkAgrU8eDsjrJIhZi6y0byKKCgY0HC 320SQ2yFLNSYBv8JfpV4WH6oeB3mb1H4vNKxXiZHw0tU3o80qT7Tbz78HmllX9rv/4H1 K3HQ== 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=Unw7a1Ns/qnZTpkEKrE5+CVHDBMwx2azmJ5ZvPCv2dM=; b=rz81KL845Eb/OK6k5OHCCCg4DcAysBqzenQzBAF3XZcsC50lHsmS53yoAkdD0flXmy x2ERgQ/kq5wjh4+bX+MV43x6QN/i4a6m64zTI+1z7njVDmo4ZjYIwS9pPGsem22EmauN HKYzYL9qsIqXbclpRxZRG+fImZ5LW7mwKEVn2ixCPIPFhfnzE5GIcE0SXRB9tHPA5NLB trvyFpGOAIZ6xj40RzT5tY67XvRLAWd1gZWTmYz7jcwyzFjvuln613LmZLtDH65PdkE7 EkxjwqBq7T6G0hvY0+6c5R5EXeP01Io0mqyrIw/hfmn/iGFWAGSV6InPUShS1gEfaxR9 b27A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=sU8Hrsb4; spf=pass (google.com: domain of linux-serial-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-serial-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 z15si947045eja.112.2020.08.20.03.45.48; Thu, 20 Aug 2020 03:45:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-serial-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=sU8Hrsb4; spf=pass (google.com: domain of linux-serial-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-serial-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 S1728976AbgHTKpq (ORCPT + 2 others); Thu, 20 Aug 2020 06:45:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40308 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731892AbgHTKow (ORCPT ); Thu, 20 Aug 2020 06:44:52 -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 24BB9C061388 for ; Thu, 20 Aug 2020 03:44:37 -0700 (PDT) Received: by mail-pf1-x443.google.com with SMTP id m8so831313pfh.3 for ; Thu, 20 Aug 2020 03:44:37 -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=Unw7a1Ns/qnZTpkEKrE5+CVHDBMwx2azmJ5ZvPCv2dM=; b=sU8Hrsb4MRIfnmL+kicatBveHr6TQM9RoJNr+RAbh93aHXDZrQv9ReuauGVZpjxDNt ASiS4rhFQ/GrsH/okv8NaiVqAUFe0ihnPbuHzsOb15CGUIFTzCojgI3ZAJiQBy2EEqYi GlAbVVpZkoQP1G4AsoljriGSJ5dCA6RwIdVp5h8FwYkner29DM0aMSHjcR0MO3+DkGNu sM7SwLparwQvQQg1fbd7SKH3yXqUxBrZ6CdrCGw+Y4Um8ZyydkwrNL+xFW5rfIf/ZwSm kMTDd8kinv2lcd0GxAr4oqWr00Lz2DZ7gIThbx8asjQE64BdDJJ2YiDiyxRfMCpB5Vb6 YZxw== 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=Unw7a1Ns/qnZTpkEKrE5+CVHDBMwx2azmJ5ZvPCv2dM=; b=ECF0RQPf1SwxQDESsaJzrNhTyigmuc0yOMyTrKHCa5akyFfsoa5S0gavts71HfGehG ot7alDR4qEtRE3NMWEoLkFsVl4xvFW5czPxW99zhWvqbm5PiXsLL0FGuoDTLkHTg3Z7J IBnyorVTfHE1HlAyqO3UYGeG5eAfICTHIHJigXgpLLcoejyjhj33WAB10Ro8iN554WFD u2Z+uyfk7Zz88oc7+PYER/Saei5jx0p6F0ccGRvpAKLvnEBi0l8pcHBCg9c9bvRdFSJN mY8cUhgLMiIFhkWP/7lbxRAZxYPanqxw1dlPH3N4AFQkHHxG7LppCz4tqVfZ28/2bZZ5 vBAA== X-Gm-Message-State: AOAM533aKXizybwcutCeBGFmF2V3aIpefnLeydxAL0LEMbfbuBSOYtyM sB8pp72A2B0C3YbpkyzKvysb+Q== X-Received: by 2002:a62:7c4f:: with SMTP id x76mr1854639pfc.124.1597920276683; Thu, 20 Aug 2020 03:44:36 -0700 (PDT) Received: from localhost ([122.172.43.13]) by smtp.gmail.com with ESMTPSA id a17sm2418743pfk.29.2020.08.20.03.44.35 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 20 Aug 2020 03:44:36 -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 , linux-arm-msm@vger.kernel.org, linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 7/8] tty: serial: qcom_geni_serial: Unconditionally call dev_pm_opp_of_remove_table() Date: Thu, 20 Aug 2020 16:13:56 +0530 Message-Id: <607b871b70f64f5364f5d3dbb3ad2efec7dc55c5.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-serial-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-serial@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/tty/serial/qcom_geni_serial.c | 10 +++------- 1 file changed, 3 insertions(+), 7 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..e4c90a76e6ac 100644 --- a/drivers/tty/serial/qcom_geni_serial.c +++ b/drivers/tty/serial/qcom_geni_serial.c @@ -1433,9 +1433,7 @@ 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 != -ENODEV) { dev_err(&pdev->dev, "invalid OPP table in device tree\n"); return ret; } @@ -1478,8 +1476,7 @@ 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); dev_pm_opp_put_clkname(port->se.opp_table); return ret; } @@ -1489,8 +1486,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);