From patchwork Fri Sep 27 03:50:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "\(Exiting\) Baolin Wang" X-Patchwork-Id: 174574 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp2954036ill; Thu, 26 Sep 2019 20:51:18 -0700 (PDT) X-Google-Smtp-Source: APXvYqzOpxKUIEW4IXrbpRUiMa7TiVZsNcKb9YvC7zhiHz1teHYOPZITN4DaYdXG5pb8Hg5Pp5fj X-Received: by 2002:a17:906:a990:: with SMTP id jr16mr5902217ejb.281.1569556278529; Thu, 26 Sep 2019 20:51:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569556278; cv=none; d=google.com; s=arc-20160816; b=ddCmmMenpa0ndZX9x6qTaimQmsZOf2Lc7Hhvb3dtIA7p+RmsIF1W/A+Eq5dZzPYvrb rwnKPNv9bYAq7Pd5dbJprUl/uIi79t8FbTrLD70AEkcTvAztUI0UGZyE0hRecSV57agJ aBAbX6XYOfFi9Y/qE6lKtSJfH7/Y1LlGR4RetpyMtKDzyZvKZCD8e5/7jXJ144S5eYR4 tO5BnCQ8Il9ZYq8uqhXOakLu318yNtpg6L6t8kriRaD2mAQcbOqlYKfPufVnvGhF6fUE i5DmGhKwtio/pAQISJRrh/56XV/FXPUCvvLFMQUpGQNJ23MZN9N9sfHTVYhPA55iVJnU Me8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=V9DS/QOwqeJEc++1RGa0/GFPq1bWylLG/sK8PIeSOjM=; b=ZHjW5m/GZNG1pQt/j4aW4Gay9+FkZ1nLpJ0nJsyBozNr+TRbwaXquaiIslbWiu2NkH p2Q++TN+rL1XWbks6sfLPzUB69ej00KEO2mZxeMI2NMRyWGzQRauIdo2TcsvpvgdDyHO lFT6ZPjWFkTo87c3k5f+M5DdMm0sUPgAqRu8jyJoEa/RHW8rRNA6sisdurzSXNnzAspX Clq8Xko7h/7LpRNsCwAW9wBJ35K5H0ZewKyYzdeLVzWXQriZgTMwL2xJWbGBtPBlf724 D1kG3D/Q7N06l/qPQx3+wRlFZs3Pz4/TNJeAATLNOL6Xq8jpMOh3gpDGj7bSX8ZHfh83 VR3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=EFd+uioU; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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. [209.132.180.67]) by mx.google.com with ESMTP id a25si2286909eju.71.2019.09.26.20.51.18; Thu, 26 Sep 2019 20:51:18 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=EFd+uioU; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 S1729126AbfI0DvR (ORCPT + 26 others); Thu, 26 Sep 2019 23:51:17 -0400 Received: from mail-pl1-f195.google.com ([209.85.214.195]:43346 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727505AbfI0DvQ (ORCPT ); Thu, 26 Sep 2019 23:51:16 -0400 Received: by mail-pl1-f195.google.com with SMTP id f21so503668plj.10 for ; Thu, 26 Sep 2019 20:51:16 -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; bh=V9DS/QOwqeJEc++1RGa0/GFPq1bWylLG/sK8PIeSOjM=; b=EFd+uioUEzXYPg/htXgdnnNhmWIF6tsNx2mGdy29mHoJwPkK6SpCy4sMbYc1lcsoha yuA0KRB9ZGpDS79Stj6fUwL39iEAXtDcxHCztSXrK0dKUTZgY72fIy0B3HUUu43XkY+I J1a7FG+2DHFRSzWZ/y8nwusy1Pz1vY4rKUa8uuX73GENBBPGPv1zrhnLgnVfkzi4bcL5 z5OdMy2QOlPRVIWMDM+Gf8ZKDpXAKVj6I+HVXLp6yibpCu3dgVr07X/RgJ34l0+oG5fM kL6gTCTINPcsWvayxAbydV97Olw22mGY4ClTx4JSrqPRAUMlxMP8aCTb4wX8jW38TMit Uj6Q== 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; bh=V9DS/QOwqeJEc++1RGa0/GFPq1bWylLG/sK8PIeSOjM=; b=eot95aQBlzS7laNJwbTp7nQDQwrs46y2ZWRYkSV5r/pNrIDJt7YCo5dlwUTOwfKDQU 2aMR2O2SId+HU5NJXK28qJmW2t1pyMr5ekwP7OhFqzv7Nq3YVQJ0O57Gho7Q7sIgicp/ iMq74UT1+NwIPotV71VziTmh7dqH8UFM1yybHTpZY+iSL+UdEHzwdxezFWhSu3t0u6Ro HXGZx40OeULMXKpEC9QwFGzxvorRtFeeG58jlVpkBqjcxHMymTbZ0aYuZQvQ1pbOm/o8 0mwuojS3mOA5wGfcGg8/qBfH4PESwst0v0bsXduKFxPkvAa4DH/48+MESL8NoC5gQNxx eH3w== X-Gm-Message-State: APjAAAWkdhxDAL8CVTlzsIyeRmjBgViaiobxUt0aE32MI0ccZLPbL+tJ NfurJPkImu4K6R1klMCj5ydbHw== X-Received: by 2002:a17:902:b902:: with SMTP id bf2mr2370343plb.56.1569556275985; Thu, 26 Sep 2019 20:51:15 -0700 (PDT) Received: from baolinwangubtpc.spreadtrum.com ([117.18.48.82]) by smtp.gmail.com with ESMTPSA id n66sm753640pfn.90.2019.09.26.20.51.12 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 26 Sep 2019 20:51:15 -0700 (PDT) From: Baolin Wang To: mturquette@baylibre.com, sboyd@kernel.org Cc: orsonzhai@gmail.com, baolin.wang@linaro.org, zhang.lyra@gmail.com, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/2] clk: sprd: Use IS_ERR() to validate the return value of syscon_regmap_lookup_by_phandle() Date: Fri, 27 Sep 2019 11:50:53 +0800 Message-Id: X-Mailer: git-send-email 1.7.9.5 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The syscon_regmap_lookup_by_phandle() will never return NULL, thus use IS_ERR() to validate the return value instead of IS_ERR_OR_NULL(). Signed-off-by: Baolin Wang --- drivers/clk/sprd/common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 1.7.9.5 diff --git a/drivers/clk/sprd/common.c b/drivers/clk/sprd/common.c index 9d56eac..7ad5ba2 100644 --- a/drivers/clk/sprd/common.c +++ b/drivers/clk/sprd/common.c @@ -46,7 +46,7 @@ int sprd_clk_regmap_init(struct platform_device *pdev, if (of_find_property(node, "sprd,syscon", NULL)) { regmap = syscon_regmap_lookup_by_phandle(node, "sprd,syscon"); - if (IS_ERR_OR_NULL(regmap)) { + if (IS_ERR(regmap)) { pr_err("%s: failed to get syscon regmap\n", __func__); return PTR_ERR(regmap); } From patchwork Fri Sep 27 03:50:54 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "\(Exiting\) Baolin Wang" X-Patchwork-Id: 174575 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp2954109ill; Thu, 26 Sep 2019 20:51:24 -0700 (PDT) X-Google-Smtp-Source: APXvYqx570DBjmx6BBGOsTe/tXQu8+O5I4uY9q+uQxNDmQVGdxd7TNCrDiwgX27PS7t1dXS8gqFT X-Received: by 2002:a05:6402:1ade:: with SMTP id ba30mr2323844edb.304.1569556284233; Thu, 26 Sep 2019 20:51:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569556284; cv=none; d=google.com; s=arc-20160816; b=MK73AMLk2DxU69eSrhvueAfd+WuNJel2RL22fTo516ma/eRWdOyBBhWJyTEW5fbvu7 PmUBxIIvJba90IE9ERBrTAc9WIR4xFiISJPNCLn4evip4VD/TaGw5RRS9b0+Rj52vCHr WcGshONc5jC3c76nhQW+hLoTDKMgY7FPrxEw7OTs1sEiOKME6lUtjgw12zELrtxpQWwY tH/NGfYwT0l+ySuQZzL6mam+fiwn+gQmrpOEnCW0VHssf5/gVf6OXr1skcq6MF3cRJMD JpgrFStg8fwiVF0NUjfdMnhSTKTfR8j9cBuhCO+kKxq+0QlQCD09gs0atzOEbolLK62Y 2Dxw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature; bh=Ro1weBOfHyrfHvVXj42WLEM+jvzuYy/MP2n8jxoh6Sw=; b=qOwBZIQ96XWtR7eCh+SducgmuqbiS4eWyGX46TWdA5raA8NJuW/SGuTr/ZHB+nDQsC OpJeNAKrFNCTEDJi+zpgDR02qoPBAntR3dY8OCkR55ZqyhZhz4prqGpLaG69EElpSGet 5/xPp8ENFpqqdXvwkwiUZ2FK5vySU7nSKMQbN1Qha+K6S3GAln8utydFWc0Aw9HyBs0H a664Lk9kWhKVqzhTN7AgD1O2IF+nHb7j0v7YrkP5PlVZgBtJynw/eoaw1Bn3tn8/ghI7 e9WfcwP5AqGCLCrhm+jsQ+8L9H2QZp8i7kzUmyPWXQtzIyY8GOyHf0fbWjw+rzClNegz 2BNg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=iQjWf6PI; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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. [209.132.180.67]) by mx.google.com with ESMTP id w11si869890edi.442.2019.09.26.20.51.23; Thu, 26 Sep 2019 20:51:24 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=iQjWf6PI; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 S1729140AbfI0DvV (ORCPT + 26 others); Thu, 26 Sep 2019 23:51:21 -0400 Received: from mail-pl1-f193.google.com ([209.85.214.193]:39207 "EHLO mail-pl1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727966AbfI0DvU (ORCPT ); Thu, 26 Sep 2019 23:51:20 -0400 Received: by mail-pl1-f193.google.com with SMTP id s17so509366plp.6 for ; Thu, 26 Sep 2019 20:51:19 -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 :in-reply-to:references; bh=Ro1weBOfHyrfHvVXj42WLEM+jvzuYy/MP2n8jxoh6Sw=; b=iQjWf6PIHd1v1UNoaVAblgCzkNb6Y31PZsclFAtKiEeyxoA/ZBhz42c1wwQb1Uo7sh Dezcpm8sod9AV4JS0qdMpF1LSML8dJx1P80ymBuFtN+p8Z8+FPFsgcKTcETG6EPKoLAm ED5gILcZrLBEy229SySmbmCw1wrkEtEplTuaYZDAi7TYvPkfu2WzOpzNwxs49jGj+9cD j7sLjfC/1lJ7D6z1uPsJ0HuhH5PpcZH3HI9Qk00mmb48QCyu3V3xxStoHzqK4yKnNxIm bGaISZM1api+Tb+gqZw4vOqZHjJ9rIW1ohO1CyODBWK1qF1EhtMtxhAgpQefOrSvlOhR txAA== 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:in-reply-to:references; bh=Ro1weBOfHyrfHvVXj42WLEM+jvzuYy/MP2n8jxoh6Sw=; b=jE53nl75f9AAzN2Zl9XjQi257edWC3cOAm6ZFk4bRJ+sIEM4PDN1iZ10olDtbntOqP ezTIEMJmvG3V6Rs17a89T+rcLYIVtyQQAndjN6nuaBJem9dhaneb1pwxf77fE3o0xFnF XS69ftn+DwfPQ+W7YvwSYbfCWgLK4Vax82h1knkOPuB+43xJvdOETki30QPDOGCZtgH7 76D8sgG0CXJKlkgqwyK49Xvnu0kEwZuGe1ebheZ7+JnBjlSZBm9jkuH0SP/9KZcc19zW GnIUUg8dPE/syV2wrTNoLw4CFI/Xf1OMaqwLaMXCwZ3D2XzAXOV3ZC+boYJKcUu+hxM2 WETw== X-Gm-Message-State: APjAAAVvRriTJhMebSxt61yP1C7vT/JFQji7HyLwF7+n7suQSv2pJ9nb +GDESBoncpy6VvayEbABXQ3d8Q== X-Received: by 2002:a17:902:d887:: with SMTP id b7mr2142145plz.297.1569556279194; Thu, 26 Sep 2019 20:51:19 -0700 (PDT) Received: from baolinwangubtpc.spreadtrum.com ([117.18.48.82]) by smtp.gmail.com with ESMTPSA id n66sm753640pfn.90.2019.09.26.20.51.16 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 26 Sep 2019 20:51:18 -0700 (PDT) From: Baolin Wang To: mturquette@baylibre.com, sboyd@kernel.org Cc: orsonzhai@gmail.com, baolin.wang@linaro.org, zhang.lyra@gmail.com, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/2] clk: sprd: Change to use devm_platform_ioremap_resource() Date: Fri, 27 Sep 2019 11:50:54 +0800 Message-Id: <64121209a05f6e34b70cf00d9303d13e765f8528.1569555841.git.baolin.wang@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use the new helper that wraps the calls to platform_get_resource() and devm_ioremap_resource() together, which can simpify the code. Signed-off-by: Baolin Wang --- drivers/clk/sprd/common.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) -- 1.7.9.5 diff --git a/drivers/clk/sprd/common.c b/drivers/clk/sprd/common.c index 7ad5ba2..c0af477 100644 --- a/drivers/clk/sprd/common.c +++ b/drivers/clk/sprd/common.c @@ -42,7 +42,6 @@ int sprd_clk_regmap_init(struct platform_device *pdev, void __iomem *base; struct device_node *node = pdev->dev.of_node; struct regmap *regmap; - struct resource *res; if (of_find_property(node, "sprd,syscon", NULL)) { regmap = syscon_regmap_lookup_by_phandle(node, "sprd,syscon"); @@ -51,8 +50,7 @@ int sprd_clk_regmap_init(struct platform_device *pdev, return PTR_ERR(regmap); } } else { - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - base = devm_ioremap_resource(&pdev->dev, res); + base = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(base)) return PTR_ERR(base);