From patchwork Tue Oct 8 07:41:38 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: 175464 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp5353576ill; Tue, 8 Oct 2019 00:42:02 -0700 (PDT) X-Google-Smtp-Source: APXvYqwtAoQMkdH61Gd4gk//c+/6YCQJx4NvqPQYX1vgdXXYBU2xCa7XqeFuo0UvdrBAePUDm+SF X-Received: by 2002:a50:d949:: with SMTP id u9mr32571214edj.142.1570520522403; Tue, 08 Oct 2019 00:42:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570520522; cv=none; d=google.com; s=arc-20160816; b=gDDmpq0eK6ubipOt/HJRlY5OmsG2FNGyscPZ9Xqxp8oLZtD9xnhTyBCzz/IKgd2vrS rcrAQ6vOL55fGaLHeAny9zbtXE3kVc1nGmIH6JYiBnoYinabXsyFjXqZGF4n/6ZIGjW7 rQYrYbIoXiIndwtC77NS0HNgybFtDxHQOlZwlgHcWeLbFtcVUv39vwkEiqfJU9ZfKyxl 3aF+YsOA+SNG6umdgo8cBbABmm4MGReujKab56Gitj7TXD+F+X44FjHNU6MGMcclEIpi riVCoObTp1SJr8bNENEiE4DHafYSiwfGItDGl3Pb0OUrhmMKRWtsObHAAX2q9EnKW13j L1bw== 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=WTWm04ar4+VkLYYNXw2JS14xdDugNow5AHMpBwOh98U=; b=Z7zKCi/V5/3rWkr8J900YYNDKLc+S0WdlDxDRWcsy1smiFv2ur0RZ+9aUegZ9uH5ki vxXUdPBwq4D5+azH0E7WLIEawVc9BIfmbM22zocPRV3Gz+Ibsc+W7GDHMUWM6a9A/Cuo H4cx7pkKIpz+4BAqyd5jWnQZczwX3uEci6M4G7dAAVQKobfnBcJbyiztO+eKktyzHCJM xsLChB6aL//3zWxQdparkV0083vVc7XbSBwlVpQtXvZF+FR3v01SiI0NSsYsHQUSMdr4 jUn6yILCbetCrFEEPAi39MYMJUbxO3N9cG6RKABAeeuQfeOQRPQN6Kj4PrA4tIlAPAFO FGQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=kkseK9Vv; 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 q10si10068748eda.293.2019.10.08.00.42.02; Tue, 08 Oct 2019 00:42:02 -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=kkseK9Vv; 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 S1730355AbfJHHl6 (ORCPT + 26 others); Tue, 8 Oct 2019 03:41:58 -0400 Received: from mail-pg1-f194.google.com ([209.85.215.194]:37306 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729740AbfJHHl6 (ORCPT ); Tue, 8 Oct 2019 03:41:58 -0400 Received: by mail-pg1-f194.google.com with SMTP id p1so8021355pgi.4 for ; Tue, 08 Oct 2019 00:41:56 -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=WTWm04ar4+VkLYYNXw2JS14xdDugNow5AHMpBwOh98U=; b=kkseK9Vv/63Pcw3Emd7eqBn53F3b4We5nz6/fDgoQNdiN3fgUkxvOKFHoT2YFXZ4tq yloarZHbOjJV0z8lMzK2iJYo/2s27a19LC/k1SZEAuz6JeeHWY7cXtGGH268aqlI96Cd GPZ9Qp8MBZhZbPHx2EaaIQSLcO52SfdzquSdT67ZUgsfbxg0Y3uMQvG8jCAcPkrqis69 ET6BfuZJl1+S8Z8YxMfqE6TcltUE50uZqna8+CBaJx7a7QCw4Sw1sQi89JfO9fo7YKsq D95B/g8SkqPm8/Fpl+hpPui8bm141HHbMtC5fjXxHsu+w5eYB8X/6k2AMpsPRsu9GrdX aEkA== 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=WTWm04ar4+VkLYYNXw2JS14xdDugNow5AHMpBwOh98U=; b=RzooPJtFo0IuaKlZPNZ5iSC3K2M8kHcI7F5J4wWlU/XvuTbHVxf5Jm7e8XtoucTpFj JoBqw4M2fZktmfh8Hj8MJhWXsJ7HOXtyCax7RhHN7LS0Em3cJL9Rt8h23XALwEHbSKvq ARLSWp/B29G1Pg50DrDyCY4fFhQzTX07kjCCjkLn807JUT59MA5q2oTR51I+TfQvJA+A hw6J4NCu1+M9AyJB3eQNj0JyxwpDv0Zs48ixdxikwoxRyVqevkxrAWnpFqiwKdybiuOt 0RJsT7a6HZU2lKoTCH179YXa2XqdgVSHsRoKzvvnw2+/GvBzTnroswpZQbA0LeCYiP2x 0aUA== X-Gm-Message-State: APjAAAVjXIYNRhMyo7/oRAzPo1gZj/Q0UI7eEQX1z34//r88VU9CHf0l u/TEmKqeGrn1mh99CsrVUs1Gjg== X-Received: by 2002:a63:e54b:: with SMTP id z11mr34734641pgj.226.1570520515806; Tue, 08 Oct 2019 00:41:55 -0700 (PDT) Received: from baolinwangubtpc.spreadtrum.com ([117.18.48.82]) by smtp.gmail.com with ESMTPSA id y8sm18231363pge.21.2019.10.08.00.41.52 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 08 Oct 2019 00:41:54 -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 v2 1/2] clk: sprd: Use IS_ERR() to validate the return value of syscon_regmap_lookup_by_phandle() Date: Tue, 8 Oct 2019 15:41:38 +0800 Message-Id: <1995139bee5248ff3e9d46dc715968f212cfc4cc.1570520268.git.baolin.wang@linaro.org> 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(). Fixes: d41f59fd92f2 ("clk: sprd: Add common infrastructure") Signed-off-by: Baolin Wang --- Changes from v1: - Add fixes tag. --- 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 Tue Oct 8 07:41:39 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: 175465 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp5353584ill; Tue, 8 Oct 2019 00:42:03 -0700 (PDT) X-Google-Smtp-Source: APXvYqyFAD5kfbf366CLjUlVXa5hz2Nik6cLHkmVLp9JPASULjZNa+Qcjs9Rjm5MmyTJMEabB5XY X-Received: by 2002:a17:906:8c8:: with SMTP id o8mr27856886eje.56.1570520522876; Tue, 08 Oct 2019 00:42:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570520522; cv=none; d=google.com; s=arc-20160816; b=CrVN5IStA3yaqYfasPY+1pYlZVNYRvtZLrXqc09UCPLXYkXUq7lH/U0/+FcLsy4dEE hz25Pfq0CL43QAdahHXv2gq6YptmqAszjFG1u7fTJoNQRztw9Ho9XOxyfNQxH2Oh+teU /YAqI46GrPRxoZvpSjb2biCIAFfkM7VkAyH1Am+dhYcE/6y7DTZUq6qQtdXz2YIVgnu8 yjlb4vqzxo1PyHrNSpuVOZ2Ke+9pQr5xadSfEppKWya4UiQ5uaQ1fIj1Q/ujrD0ZxTqV yAx0R4VLx93FlYOAdpHvm3o4p1Q18VMz61ILvIq4qFfl4LL5iTuwhVPxG8fTPMYCYYTH rAdw== 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=2fURBUxy7kUtYmeZp2XZ00W6cQyOn6QtabdpUGQ4D60=; b=xeXga0y1euLJc2L4MWmXO0FPSV0hTKKefVDNMtUUsUo11Tpq4UaoI6Xod8IkEEvwUy 5KKI/+XNT0oBRNFmv+Ox0ndScpywF2gkOyRxPXVq5sWK3TpLbeRkUiMmlZ3UxgCn28mH aapafYI3b0/ntLjd+JKc97S2CEWG30aMWFMmE7yVWZrlUmJi3mjbNYdQoaiG8Rg+kpJX U1JRhtLYHGcHq76sLQSDRPeI8Oe3d80R9Cc2jPHt4ymugcaRnIoC5TmXifEmmXK0PqNU ikSmGtz6uAqUbbRTYTGzOYT8CgUDxN+B/mP3Sxe7pFZ18D0lU6pIcjkd182cPttJ8SIK hq3Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=eN9IOY1D; 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 q10si10068748eda.293.2019.10.08.00.42.02; Tue, 08 Oct 2019 00:42:02 -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=eN9IOY1D; 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 S1730381AbfJHHmB (ORCPT + 26 others); Tue, 8 Oct 2019 03:42:01 -0400 Received: from mail-pl1-f194.google.com ([209.85.214.194]:45004 "EHLO mail-pl1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729740AbfJHHl7 (ORCPT ); Tue, 8 Oct 2019 03:41:59 -0400 Received: by mail-pl1-f194.google.com with SMTP id q15so8082543pll.11 for ; Tue, 08 Oct 2019 00:41:59 -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=2fURBUxy7kUtYmeZp2XZ00W6cQyOn6QtabdpUGQ4D60=; b=eN9IOY1D4JQEhqeD44A6DLSptkIVd9EhQ/T4ofBMp9tMybypG0GD+jceTeEDFwcwV7 pX90ySjQ5ypCgooLkJtxt3hhiI9btIxC2oZWRlJTA/XGY2xE465JEYP/jh6TVRHRbRei +iZFx52+vEmaikMY6Xd65ZTnvtPZZhVEITp09SG76jmRAi9ykhVh54pgk6wweIWH0A6k qZtrJhqn4zf9OSEs3ILwYWXfAdJ/tmC/KKvMP3qhdl5TIfCg2mwvzpbgxFFAB/Rklut/ WC1HZnyvgj4kDwjviC8/NfJEL78LAc/JWbztrIUBvdsL14/6NBJ8/H6YV5r8icot/B+E 9t9Q== 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=2fURBUxy7kUtYmeZp2XZ00W6cQyOn6QtabdpUGQ4D60=; b=cfgoW6/gfZmg9pz1uNy3XBkf3q//F8ivIZm9pEefmQWctYCQCjU/REqGueH361oAAO bhgjkpz6U8/7+/ETbeJzpZCbXXgf4+R6lpiAcP3nqGSw5j2q6u4xp+FFP2kehYkWiBR8 ZfvHVyF2oz/z8OBn/VdVxudwr/Y0loRfoaWIt3z5yLHMCHE7yRC8Kpwx1Oxxuz5yrCvS y7/EKDlbj8LIyS/N3yWfiUn1gIwzbm401MFB/EPUpFyPrNNx0dDw/4XQeypOMwr553eh lRwKgJkvr2K6BnX7/Ah+u+7/Lp7A373qCPi4YjYS2jTXLsUwS5CaYkZKA9tbKCYZegBb AOjA== X-Gm-Message-State: APjAAAWQjUVkWgFJZ16TBSy30QaNT7yIU/JflrCSpDv8i1I29txgCFDK U/J8F/z9moo099lCKcGoJJc2yA== X-Received: by 2002:a17:902:8c8d:: with SMTP id t13mr2644087plo.3.1570520519051; Tue, 08 Oct 2019 00:41:59 -0700 (PDT) Received: from baolinwangubtpc.spreadtrum.com ([117.18.48.82]) by smtp.gmail.com with ESMTPSA id y8sm18231363pge.21.2019.10.08.00.41.56 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 08 Oct 2019 00:41:58 -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 v2 2/2] clk: sprd: Change to use devm_platform_ioremap_resource() Date: Tue, 8 Oct 2019 15:41:39 +0800 Message-Id: <841d26a2adb4bf3b4423f82a41dd3f1346413db6.1570520268.git.baolin.wang@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1995139bee5248ff3e9d46dc715968f212cfc4cc.1570520268.git.baolin.wang@linaro.org> References: <1995139bee5248ff3e9d46dc715968f212cfc4cc.1570520268.git.baolin.wang@linaro.org> In-Reply-To: <1995139bee5248ff3e9d46dc715968f212cfc4cc.1570520268.git.baolin.wang@linaro.org> References: <1995139bee5248ff3e9d46dc715968f212cfc4cc.1570520268.git.baolin.wang@linaro.org> 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 --- Changes from v1: - None. --- 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);