2016-03-17 13:55:20

by Amitoj Kaur Chawla

[permalink] [raw]
Subject: [PATCH] iio: light: tsl2563: Remove flush_scheduled_work

flush_scheduled_work is scheduled for deprecation.
Replace cancel_delayed_work and flush_scheduled_work with
cancel_delayed_work_sync instead to ensure there is no pending or
running work item.

Since there is only one work item, chip->poweroff_work, there are
no further dependencies of flush_scheduled_work().

Acked-by: Tejun Heo <[email protected]>
Signed-off-by: Amitoj Kaur Chawla <[email protected]>
---
drivers/iio/light/tsl2563.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/iio/light/tsl2563.c b/drivers/iio/light/tsl2563.c
index 12731d6..57b108c 100644
--- a/drivers/iio/light/tsl2563.c
+++ b/drivers/iio/light/tsl2563.c
@@ -806,8 +806,7 @@ static int tsl2563_probe(struct i2c_client *client,
return 0;

fail:
- cancel_delayed_work(&chip->poweroff_work);
- flush_scheduled_work();
+ cancel_delayed_work_sync(&chip->poweroff_work);
return err;
}

--
1.9.1


2016-03-20 11:05:29

by Jonathan Cameron

[permalink] [raw]
Subject: Re: [PATCH] iio: light: tsl2563: Remove flush_scheduled_work

On 17/03/16 13:55, Amitoj Kaur Chawla wrote:
> flush_scheduled_work is scheduled for deprecation.
> Replace cancel_delayed_work and flush_scheduled_work with
> cancel_delayed_work_sync instead to ensure there is no pending or
> running work item.
>
> Since there is only one work item, chip->poweroff_work, there are
> no further dependencies of flush_scheduled_work().
>
> Acked-by: Tejun Heo <[email protected]>
> Signed-off-by: Amitoj Kaur Chawla <[email protected]>
Applied to the togreg branch of iio.git - initially pushed out as testing
for the autobuilders to play with it.

Thanks,

Jonathan
> ---
> drivers/iio/light/tsl2563.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/iio/light/tsl2563.c b/drivers/iio/light/tsl2563.c
> index 12731d6..57b108c 100644
> --- a/drivers/iio/light/tsl2563.c
> +++ b/drivers/iio/light/tsl2563.c
> @@ -806,8 +806,7 @@ static int tsl2563_probe(struct i2c_client *client,
> return 0;
>
> fail:
> - cancel_delayed_work(&chip->poweroff_work);
> - flush_scheduled_work();
> + cancel_delayed_work_sync(&chip->poweroff_work);
> return err;
> }
>
>