From patchwork Fri Sep 27 08:27:41 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: 11164073 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 897AD924 for ; Fri, 27 Sep 2019 08:28:30 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4B2F2217D9 for ; Fri, 27 Sep 2019 08:28:30 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="cvcKvS9c"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="rpICZtHU" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4B2F2217D9 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=UlFy3udGy7tDl+nciqZfwmHhwO0uU8DyLUn03XzdgAk=; b=cvcKvS9c2rVyfPuiPmpd4020qv 0eC44WljJQXAklU2NivWJsyLrAjRkPFczdkYdQ5cbghyKrRl5DMMfhHUWJYGkYMajal0vV4EnGg04 RoD3vw2KnoHCFba7X1zVg3f+Tr9ptmKt/7+hUcA+Kt9VuC+TnWt4vmsCyw12yIKJOxEcz7bFvvHZf Djap32tSjA0Xe2fzXt0x5awRZzuDwrmXmPAqyaKer36Ymtwo6xGV6ru7IDAL67H0gmf8yT36sijiN 1T9SXv2VYu7L43z2HrU0JkA0DoI0OYudXQNNGovWNde+2dyC4b21ekzAO7pPzmfJorGBErDtk3Xr/ 61eTBs+w==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.2 #3 (Red Hat Linux)) id 1iDlc5-00083p-2P; Fri, 27 Sep 2019 08:28:29 +0000 Received: from mail-pl1-x644.google.com ([2607:f8b0:4864:20::644]) by bombadil.infradead.org with esmtps (Exim 4.92.2 #3 (Red Hat Linux)) id 1iDlbl-0007n0-JW for linux-arm-kernel@lists.infradead.org; Fri, 27 Sep 2019 08:28:10 +0000 Received: by mail-pl1-x644.google.com with SMTP id k7so796098pll.1 for ; Fri, 27 Sep 2019 01:28:09 -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=kup3jsm2T4Dp1CMpcneLGkz+TmvPB+cIre+Bt8N3oes=; b=rpICZtHUVuixBVO9d63gc3dXlVxb5YYThUJCocG9ApQJYbNo/LxFKtQU5BHzYCzDwc wCoL5g5ttpMFs/gbhX3z9ojugOa2fWlQFa7Rd0LuJWQlT+IQe4lH4qxsWUOIMVSwqUXT uTT4JjV0ZBtr/GFzstQh90Zi5rpxlUijH+SZbUin3I289fbhcDde8eQaG1MamGu5F0NA wl2mgKMeTLY+dmDZmccS56NY/VpJT6knhUULKFmcsBQ6XqF6r8Wdez3brkUpGhmQgTpU HxHA3lwnbreMfHFCPN3M+6mSIcAEFwH/l6t4MELLMgZMOTXY+TMC3qRQLibaDWs44W2H c71w== 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=kup3jsm2T4Dp1CMpcneLGkz+TmvPB+cIre+Bt8N3oes=; b=BVAADbpSP3xy7tdV+71+j0AZ83rCKWb1ZmF/uoUa7YA3MMVbRKPkhg9Q20CBkzorzB oZPsG6GcLg9XL/ukCH9z/qPwJnk3WrwGpfK2O6HNxtaNJ1MfRGzqEAvYt1N9wBO/in9F lRy+8pUAlH+612uK8Yv7K3UHaa7Hd0N7n/u9LC08xuFlGW2afmm9Sz0JJMSVJwWd+3kY O5fRgUYFAvOIsMFP8y3VZcTtrS/vso3RAjFCQ14UxJC0pT6HTwik2sa6dzuLAWRUpk47 HJNyTehzP5XH4qM7on1L15rzuyMUn00Fpndj/YzezFBMnRwTdk7forfyf2thFvDiArxy 20TQ== X-Gm-Message-State: APjAAAWPjPE41gsCWCmn57KWPgaT55lnXRpI6KBT455BPwoAY9+xt5SK YhOp48vJj/esQQkBJijuWCcbow== X-Google-Smtp-Source: APXvYqwYq8FcmeV1WLMy2kTsH58CPZftMErROYm+5CSFzop11lr8v6sNzDkPXayoOGA7AOSxCrihcQ== X-Received: by 2002:a17:902:a985:: with SMTP id bh5mr3242251plb.107.1569572889229; Fri, 27 Sep 2019 01:28:09 -0700 (PDT) Received: from baolinwangubtpc.spreadtrum.com ([117.18.48.82]) by smtp.gmail.com with ESMTPSA id 6sm2043521pfa.162.2019.09.27.01.28.06 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 27 Sep 2019 01:28:08 -0700 (PDT) From: Baolin Wang To: linus.walleij@linaro.org, ohad@wizery.com, bjorn.andersson@linaro.org Subject: [PATCH 1/3] hwspinlock: u8500_hsem: Change to use devm_platform_ioremap_resource() Date: Fri, 27 Sep 2019 16:27:41 +0800 Message-Id: X-Mailer: git-send-email 1.7.9.5 In-Reply-To: References: In-Reply-To: References: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190927_012809_637746_B46B8B21 X-CRM114-Status: GOOD ( 12.41 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:644 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, baolin.wang@linaro.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.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 Reviewed-by: Linus Walleij --- drivers/hwspinlock/u8500_hsem.c | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/drivers/hwspinlock/u8500_hsem.c b/drivers/hwspinlock/u8500_hsem.c index 572ca79..c247a87 100644 --- a/drivers/hwspinlock/u8500_hsem.c +++ b/drivers/hwspinlock/u8500_hsem.c @@ -88,7 +88,6 @@ static int u8500_hsem_probe(struct platform_device *pdev) struct hwspinlock_pdata *pdata = pdev->dev.platform_data; struct hwspinlock_device *bank; struct hwspinlock *hwlock; - struct resource *res; void __iomem *io_base; int i, ret, num_locks = U8500_MAX_SEMAPHORE; ulong val; @@ -96,13 +95,9 @@ static int u8500_hsem_probe(struct platform_device *pdev) if (!pdata) return -ENODEV; - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - if (!res) - return -ENODEV; - - io_base = ioremap(res->start, resource_size(res)); - if (!io_base) - return -ENOMEM; + io_base = devm_platform_ioremap_resource(pdev, 0); + if (IS_ERR(io_base)) + return PTR_ERR(io_base); /* make sure protocol 1 is selected */ val = readl(io_base + HSEM_CTRL_REG); @@ -112,10 +107,8 @@ static int u8500_hsem_probe(struct platform_device *pdev) writel(0xFFFF, io_base + HSEM_ICRALL); bank = kzalloc(struct_size(bank, lock, num_locks), GFP_KERNEL); - if (!bank) { - ret = -ENOMEM; - goto iounmap_base; - } + if (!bank) + return -ENOMEM; platform_set_drvdata(pdev, bank); @@ -135,8 +128,6 @@ static int u8500_hsem_probe(struct platform_device *pdev) reg_fail: pm_runtime_disable(&pdev->dev); kfree(bank); -iounmap_base: - iounmap(io_base); return ret; } @@ -156,7 +147,6 @@ static int u8500_hsem_remove(struct platform_device *pdev) } pm_runtime_disable(&pdev->dev); - iounmap(io_base); kfree(bank); return 0; From patchwork Fri Sep 27 08:27:42 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: 11164077 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CAF99924 for ; Fri, 27 Sep 2019 08:29:01 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7F82C2146E for ; Fri, 27 Sep 2019 08:29:01 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="c/eKKGzf"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="S02hsAii" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7F82C2146E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=qkyqwmGKktV0DanKC8USzZwjOhKWGXrDzR+XMvvySts=; b=c/eKKGzfDySSELZSwpngYFstTr yOf2HPII/u+ONPlzItAC6xdBmS7jo2UfiSzi4Ezy4aUIwmn5QEogVFXT6WENhzXN0LPke/dIUZLKv PmkHiFaBxwJKGH2e+HIJahjU38TnZHVQonFK0hPas8rd5tV3U11Y21gQywzwq5GNyMZ5XSNI95CvN XaPXgm8bfjfVa4MO6+o1/cw5pJjzAwBaQSq4vgFLEIUk8rRdG0WYoFVmi9qJNgLW0bsmfl5lKwXfK I2y7mTO78+uT/Oi7sRkw570wLq1lkMwNWsJEqrG1iXZjr/eeEC5UuaLYCadiooyM8GXB0yRP8nGYe POIcyuuw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.2 #3 (Red Hat Linux)) id 1iDlca-00005n-Pv; Fri, 27 Sep 2019 08:29:00 +0000 Received: from mail-pl1-x643.google.com ([2607:f8b0:4864:20::643]) by bombadil.infradead.org with esmtps (Exim 4.92.2 #3 (Red Hat Linux)) id 1iDlbp-0007pl-4X for linux-arm-kernel@lists.infradead.org; Fri, 27 Sep 2019 08:28:14 +0000 Received: by mail-pl1-x643.google.com with SMTP id t10so783836plr.8 for ; Fri, 27 Sep 2019 01:28:12 -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=vfYzArXzFe1wH00PAKP88fvUR7yXk6kDogWfZQY7lTA=; b=S02hsAiiBDCmqzupGtJrjHkn9YV7Qk3fVrnsTFaEf6sC720aQY4Ev4M3phUHhoyUXI MhS3KIWNqIFoSEZ9lich9pbh8HtVr4OLUMuElnij8iezvsPEczpf/K0iQkU8Rp0xhYh5 81WPorMjBDzY30Bgf2aP14iEX6X+yCxfFuQETJoCQMyMEbl4b3XtP3NLTTHhC03+22H4 NXavZm7TMJ78BSG5rSUAA9EKWUY6hxC9cPrjWoPmOyhYiKrgNYMQlfMV5DdZ9LAXPJvi 9uuwzaRwlXD7Hc6rxLtLbGrzvMXmk+xrHc2BnfMn4hsODscVzEOaYAN5Q8di/h0WpLop LHEQ== 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=vfYzArXzFe1wH00PAKP88fvUR7yXk6kDogWfZQY7lTA=; b=NU8cTfwrKJ03OqhiYIzFCrKe3dYpNb6Gq8EA7GJOh0bJQp47Fozqo/EVW/WRUvSflI 9BtUZKgk6bi04cbiQ+3W9ROstg4IPFSH45x5MBOER5mgARxiiCNz6kJqYBds89hTYmg+ HJiHVt4SRokcOcIFk7WCWBom0ZI4AbeLEfK359829OOVsIh4qJF8wblGB9JUfSNQXpLT YW4qWLxn1I/PKzBIbgJdNZ4Ltomd1k9tBDdLfeitaUAY8NHXX2jiyBcIY/xyRkQ5A9pS PB5qXj9Dzah+i8NR5z1jQ7YpnT3QuulzMqUFgPpPj/4htRGqkAydwdv7w31N68SXR5Wp 1ANA== X-Gm-Message-State: APjAAAXnzO7aBrZlnzoxmmFVYDdmFCbirpyL3PLL6NwX76DKl0A+Tvp9 tdgMstlDzqfcKNfWrHrO1W0r+g== X-Google-Smtp-Source: APXvYqzTTbG4XtC1vheXlXVAQTNIpBRl5TtuDzwjqAF7pQc9jQXpsZT8WzIoHznXHiEs80l7njW88w== X-Received: by 2002:a17:902:820f:: with SMTP id x15mr3101252pln.230.1569572892248; Fri, 27 Sep 2019 01:28:12 -0700 (PDT) Received: from baolinwangubtpc.spreadtrum.com ([117.18.48.82]) by smtp.gmail.com with ESMTPSA id 6sm2043521pfa.162.2019.09.27.01.28.09 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 27 Sep 2019 01:28:11 -0700 (PDT) From: Baolin Wang To: linus.walleij@linaro.org, ohad@wizery.com, bjorn.andersson@linaro.org Subject: [PATCH 2/3] hwspinlock: u8500_hsem: Use devm_kzalloc() to allocate memory Date: Fri, 27 Sep 2019 16:27:42 +0800 Message-Id: X-Mailer: git-send-email 1.7.9.5 In-Reply-To: References: In-Reply-To: References: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190927_012813_240160_86C59195 X-CRM114-Status: GOOD ( 12.02 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:643 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, baolin.wang@linaro.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Use devm_kzalloc() to allocate memory. Signed-off-by: Baolin Wang Reviewed-by: Linus Walleij --- drivers/hwspinlock/u8500_hsem.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/drivers/hwspinlock/u8500_hsem.c b/drivers/hwspinlock/u8500_hsem.c index c247a87..0e8d4ff 100644 --- a/drivers/hwspinlock/u8500_hsem.c +++ b/drivers/hwspinlock/u8500_hsem.c @@ -106,7 +106,8 @@ static int u8500_hsem_probe(struct platform_device *pdev) /* clear all interrupts */ writel(0xFFFF, io_base + HSEM_ICRALL); - bank = kzalloc(struct_size(bank, lock, num_locks), GFP_KERNEL); + bank = devm_kzalloc(&pdev->dev, struct_size(bank, lock, num_locks), + GFP_KERNEL); if (!bank) return -ENOMEM; @@ -120,15 +121,12 @@ static int u8500_hsem_probe(struct platform_device *pdev) ret = hwspin_lock_register(bank, &pdev->dev, &u8500_hwspinlock_ops, pdata->base_id, num_locks); - if (ret) - goto reg_fail; + if (ret) { + pm_runtime_disable(&pdev->dev); + return ret; + } return 0; - -reg_fail: - pm_runtime_disable(&pdev->dev); - kfree(bank); - return ret; } static int u8500_hsem_remove(struct platform_device *pdev) @@ -147,7 +145,6 @@ static int u8500_hsem_remove(struct platform_device *pdev) } pm_runtime_disable(&pdev->dev); - kfree(bank); return 0; } From patchwork Fri Sep 27 08:27:43 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: 11164075 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D59ED13B1 for ; Fri, 27 Sep 2019 08:28:49 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B35E8217D9 for ; Fri, 27 Sep 2019 08:28:49 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="dlBaNuZx"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="g9A2VhoK" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B35E8217D9 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=u1I/genQF7CdN2YAK025u/1e9Rnpn2YFXerLSNRImvk=; b=dlBaNuZxwCVtgcUe+M5J2Gc8ex dCP1jaGgWFsvvf6EIUutfBjpI5bzTiFJMnvnAgKI2SdIpIcE72TNs/tAL/FezrdLtA/bO9a0fmySM RE9cfn7sDVP/DOheLeqQOADsrzhdp4P90FyFz1QZDYpJU9dgfNAPGg081xVmURxQNjc+ZLgQZgAnL tuiw2ieo1cHN9y4fz1CKvE7kJH7OJvz/czt/ofzh10WoT6ryjUfh7DrfwbNoj6sP0KiQKzrivADry OU9z59d7oqsWgG9Wg2Z7lz+VosBiS2dTzjkqQe474PkllXq25z3AgGFHoccp2NHV5DThRGPJtNYVK 2S7E9RTA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.2 #3 (Red Hat Linux)) id 1iDlcM-0008IP-IE; Fri, 27 Sep 2019 08:28:46 +0000 Received: from mail-pl1-x643.google.com ([2607:f8b0:4864:20::643]) by bombadil.infradead.org with esmtps (Exim 4.92.2 #3 (Red Hat Linux)) id 1iDlbs-0007tA-CT for linux-arm-kernel@lists.infradead.org; Fri, 27 Sep 2019 08:28:17 +0000 Received: by mail-pl1-x643.google.com with SMTP id q15so780682pll.11 for ; Fri, 27 Sep 2019 01:28: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:in-reply-to:references :in-reply-to:references; bh=nZvAywOUGdc+nGEJgKwNfZF/qVh73K5ZWBaGt6yR3wY=; b=g9A2VhoKoQRJQ8A/yxKiLRnba6H4pummdVWULOO9J5NHWXt5KisX96YWWyo1QvzxPp UpeqQbf4GpP1ehd/+rQcixZniIXYm0qCyx8tAhvNGMt0HWYdpt458yK1U/fA4F/3DGHM MK7AS60vGn54vJKXzjidUoX6MaIA/acYx5Ya8Z92bH0isTldnqytXSrSDm9imHmGX8jh L3tAvsTKvYHO8gQ6Zz3FnkS5FHWMEDWed+eScwvqYi6KPhlzIpSrcK1RumZRNOyPp9FY TyCty9tp9SwH+sJMcYKdKFs67f6yoEWcBjY7w0R4WgDjpkljQ801OL58ghqXXr2jcebj mOEw== 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=nZvAywOUGdc+nGEJgKwNfZF/qVh73K5ZWBaGt6yR3wY=; b=Ii1NvMhHE0EDe3M6zix/RqRssfR2BWMwzLssM/FnkE8AE11B+SpiVBgPy7zlCuux15 VvbfTjt1Evuo5rVX4wMr/dqQHg0+KcILhz7RN1BLaajNMUpIJXQoQON0N78bhF2/e104 NCn5ov68ce/2BMmjuiq0VKD9sL+wlU/96jbhO2sSVLP9NtZrtidj3oSEloKAOOnpLyWh 9pdd6muUBize3aky8TQ7WDxNTiLZ5zCO52oazaNWQYiijgnmParPpNspJ9ppEX5lm32o HB0ZF9qlFo6d1E/DSo7nFvSPed5rszbbGFEGEz6eVXniLKggWj3MLlIJhuRagQrA96OO zrUQ== X-Gm-Message-State: APjAAAUBc67R8G15leeroYpDL2OiRN1JBjsxXiqEB7loKE7Sj81r2Dlc odZAH/CbWXqZEyGdOJs/GmbX/g== X-Google-Smtp-Source: APXvYqxYsH15T/gDxZi0i3gJliAlf/e2oUvzKKDi12hmwme2MB2Wn3J+nY/EfRcajagLVlzVyg9RuQ== X-Received: by 2002:a17:902:b20a:: with SMTP id t10mr3218500plr.277.1569572895591; Fri, 27 Sep 2019 01:28:15 -0700 (PDT) Received: from baolinwangubtpc.spreadtrum.com ([117.18.48.82]) by smtp.gmail.com with ESMTPSA id 6sm2043521pfa.162.2019.09.27.01.28.12 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 27 Sep 2019 01:28:14 -0700 (PDT) From: Baolin Wang To: linus.walleij@linaro.org, ohad@wizery.com, bjorn.andersson@linaro.org Subject: [PATCH 3/3] hwspinlock: u8500_hsem: Use devm_hwspin_lock_register() to register hwlock controller Date: Fri, 27 Sep 2019 16:27:43 +0800 Message-Id: X-Mailer: git-send-email 1.7.9.5 In-Reply-To: References: In-Reply-To: References: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190927_012816_467954_A83A8F69 X-CRM114-Status: GOOD ( 11.90 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:643 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, baolin.wang@linaro.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Use devm_hwspin_lock_register() to register the hwlock controller instead of unregistering the hwlock controller explicitly when removing the device. Signed-off-by: Baolin Wang Reviewed-by: Linus Walleij --- drivers/hwspinlock/u8500_hsem.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/drivers/hwspinlock/u8500_hsem.c b/drivers/hwspinlock/u8500_hsem.c index 0e8d4ff..b31141a 100644 --- a/drivers/hwspinlock/u8500_hsem.c +++ b/drivers/hwspinlock/u8500_hsem.c @@ -119,8 +119,8 @@ static int u8500_hsem_probe(struct platform_device *pdev) /* no pm needed for HSem but required to comply with hwspilock core */ pm_runtime_enable(&pdev->dev); - ret = hwspin_lock_register(bank, &pdev->dev, &u8500_hwspinlock_ops, - pdata->base_id, num_locks); + ret = devm_hwspin_lock_register(&pdev->dev, bank, &u8500_hwspinlock_ops, + pdata->base_id, num_locks); if (ret) { pm_runtime_disable(&pdev->dev); return ret; @@ -133,17 +133,10 @@ static int u8500_hsem_remove(struct platform_device *pdev) { struct hwspinlock_device *bank = platform_get_drvdata(pdev); void __iomem *io_base = bank->lock[0].priv - HSEM_REGISTER_OFFSET; - int ret; /* clear all interrupts */ writel(0xFFFF, io_base + HSEM_ICRALL); - ret = hwspin_lock_unregister(bank); - if (ret) { - dev_err(&pdev->dev, "%s failed: %d\n", __func__, ret); - return ret; - } - pm_runtime_disable(&pdev->dev); return 0;