Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752390AbbGQNxU (ORCPT ); Fri, 17 Jul 2015 09:53:20 -0400 Received: from bear.ext.ti.com ([192.94.94.41]:39673 "EHLO bear.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750795AbbGQNxR (ORCPT ); Fri, 17 Jul 2015 09:53:17 -0400 Message-ID: <55A908B2.1070407@ti.com> Date: Fri, 17 Jul 2015 08:52:50 -0500 From: Dan Murphy User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: Jacek Anaszewski , CC: , , , , Andrew Lunn Subject: Re: [PATCH/RFC 18/51] leds: lp8860: Remove work queue References: <1437122857-6765-1-git-send-email-j.anaszewski@samsung.com> <1437122857-6765-19-git-send-email-j.anaszewski@samsung.com> In-Reply-To: <1437122857-6765-19-git-send-email-j.anaszewski@samsung.com> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3208 Lines: 107 On 07/17/2015 03:47 AM, Jacek Anaszewski wrote: > From: Andrew Lunn > > Now the core implements the work queue, remove it from the drivers. > > Signed-off-by: Andrew Lunn > Cc: Dan Murphy > --- > drivers/leds/leds-lp8860.c | 24 +++++------------------- > 1 file changed, 5 insertions(+), 19 deletions(-) > > diff --git a/drivers/leds/leds-lp8860.c b/drivers/leds/leds-lp8860.c > index 8c2b7fb..40e0ed8 100644 > --- a/drivers/leds/leds-lp8860.c > +++ b/drivers/leds/leds-lp8860.c > @@ -91,26 +91,22 @@ > /** > * struct lp8860_led - > * @lock - Lock for reading/writing the device > - * @work - Work item used to off load the brightness register writes > * @client - Pointer to the I2C client > * @led_dev - led class device pointer > * @regmap - Devices register map > * @eeprom_regmap - EEPROM register map > * @enable_gpio - VDDIO/EN gpio to enable communication interface > * @regulator - LED supply regulator pointer > - * @brightness - Current brightness value requested > * @label - LED label > **/ > struct lp8860_led { > struct mutex lock; > - struct work_struct work; > struct i2c_client *client; > struct led_classdev led_dev; > struct regmap *regmap; > struct regmap *eeprom_regmap; > struct gpio_desc *enable_gpio; > struct regulator *regulator; > - enum led_brightness brightness; > const char *label; > }; > > @@ -212,11 +208,13 @@ out: > return ret; > } > > -static void lp8860_led_brightness_work(struct work_struct *work) > +static void lp8860_brightness_set(struct led_classdev *led_cdev, > + enum led_brightness brt_val) > { > - struct lp8860_led *led = container_of(work, struct lp8860_led, work); > + struct lp8860_led *led = > + container_of(led_cdev, struct lp8860_led, led_dev); > + int disp_brightness = brt_val * 255; > int ret; > - int disp_brightness = led->brightness * 255; > > mutex_lock(&led->lock); > > @@ -243,16 +241,6 @@ out: > mutex_unlock(&led->lock); > } > > -static void lp8860_brightness_set(struct led_classdev *led_cdev, > - enum led_brightness brt_val) > -{ > - struct lp8860_led *led = > - container_of(led_cdev, struct lp8860_led, led_dev); > - > - led->brightness = brt_val; > - schedule_work(&led->work); > -} > - > static int lp8860_init(struct lp8860_led *led) > { > unsigned int read_buf; > @@ -409,7 +397,6 @@ static int lp8860_probe(struct i2c_client *client, > led->led_dev.brightness_set = lp8860_brightness_set; > > mutex_init(&led->lock); > - INIT_WORK(&led->work, lp8860_led_brightness_work); > > i2c_set_clientdata(client, led); > > @@ -448,7 +435,6 @@ static int lp8860_remove(struct i2c_client *client) > int ret; > > led_classdev_unregister(&led->led_dev); > - cancel_work_sync(&led->work); > > if (led->enable_gpio) > gpiod_direction_output(led->enable_gpio, 0); Thanks! Acked-by: Dan Murphy -- ------------------ Dan Murphy -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/