From patchwork Wed May 22 01:15:01 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chunyan Zhang X-Patchwork-Id: 164758 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp250487ili; Tue, 21 May 2019 18:15:43 -0700 (PDT) X-Google-Smtp-Source: APXvYqxGg2HgTqTW6X0IOQ7LN48Xv+oJgOjXcFsYcCUcEwjGMcuZsV5cTo3moKyaEEQdhaeAwRat X-Received: by 2002:a62:1993:: with SMTP id 141mr91505994pfz.97.1558487743817; Tue, 21 May 2019 18:15:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558487743; cv=none; d=google.com; s=arc-20160816; b=nXf1b6H0xPqYV2VCnOgqGXwXOUIdRq81WmCTjte6GIM4gybcwZoX674ZbazQ2csS0z e19Kj1O+08FwHWdUvNjD9aklgRONEUpyI1o3VOED5ia8vCxT79lmIsK2PcEdzW6vHu8J 2VxcQmTLKLOP62UTJZTuFR7Lgim8Yshjvl6+wqttxjijc5aAwMGBNcZztCd5dwjns+Js gfMCAvqz/lKGyXZSDgiZ0duwtcW+nh91DnINgIiUsFokc3fW199iM8MdrtPPzl9pIGAp RmXOWb6zPuqU47xXGLhPj4mNwIE+tHbY6px0C5a/Se4ZvRyPLFaBG0olndB+Hl0xWC+T lZ6Q== 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:message-id:date :subject:cc:to:from:dkim-signature; bh=zgkPEB5XZ9b9X9cOU2xEF1BiqUs2NT/hLhDQBCKndyY=; b=wBVKTV5WMG5uXzUdCBVTxr94ajDWr0f9E71MuyUuXUPglg7kpcBA4W2ZVPv0kOkPWY Q4UbkpXNqjG8Am8gHPy/G7mKhe7V6Sdkrem7SV28VK1Xu1pTnwRb2Wv407bJP5nzNWkZ DVcIS6AR2CjAO9F4U3+mYMLL9UxZ2jREyeqk19ewrwZovW6kvMferHsY0WXVMrPjGE7h yfyoI2bO91x30ZVHbTUgFyp2LtzdsgHYhSqxTOvueqfDAmqGe6Otam76WgRGicQOtaaj 4fPBIU4PWZLPC1Hb6FkOor/9a5Fwa3hF+as73x+2DiZcYXiJvNMS8aIGDXi4Te7oL8Lx ACfA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ICfWIVfa; 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 i5si20664867pfr.52.2019.05.21.18.15.43; Tue, 21 May 2019 18:15:43 -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=ICfWIVfa; 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 S1728198AbfEVBPl (ORCPT + 30 others); Tue, 21 May 2019 21:15:41 -0400 Received: from mail-pf1-f194.google.com ([209.85.210.194]:39461 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727930AbfEVBPl (ORCPT ); Tue, 21 May 2019 21:15:41 -0400 Received: by mail-pf1-f194.google.com with SMTP id z26so376432pfg.6 for ; Tue, 21 May 2019 18:15:41 -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; bh=zgkPEB5XZ9b9X9cOU2xEF1BiqUs2NT/hLhDQBCKndyY=; b=ICfWIVfagetutSTP2wJda5tntZ8oDmNuRYEHtIPXtdZzblw9wcwSioYM0Cl1uKgkyF eJrq8x30tUjUiVJEBeuEd9L85/PFaHhXwWMjpn7vaV1+M+wlxyrehiIS3gi6zDtjpq1L xzg91FyV/tV0HK5AFOt2jNiDTc+/0XPZfAP9f1e24a7tRWBC0fYvNU3NCzvMrvlIQv6L b9nmQy2ntC5zKewyeT1UrrN/oNPxmokx7+8J0II081WOZUXWNLUDrQLiDU2dX6RxQ3h5 UTBsgH9nKnYynRkx4mvTI26Rb00Pt2Guq1VdML4bEstoJaBj06kEcJNeUqHxWP753buF /yxA== 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; bh=zgkPEB5XZ9b9X9cOU2xEF1BiqUs2NT/hLhDQBCKndyY=; b=bEg/mNRVMVyRpkEiMHzEr68dfaDR9lp4YZeXHhy/sVq6BWLEFB1o7o2AwR4DIkx9RC 96KJVItAiIiaSPHFy6o4ugszjU1I2KDrVKwms6yl+DBSzGYHGv7IcGrokRQ1tikjR4lr otaC7/2tgdeW6RaKMQDoudHPj8p8FcI7SwuQy90V5UHBtYIc1MiID5x1dMMF3NN90pHL Gi0dqXJO5M/if0akndi1Sb2fcHk2ENFwXj3ETTmpkhx8nQuM9HqHR8ZRiqDjidVrOcHM EpLISqlmFGD6fv7lK86yyHykViAoIQJDO5iiyCZ//p8FuYqZUJTy7V6wVAnAh7blkssA HYnA== X-Gm-Message-State: APjAAAXyaY8PhclSLYztQ+S9wXOO4GVqXKGmYGQvKp1VIGiaK0pWK14a Jeurr8tFHWvv1CRApHXZXwbTvt5xqkw= X-Received: by 2002:a63:4c54:: with SMTP id m20mr87048720pgl.316.1558487740876; Tue, 21 May 2019 18:15:40 -0700 (PDT) Received: from ubt.spreadtrum.com ([117.18.48.82]) by smtp.gmail.com with ESMTPSA id e184sm31756061pfa.169.2019.05.21.18.15.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 21 May 2019 18:15:40 -0700 (PDT) From: Chunyan Zhang To: Stephen Boyd Cc: linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, Orson Zhai , Chunyan Zhang , Baolin Wang Subject: [PATCH v2 1/3] clk: sprd: Switch from of_iomap() to devm_ioremap_resource() Date: Wed, 22 May 2019 09:15:01 +0800 Message-Id: <20190522011504.19342-2-zhang.chunyan@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190522011504.19342-1-zhang.chunyan@linaro.org> References: <20190522011504.19342-1-zhang.chunyan@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org devm_ioremap_resources() automatically requests resources and devm_ wrappers do better error handling and unmapping of the I/O region when needed, that would make drivers more clean and simple. Signed-off-by: Chunyan Zhang --- drivers/clk/sprd/common.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) -- 2.17.1 Reviewed-by: Baolin Wang diff --git a/drivers/clk/sprd/common.c b/drivers/clk/sprd/common.c index e038b0447206..9ce690999eaa 100644 --- a/drivers/clk/sprd/common.c +++ b/drivers/clk/sprd/common.c @@ -42,6 +42,7 @@ 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"); @@ -50,7 +51,11 @@ int sprd_clk_regmap_init(struct platform_device *pdev, return PTR_ERR(regmap); } } else { - base = of_iomap(node, 0); + res = platform_get_resource(pdev, IORESOURCE_MEM, 0); + base = devm_ioremap_resource(&pdev->dev, res); + if (IS_ERR(base)) + return PTR_ERR(base); + regmap = devm_regmap_init_mmio(&pdev->dev, base, &sprdclk_regmap_config); if (IS_ERR_OR_NULL(regmap)) { From patchwork Wed May 22 01:15:02 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chunyan Zhang X-Patchwork-Id: 164759 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp250632ili; Tue, 21 May 2019 18:15:52 -0700 (PDT) X-Google-Smtp-Source: APXvYqxsJkcqfX7WqAVQP7Xy0x2xQlNfXvV2cOour0qzP+gt7GuhoLIHV5a4lvob/kce9/fY2UCx X-Received: by 2002:a63:d150:: with SMTP id c16mr86378489pgj.439.1558487752498; Tue, 21 May 2019 18:15:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558487752; cv=none; d=google.com; s=arc-20160816; b=g0b4Un/KFcZoQb4p/5J0CrFLeNTbNs24Kl/lAwQvuc45Zq3wlUM5tevl3R3TAw8JCe mQxWNW33MHNUtuQeNikrNKcXawYotqg9p8Gw97XXUzNxZp9nZ2FgztK0qH7gIW3FCj14 qbLFKREUZUcQlCIyeQLba+cvvxbkg3QjWveJXPxQYqn93JDmaB1LQ2/jpBLGMqH2+Y+c L7wjn6owS4qHxzPhdc1m3MWbuKBi3xbOoC0meKmkOtgp2iEKFqS5jWh/kux805u4BcYe Ur80jV2m0QIlPYOUZ+NKkJEPvddy1tT8/aTfGRrYw1aKpgor2LZO1VoeJ+gByQS11QmO Nu8g== 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:message-id:date :subject:cc:to:from:dkim-signature; bh=6fbG5fDEzG6AzVFaygO2qy/CXt0Isxn5KLkAJO5SWss=; b=QDiTHpX+zjbPg+nnBYSXLGI/UH6pMHzdAE1JdSsijwQn8+2AirH1IcsH7QGOzGUSQZ 4AlM8POPm7oCHqgaAnwfXlGdKZ3A2NnwT590ZqKMAqe1ldEx9J3UwIDE+bkj6nuNc+6J czUxIUuHslhv9lFbbh1r4whc/8D8zH8gf3xv+fDYiYgvTIBHX0k3CNTRiSPyEKTcDAVf HiVmmHC9qlp77PcoIWwpBEYSG/oCvc22rAlk87VvYU9faPnU5rbAVC0HkQxyuqo93L/A N6gMzF/8KjIV5N3dM86m+o4MBX1Mi8DP7rAt2o9sKaGU9yB+78mftUytR9TpEaGUWKmq p3/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="jfN/IPbd"; 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 k22si23835121pls.290.2019.05.21.18.15.52; Tue, 21 May 2019 18:15:52 -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="jfN/IPbd"; 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 S1728259AbfEVBPt (ORCPT + 30 others); Tue, 21 May 2019 21:15:49 -0400 Received: from mail-pf1-f195.google.com ([209.85.210.195]:39470 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728207AbfEVBPs (ORCPT ); Tue, 21 May 2019 21:15:48 -0400 Received: by mail-pf1-f195.google.com with SMTP id z26so376573pfg.6 for ; Tue, 21 May 2019 18:15:47 -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; bh=6fbG5fDEzG6AzVFaygO2qy/CXt0Isxn5KLkAJO5SWss=; b=jfN/IPbdiNMb5JRj2CnP/eCgdcf+GAIPN3VeuSPPh8A3Z/LLdTYhT+cSzxiZC5unq3 yZIl3VixybtlbHWsvdnbH922uzO1jUHnvWVjH4WoMf5Nk5C6X0YK8xbiwVkV4I3V2aJR JDqFc4zZoFum0ETZzckdxYA4ywVQmSifOeoHSz9OicminnX2tLgKTK3LSTkClyKWvOJY kAks3r64S0qPczI3NGUDqwbXSehZSaosHHmtgE+rbGmlMcdPfdX8IKr2kL2jGYjFFU+u CHpc7PATBAtA8AMfyylhide8JfBbCzqDn+AnT+Wwgq5PiASu07b5d0gBpPzTiTdOUAOt Pf6w== 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; bh=6fbG5fDEzG6AzVFaygO2qy/CXt0Isxn5KLkAJO5SWss=; b=Hjt/k0waSrlL/zoKyCmahcEd63JxjuhKq5xm85decNluQLwVjVGnlDKyTJuIZgz0v/ CK93tl5n/bjaIfWhkp+swkSrfxRaoFiob78mzV5UnTQ5imNK46nOZx9XyrkLHSwlpwL5 haaCi1D06Yo6/D4xhp1ZT2U95jbrbkfgRI4cSgKDbMZT5LosF4xOZrjLOFVZea5cm0wx SXPF4xqzUVb+K9F3zF/7tMS4r78jc8u4DaB/1bZ+zBqtUCXTM0fWCpnlKRFTabnxfFJb lsXvQpyaOL4qYJAgibRTbWGK7GFyWpgOrfGyvvMIbVVkA6M4XTA3S5iGTz6hx3VgbfAb 0QOg== X-Gm-Message-State: APjAAAV8rKC1sgCoVPPIO2f87cgtvhL+VIywVX+ADFPbfBuybIavxjMF TRLxAMYCY5SuBIIyxEkMaAmiBg== X-Received: by 2002:a63:1f04:: with SMTP id f4mr87297936pgf.423.1558487747679; Tue, 21 May 2019 18:15:47 -0700 (PDT) Received: from ubt.spreadtrum.com ([117.18.48.82]) by smtp.gmail.com with ESMTPSA id e184sm31756061pfa.169.2019.05.21.18.15.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 21 May 2019 18:15:47 -0700 (PDT) From: Chunyan Zhang To: Stephen Boyd Cc: linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, Orson Zhai , Chunyan Zhang , Baolin Wang Subject: [PATCH v2 2/3] clk: sprd: Check error only for devm_regmap_init_mmio() Date: Wed, 22 May 2019 09:15:02 +0800 Message-Id: <20190522011504.19342-3-zhang.chunyan@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190522011504.19342-1-zhang.chunyan@linaro.org> References: <20190522011504.19342-1-zhang.chunyan@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The function devm_regmap_init_mmio() wouldn't return NULL pointer for now, so only need to ensure the return value is not an error code. Signed-off-by: Chunyan Zhang --- drivers/clk/sprd/common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.17.1 Reviewed-by: Baolin Wang diff --git a/drivers/clk/sprd/common.c b/drivers/clk/sprd/common.c index 9ce690999eaa..a5bdca1de5d0 100644 --- a/drivers/clk/sprd/common.c +++ b/drivers/clk/sprd/common.c @@ -58,7 +58,7 @@ int sprd_clk_regmap_init(struct platform_device *pdev, regmap = devm_regmap_init_mmio(&pdev->dev, base, &sprdclk_regmap_config); - if (IS_ERR_OR_NULL(regmap)) { + if (IS_ERR(regmap)) { pr_err("failed to init regmap\n"); return PTR_ERR(regmap); } From patchwork Wed May 22 01:15:03 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chunyan Zhang X-Patchwork-Id: 164760 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp250711ili; Tue, 21 May 2019 18:15:57 -0700 (PDT) X-Google-Smtp-Source: APXvYqzXalET6T6b8qvXFYloJJUht1cNUhuHpCHEIvnVQ2b0Afq0ajbwef1XeeU4Myu87paussKn X-Received: by 2002:aa7:9a8c:: with SMTP id w12mr7434971pfi.187.1558487757554; Tue, 21 May 2019 18:15:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558487757; cv=none; d=google.com; s=arc-20160816; b=sKZQCwXlLkSxs6TR1g424eAPR8IfF9WtUHYe07cPtxLzvnb6E3msHLIOK4sor/9RAh ij6d0deaOTltz8DgAn3IQkktAumgtRdoXBBZxMvSKzjbSKP0VgihObsIICb8x2i7dRxC PvY4FC6mtQASGtv1BdQBAYlQsIdMw22mMlWOIfK31fWiClpz3xDb33Akym2ZEVuWwDnK JGSq7QbC8hhiJvuOkl/lJAsMyBpJrY4TU2sAhBbwbpOfOrJ0+zpmNxkUM1Srjz1E22hY Gf5cE8RVq+y1rT6J7fDISNfgfoeh6zLV0zTx4+DdHtFd+3z02h6sojxUTB1uqDixkuSJ sZhg== 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:message-id:date :subject:cc:to:from:dkim-signature; bh=NTS1odQw+3K/o26m56A8dudsgiFBip3uvfuWtKKFHvU=; b=aE1hWqtX2UwxSZvctna7nw6Hzpl2+c2PERrOPSW2ZruYtdtEl9QDiSFQIuAwK5rk4R 30yUIWFahQDzqODoGiEOyyL1kC19vkhIdtMNk1MhWkJCF/fElPwQJbanvBzw0IbcupCc xpROCNyCIW9XI+WXWWlG1NVkQsYh9G+E0lYKQCNTRzbA117jOF86gKj6F90bf3IA2TFG wqRMf6nRsYSLstZA0GN5ReC2NDPED7gBiPMyCG3fdKdrxPoR4YEGz7N0EUnq8uFcEkZR 1niY13gpGKhzKDB7V1+7wBTIj5OEn9va4ZIEZSyu3HeE4q5iRqxCTtVStsa0C5XJmzjX m8Zw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=B3XhrGin; 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 w62si16737344pgd.467.2019.05.21.18.15.57; Tue, 21 May 2019 18:15:57 -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=B3XhrGin; 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 S1728302AbfEVBPw (ORCPT + 30 others); Tue, 21 May 2019 21:15:52 -0400 Received: from mail-pf1-f193.google.com ([209.85.210.193]:33490 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728207AbfEVBPv (ORCPT ); Tue, 21 May 2019 21:15:51 -0400 Received: by mail-pf1-f193.google.com with SMTP id z28so392462pfk.0 for ; Tue, 21 May 2019 18:15:50 -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; bh=NTS1odQw+3K/o26m56A8dudsgiFBip3uvfuWtKKFHvU=; b=B3XhrGinnvN8sKjWn4ooBhJDwiBZy++xwD3PIwifiEQmGkn9dXEIXn56iDzEoxfVvj buXxk5oR6q/tDHs5OOaUOkRWM1sLkSX4JU0PyfPJCY/0ZHnvNjW+5t6L/klL89CpmkOU RskDCpXRp8Nb0ntd+sjYiNmTwpWddBd2/vc+Qss6vnBNh0rx9yQ1VlRU+ynGuu5CgZL9 riuxQgdodNGLJ7JIcSjyTdkhtNXRSVa4DnyqinGH1zfrS2v3sYsMbbBF1l5tT5dXe7R0 umoIlSFNx9D9SlsIIXLF4fISmz0vBqrgIOvMii2WHcJXQ3fqvIMmHOW5xZARBO3AlqvT jDmA== 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; bh=NTS1odQw+3K/o26m56A8dudsgiFBip3uvfuWtKKFHvU=; b=Nku6EqHXsaLdK9WhO0NCLVG3KwpLzrcZ3pk/engucfBU+HJ+Q/Xu1NB5uhAyn78rPn 82/ja1QwAisNEMYP0j6GrtqhikyrssgHpEneU4upLFYeZ35sp2XuVz1P6tjt3eq3fHtP pQhBpy2dPpgRsT8RuRampoh6mAtfvZ2AAcMwpjkkf88/JpH7LgiQU5DLOd+cm+Hw4Ttn S1y5opn0RH9kcE7z2/4mmFqtfjxeRM7KrThhtYqilqOcezzk417aonQXEI29DWLeAJCB S/glSJ/fsJiSIRPFQN91Pk2ajVwhfPw9PYWpYmwd7VPFsgPhPtwaOglP31H4/bpsFLLo MrqQ== X-Gm-Message-State: APjAAAUiYm1ORY9J+e3SeL7wApQKXD+fnLauSTfLZtsltF32RNK+6cs4 k9xhi8l2+OguQcPeTH0ZZ9CZjQ== X-Received: by 2002:a62:6585:: with SMTP id z127mr52504792pfb.179.1558487750638; Tue, 21 May 2019 18:15:50 -0700 (PDT) Received: from ubt.spreadtrum.com ([117.18.48.82]) by smtp.gmail.com with ESMTPSA id e184sm31756061pfa.169.2019.05.21.18.15.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 21 May 2019 18:15:49 -0700 (PDT) From: Chunyan Zhang To: Stephen Boyd Cc: linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, Orson Zhai , Chunyan Zhang , Baolin Wang Subject: [PATCH v2 3/3] clk: sprd: Add check for return value of sprd_clk_regmap_init() Date: Wed, 22 May 2019 09:15:03 +0800 Message-Id: <20190522011504.19342-4-zhang.chunyan@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190522011504.19342-1-zhang.chunyan@linaro.org> References: <20190522011504.19342-1-zhang.chunyan@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org sprd_clk_regmap_init() doesn't always return success, adding check for its return value should make the code more strong. Signed-off-by: Chunyan Zhang Reviewed-by: Baolin Wang --- drivers/clk/sprd/sc9860-clk.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) -- 2.17.1 diff --git a/drivers/clk/sprd/sc9860-clk.c b/drivers/clk/sprd/sc9860-clk.c index 9980ab55271b..1ed45b4f2fe8 100644 --- a/drivers/clk/sprd/sc9860-clk.c +++ b/drivers/clk/sprd/sc9860-clk.c @@ -2031,7 +2031,9 @@ static int sc9860_clk_probe(struct platform_device *pdev) } desc = match->data; - sprd_clk_regmap_init(pdev, desc); + ret = sprd_clk_regmap_init(pdev, desc); + if (ret) + return ret; return sprd_clk_probe(&pdev->dev, desc->hw_clks); }