Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934170AbbHKJjf (ORCPT ); Tue, 11 Aug 2015 05:39:35 -0400 Received: from mailout2.samsung.com ([203.254.224.25]:46409 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755155AbbHKJjb (ORCPT ); Tue, 11 Aug 2015 05:39:31 -0400 X-AuditID: cbfee61b-f79706d000001b96-5d-55c9c2d02cab From: Jacek Anaszewski To: linux-leds@vger.kernel.org Cc: linux-kernel@vger.kernel.org, cooloney@gmail.com, rpurdie@rpsys.net, stsp@users.sourceforge.net, Andrew Lunn , Dan Murphy , Jacek Anaszewski Subject: [PATCH/RFC v5 23/57] leds: lp8860: Remove work queue Date: Tue, 11 Aug 2015 11:37:36 +0200 Message-id: <1439285890-27329-24-git-send-email-j.anaszewski@samsung.com> X-Mailer: git-send-email 1.7.9.5 In-reply-to: <1439285890-27329-1-git-send-email-j.anaszewski@samsung.com> References: <1439285890-27329-1-git-send-email-j.anaszewski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrCLMWRmVeSWpSXmKPExsVy+t9jQd0Lh06GGjxt47Y4f/cQs8XRnROZ LLpPb2G16L36nNHi8q45bBZb36xjtNi96ymrRWffNBYHDo+ds+6ye+zc8ZnJY8/8H6wefVtW MXocv7GdyaPpVDurx+dNcgHsUVw2Kak5mWWpRfp2CVwZ01fOZyxoFq+Yu6OHvYHxtVAXIyeH hICJxMknj5ggbDGJC/fWs3UxcnEICcxilHhy6h0zhPOTUWJC33QWkCo2AUOJny9eA3VwcIgI yEnsPFMJUsMscJ5RYsbBTmaQGmEBW4lt81eygtgsAqoS7z5cYwep5xXwlFj9SxHElBBQkJgz yQakghMoev35IkYQW0jAQ+L47Ca2CYy8CxgZVjFKpBYkFxQnpeca5aWW6xUn5haX5qXrJefn bmIEh90z6R2Mh3e5H2IU4GBU4gGafzJUiDWxrLgy9xCjBAezkghv4VSgEG9KYmVValF+fFFp TmrxIUZpDhYlcV59k02hQgLpiSWp2ampBalFMFkmDk6pBsYNUzJ2ivm4q6bXJoS2Ffn9vXj8 yuFV746Ylf+bvFPqSWGY15z53RKnV/ppvn608cHcZ+bv5Kr4VGWXMvlvEa9+ZFF2pPBsz/u1 zS5aryY6B73n8jF7OCf5y5K1tyVv3JjyXUjgiOneI3kfT057se7OTse9Zi0mkXpJwk1ZRrG+ Ozer7Q0+t1hFiaU4I9FQi7moOBEAE+PuQDcCAAA= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3094 Lines: 103 From: Andrew Lunn Now the core implements the work queue, remove it from the drivers. Signed-off-by: Andrew Lunn Cc: Dan Murphy Signed-off-by: Jacek Anaszewski --- drivers/leds/leds-lp8860.c | 25 ++++++------------------- 1 file changed, 6 insertions(+), 19 deletions(-) diff --git a/drivers/leds/leds-lp8860.c b/drivers/leds/leds-lp8860.c index 79f0843..e0d7afc 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; @@ -407,9 +395,9 @@ static int lp8860_probe(struct i2c_client *client, led->led_dev.name = led->label; led->led_dev.max_brightness = LED_FULL; led->led_dev.brightness_set = lp8860_brightness_set; + led->led_dev.flags |= LED_BRIGHTNESS_BLOCKING; mutex_init(&led->lock); - INIT_WORK(&led->work, lp8860_led_brightness_work); i2c_set_clientdata(client, led); @@ -448,7 +436,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); -- 1.7.9.5 -- 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/