Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[PATCH] pwm: renesas-tpu: Add missing pwmchip_remove() call in tpu_remove()

8 views
Skip to first unread message

Axel Lin

unread,
May 19, 2013, 1:50:01 AM5/19/13
to
Signed-off-by: Axel Lin <axel...@ingics.com>
---
drivers/pwm/pwm-renesas-tpu.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pwm/pwm-renesas-tpu.c b/drivers/pwm/pwm-renesas-tpu.c
index 8e6d8d7..351addd 100644
--- a/drivers/pwm/pwm-renesas-tpu.c
+++ b/drivers/pwm/pwm-renesas-tpu.c
@@ -444,7 +444,7 @@ static int tpu_remove(struct platform_device *pdev)

pm_runtime_disable(&pdev->dev);

- return 0;
+ return pwmchip_remove(&tpu->chip);
}

static struct platform_driver tpu_driver = {
--
1.8.1.2



--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majo...@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

Laurent Pinchart

unread,
May 19, 2013, 10:30:02 AM5/19/13
to
Hi Axel,

Thank you for the patch.

On Sunday 19 May 2013 13:45:31 Axel Lin wrote:
> Signed-off-by: Axel Lin <axel...@ingics.com>
> ---
> drivers/pwm/pwm-renesas-tpu.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/pwm/pwm-renesas-tpu.c b/drivers/pwm/pwm-renesas-tpu.c
> index 8e6d8d7..351addd 100644
> --- a/drivers/pwm/pwm-renesas-tpu.c
> +++ b/drivers/pwm/pwm-renesas-tpu.c
> @@ -444,7 +444,7 @@ static int tpu_remove(struct platform_device *pdev)
>
> pm_runtime_disable(&pdev->dev);
>
> - return 0;
> + return pwmchip_remove(&tpu->chip);

Could you please move that line at the beginning of the function ? There would
be a race condition otherwise, as the user could reenable PWM between the
tpu_pwm_timer_stop() calls and the pwmchip_remove() call.

Apart from that, the patch looks good.

> }
>
> static struct platform_driver tpu_driver = {

--
Regards,

Laurent Pinchart

Simon Horman

unread,
May 19, 2013, 9:20:02 PM5/19/13
to
On Sun, May 19, 2013 at 04:22:21PM +0200, Laurent Pinchart wrote:
> Hi Axel,
>
> Thank you for the patch.
>
> On Sunday 19 May 2013 13:45:31 Axel Lin wrote:
> > Signed-off-by: Axel Lin <axel...@ingics.com>
> > ---
> > drivers/pwm/pwm-renesas-tpu.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/pwm/pwm-renesas-tpu.c b/drivers/pwm/pwm-renesas-tpu.c
> > index 8e6d8d7..351addd 100644
> > --- a/drivers/pwm/pwm-renesas-tpu.c
> > +++ b/drivers/pwm/pwm-renesas-tpu.c
> > @@ -444,7 +444,7 @@ static int tpu_remove(struct platform_device *pdev)
> >
> > pm_runtime_disable(&pdev->dev);
> >
> > - return 0;
> > + return pwmchip_remove(&tpu->chip);
>
> Could you please move that line at the beginning of the function ? There would
> be a race condition otherwise, as the user could reenable PWM between the
> tpu_pwm_timer_stop() calls and the pwmchip_remove() call.
>
> Apart from that, the patch looks good.

Also, could you please CC linu...@vger.kernel.org,
that will help me track the change through patchwork.

Thanks!

Axel Lin

unread,
May 20, 2013, 9:50:01 AM5/20/13
to
Signed-off-by: Axel Lin <axel...@ingics.com>
---
drivers/pwm/pwm-renesas-tpu.c | 5 +++++
1 file changed, 5 insertions(+)

diff --git a/drivers/pwm/pwm-renesas-tpu.c b/drivers/pwm/pwm-renesas-tpu.c
index 8e6d8d7..319a6fe 100644
--- a/drivers/pwm/pwm-renesas-tpu.c
+++ b/drivers/pwm/pwm-renesas-tpu.c
@@ -432,6 +432,11 @@ static int tpu_remove(struct platform_device *pdev)
{
struct tpu_device *tpu = platform_get_drvdata(pdev);
unsigned int i;
+ int ret;
+
+ ret = pwmchip_remove(&tpu->chip);
+ if (ret)
+ return ret;

for (i = 0; i < ARRAY_SIZE(tpu->pwms); ++i) {
struct tpu_pwm_device *pwm = &tpu->pwms[i];
--
1.8.1.2

Laurent Pinchart

unread,
May 20, 2013, 9:50:02 AM5/20/13
to
Hi Axel,

Thank you for the patch.

On Monday 20 May 2013 21:45:41 Axel Lin wrote:
> Signed-off-by: Axel Lin <axel...@ingics.com>

Acked-by: Laurent Pinchart <laurent....@ideasonboard.com>

> ---
> drivers/pwm/pwm-renesas-tpu.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/drivers/pwm/pwm-renesas-tpu.c b/drivers/pwm/pwm-renesas-tpu.c
> index 8e6d8d7..319a6fe 100644
> --- a/drivers/pwm/pwm-renesas-tpu.c
> +++ b/drivers/pwm/pwm-renesas-tpu.c
> @@ -432,6 +432,11 @@ static int tpu_remove(struct platform_device *pdev)
> {
> struct tpu_device *tpu = platform_get_drvdata(pdev);
> unsigned int i;
> + int ret;
> +
> + ret = pwmchip_remove(&tpu->chip);
> + if (ret)
> + return ret;
>
> for (i = 0; i < ARRAY_SIZE(tpu->pwms); ++i) {
> struct tpu_pwm_device *pwm = &tpu->pwms[i];
--
Regards,

Laurent Pinchart

Simon Horman

unread,
May 22, 2013, 9:50:02 PM5/22/13
to
On Mon, May 20, 2013 at 03:46:59PM +0200, Laurent Pinchart wrote:
> Hi Axel,
>
> Thank you for the patch.
>
> On Monday 20 May 2013 21:45:41 Axel Lin wrote:
> > Signed-off-by: Axel Lin <axel...@ingics.com>
>
> Acked-by: Laurent Pinchart <laurent....@ideasonboard.com>

Thanks. I have queued this up for v3.11 in the pinmux branch
of my renesas tree on kernel.org.

>
> > ---
> > drivers/pwm/pwm-renesas-tpu.c | 5 +++++
> > 1 file changed, 5 insertions(+)
> >
> > diff --git a/drivers/pwm/pwm-renesas-tpu.c b/drivers/pwm/pwm-renesas-tpu.c
> > index 8e6d8d7..319a6fe 100644
> > --- a/drivers/pwm/pwm-renesas-tpu.c
> > +++ b/drivers/pwm/pwm-renesas-tpu.c
> > @@ -432,6 +432,11 @@ static int tpu_remove(struct platform_device *pdev)
> > {
> > struct tpu_device *tpu = platform_get_drvdata(pdev);
> > unsigned int i;
> > + int ret;
> > +
> > + ret = pwmchip_remove(&tpu->chip);
> > + if (ret)
> > + return ret;
> >
> > for (i = 0; i < ARRAY_SIZE(tpu->pwms); ++i) {
> > struct tpu_pwm_device *pwm = &tpu->pwms[i];
> --
> Regards,
>
> Laurent Pinchart
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-sh" in

Thierry Reding

unread,
May 23, 2013, 3:20:01 PM5/23/13
to
On Thu, May 23, 2013 at 10:39:34AM +0900, Simon Horman wrote:
> On Mon, May 20, 2013 at 03:46:59PM +0200, Laurent Pinchart wrote:
> > Hi Axel,
> >
> > Thank you for the patch.
> >
> > On Monday 20 May 2013 21:45:41 Axel Lin wrote:
> > > Signed-off-by: Axel Lin <axel...@ingics.com>
> >
> > Acked-by: Laurent Pinchart <laurent....@ideasonboard.com>
>
> Thanks. I have queued this up for v3.11 in the pinmux branch
> of my renesas tree on kernel.org.

I'd rather take this through the PWM tree along with the original driver
patch.

Thierry

Simon Horman

unread,
May 25, 2013, 1:40:01 AM5/25/13
to
Sure that is fine.

I had them queued up in my tree but I have dropped them now.
That should propogate to linux-next in the not too distant future.

I have also dropped the following changes from my tree
as they appear to ether depend on the TPU PWD driver or one
of the other patches in the list below.

Laurent, I think it would be best if you resubmitted these patches
once there is a stable branch available with the TPU PWD driver merged
which I can use as a base.

ARM: mach-shmobile: armadillo800eva: Add backlight support
ARM: mach-shmobile: kota2: Use leds-pwm + pwm-rmob
leds: Remove leds-renesas-tpu driver
sh-pfc: sh73a0: Remove function GPIOs

Laurent Pinchart

unread,
May 25, 2013, 9:50:01 AM5/25/13
to
Hi Thierry,
As I will need to submit a new version of the renesas-tpu patches should I
fold this patch in ?

--
Regards,

Laurent Pinchart
--

Axel Lin

unread,
May 25, 2013, 11:30:02 AM5/25/13
to
2013/5/25 Laurent Pinchart <laurent....@ideasonboard.com>:
> Hi Thierry,
>
> On Thursday 23 May 2013 21:12:17 Thierry Reding wrote:
>> On Thu, May 23, 2013 at 10:39:34AM +0900, Simon Horman wrote:
>> > On Mon, May 20, 2013 at 03:46:59PM +0200, Laurent Pinchart wrote:
>> > > Hi Axel,
>> > >
>> > > Thank you for the patch.
>> > >
>> > > On Monday 20 May 2013 21:45:41 Axel Lin wrote:
>> > > > Signed-off-by: Axel Lin <axel...@ingics.com>
>> > >
>> > > Acked-by: Laurent Pinchart <laurent....@ideasonboard.com>
>> >
>> > Thanks. I have queued this up for v3.11 in the pinmux branch
>> > of my renesas tree on kernel.org.
>>
>> I'd rather take this through the PWM tree along with the original driver
>> patch.
>
> As I will need to submit a new version of the renesas-tpu patches should I
> fold this patch in ?

Hi Laurent,
I think you can fold this patch in if you are going to submit a new version
of the renesas-tpu patches.

Regards,
Axel

Thierry Reding

unread,
May 26, 2013, 5:20:03 AM5/26/13
to
On Sat, May 25, 2013 at 03:42:42PM +0200, Laurent Pinchart wrote:
> Hi Thierry,
>
> On Thursday 23 May 2013 21:12:17 Thierry Reding wrote:
> > On Thu, May 23, 2013 at 10:39:34AM +0900, Simon Horman wrote:
> > > On Mon, May 20, 2013 at 03:46:59PM +0200, Laurent Pinchart wrote:
> > > > Hi Axel,
> > > >
> > > > Thank you for the patch.
> > > >
> > > > On Monday 20 May 2013 21:45:41 Axel Lin wrote:
> > > > > Signed-off-by: Axel Lin <axel...@ingics.com>
> > > >
> > > > Acked-by: Laurent Pinchart <laurent....@ideasonboard.com>
> > >
> > > Thanks. I have queued this up for v3.11 in the pinmux branch
> > > of my renesas tree on kernel.org.
> >
> > I'd rather take this through the PWM tree along with the original driver
> > patch.
>
> As I will need to submit a new version of the renesas-tpu patches should I
> fold this patch in ?

Yes, that's fine with me. It'd be nice to credit Axel, though.

Thierry

Laurent Pinchart

unread,
May 29, 2013, 10:50:02 AM5/29/13
to
Hi Thierry,
Sure. I'll add Axel's SoB line to the patch.

--
Regards,

Laurent Pinchart
signature.asc
0 new messages