2014-04-09 18:26:18

by Alexandre Belloni

[permalink] [raw]
Subject: [PATCH] pwm: atmel: set pwm_chip can_sleep flag

atmel_pwm_config() calls clk_get_rate() which might sleep, so we need to set
pwm_chip can_sleep flag.

Signed-off-by: Alexandre Belloni <[email protected]>
---
drivers/pwm/pwm-atmel.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/pwm/pwm-atmel.c b/drivers/pwm/pwm-atmel.c
index 0e589594b1cb..180e34e46617 100644
--- a/drivers/pwm/pwm-atmel.c
+++ b/drivers/pwm/pwm-atmel.c
@@ -369,6 +369,7 @@ static int atmel_pwm_probe(struct platform_device *pdev)

atmel_pwm->chip.base = -1;
atmel_pwm->chip.npwm = 4;
+ atmel_pwm->chip.can_sleep = true;
atmel_pwm->config = data->config;

ret = pwmchip_add(&atmel_pwm->chip);
--
1.8.3.2


2014-04-10 13:51:43

by Nicolas Ferre

[permalink] [raw]
Subject: Re: [PATCH] pwm: atmel: set pwm_chip can_sleep flag

On 09/04/2014 20:26, Alexandre Belloni :
> atmel_pwm_config() calls clk_get_rate() which might sleep, so we need to set
> pwm_chip can_sleep flag.
>
> Signed-off-by: Alexandre Belloni <[email protected]>

Acked-by: Nicolas Ferre <[email protected]>

> ---
> drivers/pwm/pwm-atmel.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/pwm/pwm-atmel.c b/drivers/pwm/pwm-atmel.c
> index 0e589594b1cb..180e34e46617 100644
> --- a/drivers/pwm/pwm-atmel.c
> +++ b/drivers/pwm/pwm-atmel.c
> @@ -369,6 +369,7 @@ static int atmel_pwm_probe(struct platform_device *pdev)
>
> atmel_pwm->chip.base = -1;
> atmel_pwm->chip.npwm = 4;
> + atmel_pwm->chip.can_sleep = true;
> atmel_pwm->config = data->config;
>
> ret = pwmchip_add(&atmel_pwm->chip);
>


--
Nicolas Ferre