From: Bjorn Andersson <bjorn.andersson@linaro.org>
To: Baolin Wang <baolin.wang7@gmail.com>
Cc: ohad@wizery.com, linux-omap@vger.kernel.org,
linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH RESEND 3/3] hwspinlock: omap: Use devm_hwspin_lock_register() to register hwlock controller
Date: Tue, 21 Jan 2020 16:15:15 -0800 [thread overview]
Message-ID: <20200122001515.GA14744@builder> (raw)
In-Reply-To: <315adcc5dfc6aa5c001448401dda4065e33deef2.1578453062.git.baolin.wang7@gmail.com>
On Tue 07 Jan 19:14 PST 2020, Baolin Wang wrote:
> 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 <baolin.wang7@gmail.com>
> ---
> drivers/hwspinlock/omap_hwspinlock.c | 13 ++-----------
> 1 file changed, 2 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/hwspinlock/omap_hwspinlock.c b/drivers/hwspinlock/omap_hwspinlock.c
> index 3b05560..9e8a8c2 100644
> --- a/drivers/hwspinlock/omap_hwspinlock.c
> +++ b/drivers/hwspinlock/omap_hwspinlock.c
> @@ -131,8 +131,8 @@ static int omap_hwspinlock_probe(struct platform_device *pdev)
> for (i = 0, hwlock = &bank->lock[0]; i < num_locks; i++, hwlock++)
> hwlock->priv = io_base + LOCK_BASE_OFFSET + sizeof(u32) * i;
>
> - ret = hwspin_lock_register(bank, &pdev->dev, &omap_hwspinlock_ops,
> - base_id, num_locks);
> + ret = devm_hwspin_lock_register(&pdev->dev, bank, &omap_hwspinlock_ops,
> + base_id, num_locks);
> if (ret)
> goto runtime_err;
>
> @@ -148,15 +148,6 @@ static int omap_hwspinlock_probe(struct platform_device *pdev)
>
> static int omap_hwspinlock_remove(struct platform_device *pdev)
> {
> - struct hwspinlock_device *bank = platform_get_drvdata(pdev);
> - int ret;
> -
> - ret = hwspin_lock_unregister(bank);
> - if (ret) {
> - dev_err(&pdev->dev, "%s failed: %d\n", __func__, ret);
> - return ret;
> - }
> -
Relying on devm_hwspin_lock_register() to hwspin_lock_unregister() will
mean that pm_runtime_disable() will now be called before the spinlocks
are unregistered.
Regards,
Bjorn
> pm_runtime_disable(&pdev->dev);
>
> return 0;
> --
> 1.7.9.5
>
WARNING: multiple messages have this Message-ID (diff)
From: Bjorn Andersson <bjorn.andersson@linaro.org>
To: Baolin Wang <baolin.wang7@gmail.com>
Cc: ohad@wizery.com, linux-omap@vger.kernel.org,
linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH RESEND 3/3] hwspinlock: omap: Use devm_hwspin_lock_register() to register hwlock controller
Date: Tue, 21 Jan 2020 16:15:18 -0800 [thread overview]
Message-ID: <20200122001515.GA14744@builder> (raw)
In-Reply-To: <315adcc5dfc6aa5c001448401dda4065e33deef2.1578453062.git.baolin.wang7@gmail.com>
On Tue 07 Jan 19:14 PST 2020, Baolin Wang wrote:
> 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 <baolin.wang7@gmail.com>
> ---
> drivers/hwspinlock/omap_hwspinlock.c | 13 ++-----------
> 1 file changed, 2 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/hwspinlock/omap_hwspinlock.c b/drivers/hwspinlock/omap_hwspinlock.c
> index 3b05560..9e8a8c2 100644
> --- a/drivers/hwspinlock/omap_hwspinlock.c
> +++ b/drivers/hwspinlock/omap_hwspinlock.c
> @@ -131,8 +131,8 @@ static int omap_hwspinlock_probe(struct platform_device *pdev)
> for (i = 0, hwlock = &bank->lock[0]; i < num_locks; i++, hwlock++)
> hwlock->priv = io_base + LOCK_BASE_OFFSET + sizeof(u32) * i;
>
> - ret = hwspin_lock_register(bank, &pdev->dev, &omap_hwspinlock_ops,
> - base_id, num_locks);
> + ret = devm_hwspin_lock_register(&pdev->dev, bank, &omap_hwspinlock_ops,
> + base_id, num_locks);
> if (ret)
> goto runtime_err;
>
> @@ -148,15 +148,6 @@ static int omap_hwspinlock_probe(struct platform_device *pdev)
>
> static int omap_hwspinlock_remove(struct platform_device *pdev)
> {
> - struct hwspinlock_device *bank = platform_get_drvdata(pdev);
> - int ret;
> -
> - ret = hwspin_lock_unregister(bank);
> - if (ret) {
> - dev_err(&pdev->dev, "%s failed: %d\n", __func__, ret);
> - return ret;
> - }
> -
Relying on devm_hwspin_lock_register() to hwspin_lock_unregister() will
mean that pm_runtime_disable() will now be called before the spinlocks
are unregistered.
Regards,
Bjorn
> pm_runtime_disable(&pdev->dev);
>
> return 0;
> --
> 1.7.9.5
>
next prev parent reply other threads:[~2020-01-22 0:15 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-08 3:13 [PATCH RESEND 0/3] Some improvements for OMAP hwspinlock Baolin Wang
2020-01-08 3:13 ` [PATCH RESEND 1/3] hwspinlock: omap: Change to use devm_platform_ioremap_resource() Baolin Wang
2020-01-08 3:14 ` [PATCH RESEND 2/3] hwspinlock: omap: Use devm_kzalloc() to allocate memory Baolin Wang
2020-01-08 3:14 ` [PATCH RESEND 3/3] hwspinlock: omap: Use devm_hwspin_lock_register() to register hwlock controller Baolin Wang
2020-01-22 0:15 ` Bjorn Andersson [this message]
2020-01-22 0:15 ` Bjorn Andersson
2020-01-25 4:10 ` Baolin Wang
2020-01-22 0:15 ` [PATCH RESEND 0/3] Some improvements for OMAP hwspinlock Bjorn Andersson
2020-01-22 0:16 ` Bjorn Andersson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200122001515.GA14744@builder \
--to=bjorn.andersson@linaro.org \
--cc=baolin.wang7@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=linux-remoteproc@vger.kernel.org \
--cc=ohad@wizery.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.