lkml.org 
[lkml]   [2013]   [Aug]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH 2/2] pinctrl: core: Add proper mutex lock in pinctrl_request_gpio
From
On Mon, Aug 19, 2013 at 4:07 AM, Axel Lin <axel.lin@ingics.com> wrote:

> This one is missed in commit 42fed7ba "pinctrl: move subsystem mutex to
> pinctrl_dev struct".

I think this was never there.

> Signed-off-by: Axel Lin <axel.lin@ingics.com>
> ---
> drivers/pinctrl/core.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/drivers/pinctrl/core.c b/drivers/pinctrl/core.c
> index 53c40d9..92f86ab 100644
> --- a/drivers/pinctrl/core.c
> +++ b/drivers/pinctrl/core.c
> @@ -562,11 +562,15 @@ int pinctrl_request_gpio(unsigned gpio)
> return ret;
> }
>
> + mutex_lock(&pctldev->mutex);
> +
> /* Convert to the pin controllers number space */
> pin = gpio_to_pin(range, gpio);
>
> ret = pinmux_request_gpio(pctldev, range, pin, gpio);
>
> + mutex_unlock(&pctldev->mutex);
> +
> return ret;

What is this protecting against?

I'm not sure I follow this so better ask.

Yours,
Linus Walleij


\
 
 \ /
  Last update: 2013-08-22 00:21    [W:0.048 / U:0.736 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site