Message ID | 20210516162103.1332291-6-jic23@kernel.org (mailing list archive) |
---|---|
State | Accepted |
Headers | show |
Series | IIO: Runtime PM related cleanups. | expand |
On Sun, May 16, 2021 at 9:22 AM Jonathan Cameron <jic23@kernel.org> wrote: > > From: Jonathan Cameron <Jonathan.Cameron@huawei.com> > > Using this new call makes it easy to handle any errors as a result > of runtime resume as it exits without leaving the reference count > elevated. > Acked-by: Matt Ranostay <matt.ranostay@konsulko.com> > Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> > Cc: Matt Ranostay <matt.ranostay@konsulko.com> > --- > drivers/iio/proximity/pulsedlight-lidar-lite-v2.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/drivers/iio/proximity/pulsedlight-lidar-lite-v2.c b/drivers/iio/proximity/pulsedlight-lidar-lite-v2.c > index ecaeb1e11007..e94f63932edb 100644 > --- a/drivers/iio/proximity/pulsedlight-lidar-lite-v2.c > +++ b/drivers/iio/proximity/pulsedlight-lidar-lite-v2.c > @@ -158,7 +158,9 @@ static int lidar_get_measurement(struct lidar_data *data, u16 *reg) > int tries = 10; > int ret; > > - pm_runtime_get_sync(&client->dev); > + ret = pm_runtime_resume_and_get(&client->dev); > + if (ret < 0) > + return ret; > > /* start sample */ > ret = lidar_write_control(data, LIDAR_REG_CONTROL_ACQUIRE); > -- > 2.31.1 >
Em Sun, 16 May 2021 13:01:29 -0700 Matt Ranostay <matt.ranostay@konsulko.com> escreveu: > On Sun, May 16, 2021 at 9:22 AM Jonathan Cameron <jic23@kernel.org> wrote: > > > > From: Jonathan Cameron <Jonathan.Cameron@huawei.com> > > > > Using this new call makes it easy to handle any errors as a result > > of runtime resume as it exits without leaving the reference count > > elevated. > > > > Acked-by: Matt Ranostay <matt.ranostay@konsulko.com> LGTM. Reviewed-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> > > > Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> > > Cc: Matt Ranostay <matt.ranostay@konsulko.com> > > --- > > drivers/iio/proximity/pulsedlight-lidar-lite-v2.c | 4 +++- > > 1 file changed, 3 insertions(+), 1 deletion(-) > > > > diff --git a/drivers/iio/proximity/pulsedlight-lidar-lite-v2.c b/drivers/iio/proximity/pulsedlight-lidar-lite-v2.c > > index ecaeb1e11007..e94f63932edb 100644 > > --- a/drivers/iio/proximity/pulsedlight-lidar-lite-v2.c > > +++ b/drivers/iio/proximity/pulsedlight-lidar-lite-v2.c > > @@ -158,7 +158,9 @@ static int lidar_get_measurement(struct lidar_data *data, u16 *reg) > > int tries = 10; > > int ret; > > > > - pm_runtime_get_sync(&client->dev); > > + ret = pm_runtime_resume_and_get(&client->dev); > > + if (ret < 0) > > + return ret; > > > > /* start sample */ > > ret = lidar_write_control(data, LIDAR_REG_CONTROL_ACQUIRE); > > -- > > 2.31.1 > > Thanks, Mauro
On Wed, 16 Jun 2021 09:19:13 +0200 Mauro Carvalho Chehab <mchehab+huawei@kernel.org> wrote: > Em Sun, 16 May 2021 13:01:29 -0700 > Matt Ranostay <matt.ranostay@konsulko.com> escreveu: > > > On Sun, May 16, 2021 at 9:22 AM Jonathan Cameron <jic23@kernel.org> wrote: > > > > > > From: Jonathan Cameron <Jonathan.Cameron@huawei.com> > > > > > > Using this new call makes it easy to handle any errors as a result > > > of runtime resume as it exits without leaving the reference count > > > elevated. > > > > > > > Acked-by: Matt Ranostay <matt.ranostay@konsulko.com> > > LGTM. > > Reviewed-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> Applied. > > > > > > Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> > > > Cc: Matt Ranostay <matt.ranostay@konsulko.com> > > > --- > > > drivers/iio/proximity/pulsedlight-lidar-lite-v2.c | 4 +++- > > > 1 file changed, 3 insertions(+), 1 deletion(-) > > > > > > diff --git a/drivers/iio/proximity/pulsedlight-lidar-lite-v2.c b/drivers/iio/proximity/pulsedlight-lidar-lite-v2.c > > > index ecaeb1e11007..e94f63932edb 100644 > > > --- a/drivers/iio/proximity/pulsedlight-lidar-lite-v2.c > > > +++ b/drivers/iio/proximity/pulsedlight-lidar-lite-v2.c > > > @@ -158,7 +158,9 @@ static int lidar_get_measurement(struct lidar_data *data, u16 *reg) > > > int tries = 10; > > > int ret; > > > > > > - pm_runtime_get_sync(&client->dev); > > > + ret = pm_runtime_resume_and_get(&client->dev); > > > + if (ret < 0) > > > + return ret; > > > > > > /* start sample */ > > > ret = lidar_write_control(data, LIDAR_REG_CONTROL_ACQUIRE); > > > -- > > > 2.31.1 > > > > > > > Thanks, > Mauro
diff --git a/drivers/iio/proximity/pulsedlight-lidar-lite-v2.c b/drivers/iio/proximity/pulsedlight-lidar-lite-v2.c index ecaeb1e11007..e94f63932edb 100644 --- a/drivers/iio/proximity/pulsedlight-lidar-lite-v2.c +++ b/drivers/iio/proximity/pulsedlight-lidar-lite-v2.c @@ -158,7 +158,9 @@ static int lidar_get_measurement(struct lidar_data *data, u16 *reg) int tries = 10; int ret; - pm_runtime_get_sync(&client->dev); + ret = pm_runtime_resume_and_get(&client->dev); + if (ret < 0) + return ret; /* start sample */ ret = lidar_write_control(data, LIDAR_REG_CONTROL_ACQUIRE);