Re: [PATCH] iio: light: gp2ap002: Fix rumtime PM imbalance on error

2021-04-19 Thread Linus Walleij
On Sun, Apr 18, 2021 at 11:43 AM Jonathan Cameron wrote: > I'm still far from completely convinced that it is 'necessary' > to take the reference whilst going through this sequence because > there is nothing to kick off the suspend until we tell it to use > autosuspend. However, I appreciate

Re: [PATCH] iio: light: gp2ap002: Fix rumtime PM imbalance on error

2021-04-18 Thread Jonathan Cameron
On Mon, 12 Apr 2021 13:47:58 +0200 Linus Walleij wrote: > On Mon, Apr 12, 2021 at 12:16 PM Jonathan Cameron > wrote: > > > An example would be the bmc150_magn driver which does exactly the > > same call sequence as this one, but without the reference count increment > > and decrement.

Re: [PATCH] iio: light: gp2ap002: Fix rumtime PM imbalance on error

2021-04-12 Thread Linus Walleij
On Mon, Apr 12, 2021 at 12:16 PM Jonathan Cameron wrote: > An example would be the bmc150_magn driver which does exactly the > same call sequence as this one, but without the reference count increment > and decrement. Basically I want to know if there is a problem in > those other drivers that

Re: [PATCH] iio: light: gp2ap002: Fix rumtime PM imbalance on error

2021-04-12 Thread Jonathan Cameron
On Mon, 12 Apr 2021 00:38:41 +0200 Linus Walleij wrote: > On Sun, Apr 11, 2021 at 5:07 PM Jonathan Cameron wrote: > > On Wed, 7 Apr 2021 11:49:27 +0800 > > Dinghao Liu wrote: > > > > > When devm_request_threaded_irq() fails, we should decrease the > > > runtime PM counter to keep the

Re: [PATCH] iio: light: gp2ap002: Fix rumtime PM imbalance on error

2021-04-11 Thread Linus Walleij
On Sun, Apr 11, 2021 at 5:07 PM Jonathan Cameron wrote: > On Wed, 7 Apr 2021 11:49:27 +0800 > Dinghao Liu wrote: > > > When devm_request_threaded_irq() fails, we should decrease the > > runtime PM counter to keep the counter balanced. But when > > iio_device_register() fails, we need not to

Re: [PATCH] iio: light: gp2ap002: Fix rumtime PM imbalance on error

2021-04-11 Thread Jonathan Cameron
On Wed, 7 Apr 2021 11:49:27 +0800 Dinghao Liu wrote: > When devm_request_threaded_irq() fails, we should decrease the > runtime PM counter to keep the counter balanced. But when > iio_device_register() fails, we need not to decrease it because > we have already decreased it before. Whilst

Re: [PATCH] iio: light: gp2ap002: Fix rumtime PM imbalance on error

2021-04-07 Thread Linus Walleij
On Wed, Apr 7, 2021 at 5:49 AM Dinghao Liu wrote: > When devm_request_threaded_irq() fails, we should decrease the > runtime PM counter to keep the counter balanced. But when > iio_device_register() fails, we need not to decrease it because > we have already decreased it before. > >

[PATCH] iio: light: gp2ap002: Fix rumtime PM imbalance on error

2021-04-06 Thread Dinghao Liu
When devm_request_threaded_irq() fails, we should decrease the runtime PM counter to keep the counter balanced. But when iio_device_register() fails, we need not to decrease it because we have already decreased it before. Signed-off-by: Dinghao Liu --- drivers/iio/light/gp2ap002.c | 5 +++-- 1