From patchwork Fri Sep 27 07:10:44 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: 11163985 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 5F3B517EE for ; Fri, 27 Sep 2019 07:11:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3E702207FF for ; Fri, 27 Sep 2019 07:11:15 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="fGAQuYaU" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726380AbfI0HLP (ORCPT ); Fri, 27 Sep 2019 03:11:15 -0400 Received: from mail-pg1-f196.google.com ([209.85.215.196]:33176 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725812AbfI0HLO (ORCPT ); Fri, 27 Sep 2019 03:11:14 -0400 Received: by mail-pg1-f196.google.com with SMTP id i30so2995989pgl.0 for ; Fri, 27 Sep 2019 00:11:14 -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=v4CYbDgI+ZExVL7Ey3SHDVJYdquQ6nNneks9sNV/1zM=; b=fGAQuYaUuJS0onXta9DcP5iWkDlCdRyhW6e05Srzg1F77NNnN1B8+yp3U3Ne3I2eke 3VznwdYIPtImlztVmwSxvWqx0oVEZ9/fik0CGbbk7JzqXeuS0/aJRlseVEL9V38qbbgr hI7W36dxeFE5xEkU74/b9n1KW+FHDOsMtcCv9vBKX7SWKSQsFd/pJzb0S6bPJ7Jko5Ke F+S+yrbazWCAk2was1TAONqtYf3BZ2Y10J+z2iUDT8FfzKv6D4lyXuVCDlRDkN65qUBi yHFTJpHRHShe2hjBe+uLONkIhf/yP2V2Eequ5BmO+hyexkwSQd22M6KtsRzI7ehL6PQQ ZmnA== 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=v4CYbDgI+ZExVL7Ey3SHDVJYdquQ6nNneks9sNV/1zM=; b=cySrifeaRWfMsSSVcTYme+sOtFjULDlIvdQQZkcvznltq2AGxKKBO0UK6fJRX3rGl3 o3fi2WT3WcTR130HPBx28Uw9d8fi7ivlyw2jIz35G65Ft5+Hs8dXy+jtOGenS07bzf8H 8qEmgggOXrfIi9uAqz6VsIcB35G2CjzW3Ct99XaQFzdIfNn4U5x3KF5b+w5esAHlJHCn AArPD8mFDRfK+ejl7Bwz2pWN9jWtwamPDK0Ci4oLqXG/VNZQhV7ClptXODZDR7L8kl9f OGco+Yu2ebxFc2XLNxGh1VDXm1RRlyYA2xKawmdPc/4edPxw7iCsg3iS2IjLp0pNzNtn b07g== X-Gm-Message-State: APjAAAV09ZGxj4HUz4ova1XnDyFsPHLGBDXDP40YPfkekGDASWAIxeeo YxNF/oqvvOz4DCMWiNFW9KFHEA== X-Google-Smtp-Source: APXvYqyjLyv0T6+Soc8rfhuCL36fszrICz2GNTzWHVICEtG9+dfgEtnvtmGxPXAFCsekAXIAbgksJw== X-Received: by 2002:a17:90b:8d1:: with SMTP id ds17mr8096278pjb.105.1569568274050; Fri, 27 Sep 2019 00:11:14 -0700 (PDT) Received: from baolinwangubtpc.spreadtrum.com ([117.18.48.82]) by smtp.gmail.com with ESMTPSA id f74sm1733288pfa.34.2019.09.27.00.11.11 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 27 Sep 2019 00:11:13 -0700 (PDT) From: Baolin Wang To: ohad@wizery.com, bjorn.andersson@linaro.org Cc: orsonzhai@gmail.com, baolin.wang@linaro.org, zhang.lyra@gmail.com, linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/4] hwspinlock: sprd: Change to use devm_platform_ioremap_resource() Date: Fri, 27 Sep 2019 15:10:44 +0800 Message-Id: <00916cd2409a5607fc4023a4cae351f1b2e84d8a.1569567749.git.baolin.wang@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: References: In-Reply-To: References: Sender: linux-remoteproc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-remoteproc@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/hwspinlock/sprd_hwspinlock.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/hwspinlock/sprd_hwspinlock.c b/drivers/hwspinlock/sprd_hwspinlock.c index dc42bf5..7a8534f 100644 --- a/drivers/hwspinlock/sprd_hwspinlock.c +++ b/drivers/hwspinlock/sprd_hwspinlock.c @@ -83,7 +83,6 @@ static int sprd_hwspinlock_probe(struct platform_device *pdev) { struct sprd_hwspinlock_dev *sprd_hwlock; struct hwspinlock *lock; - struct resource *res; int i, ret; if (!pdev->dev.of_node) @@ -96,8 +95,7 @@ static int sprd_hwspinlock_probe(struct platform_device *pdev) if (!sprd_hwlock) return -ENOMEM; - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - sprd_hwlock->base = devm_ioremap_resource(&pdev->dev, res); + sprd_hwlock->base = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(sprd_hwlock->base)) return PTR_ERR(sprd_hwlock->base); From patchwork Fri Sep 27 07:10:45 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: 11163987 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 40198912 for ; Fri, 27 Sep 2019 07:11:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1EA9F207FF for ; Fri, 27 Sep 2019 07:11:18 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="WrhU2dyi" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726434AbfI0HLS (ORCPT ); Fri, 27 Sep 2019 03:11:18 -0400 Received: from mail-pf1-f193.google.com ([209.85.210.193]:34078 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726136AbfI0HLS (ORCPT ); Fri, 27 Sep 2019 03:11:18 -0400 Received: by mail-pf1-f193.google.com with SMTP id b128so1029888pfa.1 for ; Fri, 27 Sep 2019 00:11:18 -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=FgzSnruuv7XNqxxD65EJ+AwZlRv0x29REgnPuXxLMeA=; b=WrhU2dyi93gFs4D+GbFw4lzLCuOSkkO5QsvfwR5+n6nP+AgAFlLabONZlVnlh1PNPC mlSiTWo6NZ3rzLkqubEFhiB4qFhzx8hgYOTuEZRdzwD2Ssoq3jCc9rh5J4d0pUs/Vojo ra6knN+QFYpr9LsbcUhNaKwIRm1IbfziceIPS1qk7Yt8QG+Y444uD5EHoCQGZFifG0N7 61Y3F6doxu0gP+/SdEt1H9nHBf6LgoXt7jST1l1qRRfdXeyF6hcovCr7P12UbN3CUrsf injvUaBQp/zFbHxOnKMsh+tA8Vtsnwo5902kanTSvzDu05x+7MVABKWjkYwgAyQS3eJU bfFQ== 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=FgzSnruuv7XNqxxD65EJ+AwZlRv0x29REgnPuXxLMeA=; b=iBO2QZGA4xVIUZQ8KHyGgMX4U5OHo7OqFeZupidanfCFe0saWEP4OzsaLi5kpZz1+E BWb1rrDOJGTIR+w0+d3KFJV/vxWNC6PuvwBIPFAJ+lcmLw5pbwJByQmqYI+KqpZdwIoU uI7hI7aG0hb3eT/NyLF04iAb+doKk4UBzI5ahYOSnjRTD4NSeQJNCjo6Lq7w3jYicqiW ilyO3fX/KbNkiOnXDap8Nm1feX73H6XEyZtjHWT/RQ7J+DKWH2pAI3P9uradh4b19KGf da152+UuPNT8U13C0COSLhJXQ2U82AIZQLI9qC0TwUSWxC/dhJUXEHPO0laCfzRXGX1H j3YQ== X-Gm-Message-State: APjAAAXX8jGDshxsH+hj3WK3pLXriCr9hbW8I2wbA2PH+V7dzSAtnIPi tQqCd3TSL+XhTeCIXQyFp3Tu2w== X-Google-Smtp-Source: APXvYqygS3OJTk4wBdVnOAShliAz6Ul346kFPpJ2oIYnl7YI5A5H+4Emlxq37Jj3K8vN/npKoMV6pw== X-Received: by 2002:a63:461e:: with SMTP id t30mr7741315pga.141.1569568277748; Fri, 27 Sep 2019 00:11:17 -0700 (PDT) Received: from baolinwangubtpc.spreadtrum.com ([117.18.48.82]) by smtp.gmail.com with ESMTPSA id f74sm1733288pfa.34.2019.09.27.00.11.14 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 27 Sep 2019 00:11:16 -0700 (PDT) From: Baolin Wang To: ohad@wizery.com, bjorn.andersson@linaro.org Cc: orsonzhai@gmail.com, baolin.wang@linaro.org, zhang.lyra@gmail.com, linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/4] hwspinlock: sprd: Check the return value of clk_prepare_enable() Date: Fri, 27 Sep 2019 15:10:45 +0800 Message-Id: X-Mailer: git-send-email 1.7.9.5 In-Reply-To: References: In-Reply-To: References: Sender: linux-remoteproc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-remoteproc@vger.kernel.org We must check the return value of clk_prepare_enable() to make sure the hardware spinlock controller can be enabled successfully, otherwise we should return error. Signed-off-by: Baolin Wang --- drivers/hwspinlock/sprd_hwspinlock.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/hwspinlock/sprd_hwspinlock.c b/drivers/hwspinlock/sprd_hwspinlock.c index 7a8534f..d210424 100644 --- a/drivers/hwspinlock/sprd_hwspinlock.c +++ b/drivers/hwspinlock/sprd_hwspinlock.c @@ -105,7 +105,9 @@ static int sprd_hwspinlock_probe(struct platform_device *pdev) return PTR_ERR(sprd_hwlock->clk); } - clk_prepare_enable(sprd_hwlock->clk); + ret = clk_prepare_enable(sprd_hwlock->clk); + if (ret) + return ret; /* set the hwspinlock to record user id to identify subsystems */ writel(HWSPINLOCK_USER_BITS, sprd_hwlock->base + HWSPINLOCK_RECCTRL); From patchwork Fri Sep 27 07:10:46 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: 11163989 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 E243E912 for ; Fri, 27 Sep 2019 07:11:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C0F75207FF for ; Fri, 27 Sep 2019 07:11:22 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="VYBbB4IX" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726466AbfI0HLW (ORCPT ); Fri, 27 Sep 2019 03:11:22 -0400 Received: from mail-pl1-f193.google.com ([209.85.214.193]:43007 "EHLO mail-pl1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726217AbfI0HLV (ORCPT ); Fri, 27 Sep 2019 03:11:21 -0400 Received: by mail-pl1-f193.google.com with SMTP id e5so698996pls.9 for ; Fri, 27 Sep 2019 00:11:21 -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=rsM2uCT+H5N8frHAhYZ4xNoIMLY0pUKheXJFFZekhJ0=; b=VYBbB4IXZbS8pOxmBk6Ioz1/IWOjHl0aTJCwLhy7YY2HHOvVRG5s4W2aVVxmyEKGfX LyxiwbJufXG7RI+4FuFZWzvK5XF6rm9m7oeL04AaxCK21NNiXH0opuZPvcb5XFwiAWmK sP6lF52WGe0e4yA3CKvCLEr1edRWQmh6G5HNcjd54Ybe8LkFTluD2Q/f+yN+BBjgCagH fANqi+yffexA3CyZIHB3U2vWcaBv6auX4VGErkEpk6i8tpYqwhDTlP7m06erEvBbgiq4 05La9Vf5EphZxq1KewIV2zUdaK8dJ37ec3+t+tn1fqSM5+IrOsNV8sD8e1zrpTcdacGG 50PA== 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=rsM2uCT+H5N8frHAhYZ4xNoIMLY0pUKheXJFFZekhJ0=; b=Kn4sW0+Cd76pMO246rHJ3KVNPx5JDsV9PgLzEAHH8OjRsQ+o7/dh2mCdlBAOZu+bfq FecPeMaH31FPyLoSp68dpd1R5JoM8bmWFUNbLUhvdCb1akp0C5rTYNhGeJFSQ2OsV9G1 VXW/owoKU69/QjDfQLdpTos12NWjsmpVhEtRJygd2hswwA2VJoCflqtI6r/00h0f68qr Uqp+DfVVaCV3XINtAhCcVegLhm+mxG2jdY8Sd8w1BmkP6JETa5YaQxJ6SZV/Ou8iDz4T Efuwi11hA4GSI7DdTuVkvamMpEa0nrXmQ3q1Cpd2N0M+j4fgmfow3+BSm5oKDao3DfU8 rmKw== X-Gm-Message-State: APjAAAW1MaRXeQyWPa4gqbTnUnTu17T+H/Vj097QYytwisj7b1/520W/ 9UppWvoui5+peuJAx2lkAxQSTg== X-Google-Smtp-Source: APXvYqzhHYaiRNX4PqrUbwuBJAKuO6YWZzZccB1OVSU+ypMKAlrqzItHtGxjsUmygED2PC+YfdvsjA== X-Received: by 2002:a17:902:7886:: with SMTP id q6mr3030571pll.323.1569568281015; Fri, 27 Sep 2019 00:11:21 -0700 (PDT) Received: from baolinwangubtpc.spreadtrum.com ([117.18.48.82]) by smtp.gmail.com with ESMTPSA id f74sm1733288pfa.34.2019.09.27.00.11.18 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 27 Sep 2019 00:11:20 -0700 (PDT) From: Baolin Wang To: ohad@wizery.com, bjorn.andersson@linaro.org Cc: orsonzhai@gmail.com, baolin.wang@linaro.org, zhang.lyra@gmail.com, linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 3/4] hwspinlock: sprd: Use devm_add_action_or_reset() for calls to clk_disable_unprepare() Date: Fri, 27 Sep 2019 15:10:46 +0800 Message-Id: <03de1c267461a6ac17cf7732404795b2fe735927.1569567749.git.baolin.wang@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: References: In-Reply-To: References: Sender: linux-remoteproc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-remoteproc@vger.kernel.org Use devm_add_action_or_reset() for calls to clk_disable_unprepare(), which can simplify the error handling. Signed-off-by: Baolin Wang --- drivers/hwspinlock/sprd_hwspinlock.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/drivers/hwspinlock/sprd_hwspinlock.c b/drivers/hwspinlock/sprd_hwspinlock.c index d210424..e76c702 100644 --- a/drivers/hwspinlock/sprd_hwspinlock.c +++ b/drivers/hwspinlock/sprd_hwspinlock.c @@ -79,6 +79,13 @@ static void sprd_hwspinlock_relax(struct hwspinlock *lock) .relax = sprd_hwspinlock_relax, }; +static void sprd_hwspinlock_disable(void *data) +{ + struct sprd_hwspinlock_dev *sprd_hwlock = data; + + clk_disable_unprepare(sprd_hwlock->clk); +} + static int sprd_hwspinlock_probe(struct platform_device *pdev) { struct sprd_hwspinlock_dev *sprd_hwlock; @@ -109,6 +116,14 @@ static int sprd_hwspinlock_probe(struct platform_device *pdev) if (ret) return ret; + ret = devm_add_action_or_reset(&pdev->dev, sprd_hwspinlock_disable, + sprd_hwlock); + if (ret) { + dev_err(&pdev->dev, + "Failed to add hwspinlock disable action\n"); + return ret; + } + /* set the hwspinlock to record user id to identify subsystems */ writel(HWSPINLOCK_USER_BITS, sprd_hwlock->base + HWSPINLOCK_RECCTRL); @@ -124,7 +139,6 @@ static int sprd_hwspinlock_probe(struct platform_device *pdev) &sprd_hwspinlock_ops, 0, SPRD_HWLOCKS_NUM); if (ret) { pm_runtime_disable(&pdev->dev); - clk_disable_unprepare(sprd_hwlock->clk); return ret; } @@ -137,7 +151,6 @@ static int sprd_hwspinlock_remove(struct platform_device *pdev) hwspin_lock_unregister(&sprd_hwlock->bank); pm_runtime_disable(&pdev->dev); - clk_disable_unprepare(sprd_hwlock->clk); return 0; } From patchwork Fri Sep 27 07:10:47 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: 11163991 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 DAF3D1709 for ; Fri, 27 Sep 2019 07:11:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B8AE2207FF for ; Fri, 27 Sep 2019 07:11:25 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="e8jqNvEb" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726501AbfI0HLZ (ORCPT ); Fri, 27 Sep 2019 03:11:25 -0400 Received: from mail-pl1-f195.google.com ([209.85.214.195]:43484 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726217AbfI0HLY (ORCPT ); Fri, 27 Sep 2019 03:11:24 -0400 Received: by mail-pl1-f195.google.com with SMTP id f21so697602plj.10 for ; Fri, 27 Sep 2019 00:11:24 -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=JWJl6+k678lNhoIwgPT24JSdOgdcYLv3dPpKZNuhawQ=; b=e8jqNvEbhvr0kgtsFK625isW2I3jDhZSNomDeSga2oSYqTtT6RV+dW3pDm6Z3HXJ+9 VwZc7ZzddAyp7VGQZ+t1szym8TCRuLxnvAT0WHpHyEZCyeekVFH/IFh3d9QbSVCzMEGW LTiZ1DuLVoVKGGC7tfWmtZc3H06WK4Fq36Dnt0ef98J49H8bvgehZ3rjL8hJuVE6F6Nh zA7Kj0j0nGE7B4kkI0By8EjHSSIp5pz9GqxNXTd2OKQbEQNO0XjYZ2Abcu2K2Ma1Mjf5 fPo05WdTHPdOW4PC3PX+pawyJZq6F9nXCfhckU7KfbjS+u5Dg3A1+e//XI4nKGUYJn8L ZbAA== 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=JWJl6+k678lNhoIwgPT24JSdOgdcYLv3dPpKZNuhawQ=; b=Z3tOYT+2RN0lWJb2p1jABqycU6iO5Ay6YYSg4zLe5sX6m9mqsFPj6sO93fy8MCNAdN 9+5qtde6yyeehI1TZXjpS7IFwLkUtxAdbg1Dbf16B3Ku2idobONCM35OooHfq822kY6N xz5tvaqRiYH8Zfa/ITdKddXwuStPu91itTFyM9HWBnOSoUEpQBpfSGVnlAE3xaYI9L17 mPmvnzpSGi1gEQ2gznrlVg5GhexcUsxb1PKHnkOOqM5V1lEeVaW1CsnCcfsThvtW9OG2 31tVzE3Grjye9CWEqJsJPcMxXch5NixaDLJ9CnfuSnt3vE7CyIZ3JEn6OfX6fkb+v5Lr HdIQ== X-Gm-Message-State: APjAAAXshvT9eHYQjq1TbeQcZbIa1P4+pFlYqnsHxXn5S+8VrlmTibmy I4POMSig3QVpu/g5RkMY7cYq6Q== X-Google-Smtp-Source: APXvYqxdG3QqJXUbaky7WFyX4U95Cc00q0ixYEdLQ8wit0Qg1YQtygKQhRah3390SPIfZZk6fJeZ8w== X-Received: by 2002:a17:902:9346:: with SMTP id g6mr3045391plp.0.1569568284057; Fri, 27 Sep 2019 00:11:24 -0700 (PDT) Received: from baolinwangubtpc.spreadtrum.com ([117.18.48.82]) by smtp.gmail.com with ESMTPSA id f74sm1733288pfa.34.2019.09.27.00.11.21 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 27 Sep 2019 00:11:23 -0700 (PDT) From: Baolin Wang To: ohad@wizery.com, bjorn.andersson@linaro.org Cc: orsonzhai@gmail.com, baolin.wang@linaro.org, zhang.lyra@gmail.com, linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 4/4] hwspinlock: sprd: Use devm_hwspin_lock_register() to register hwlock controller Date: Fri, 27 Sep 2019 15:10:47 +0800 Message-Id: X-Mailer: git-send-email 1.7.9.5 In-Reply-To: References: In-Reply-To: References: Sender: linux-remoteproc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-remoteproc@vger.kernel.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 --- drivers/hwspinlock/sprd_hwspinlock.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/hwspinlock/sprd_hwspinlock.c b/drivers/hwspinlock/sprd_hwspinlock.c index e76c702..44d69db 100644 --- a/drivers/hwspinlock/sprd_hwspinlock.c +++ b/drivers/hwspinlock/sprd_hwspinlock.c @@ -135,8 +135,9 @@ static int sprd_hwspinlock_probe(struct platform_device *pdev) platform_set_drvdata(pdev, sprd_hwlock); pm_runtime_enable(&pdev->dev); - ret = hwspin_lock_register(&sprd_hwlock->bank, &pdev->dev, - &sprd_hwspinlock_ops, 0, SPRD_HWLOCKS_NUM); + ret = devm_hwspin_lock_register(&pdev->dev, &sprd_hwlock->bank, + &sprd_hwspinlock_ops, 0, + SPRD_HWLOCKS_NUM); if (ret) { pm_runtime_disable(&pdev->dev); return ret; @@ -147,9 +148,6 @@ static int sprd_hwspinlock_probe(struct platform_device *pdev) static int sprd_hwspinlock_remove(struct platform_device *pdev) { - struct sprd_hwspinlock_dev *sprd_hwlock = platform_get_drvdata(pdev); - - hwspin_lock_unregister(&sprd_hwlock->bank); pm_runtime_disable(&pdev->dev); return 0; }