Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964815AbbHKJis (ORCPT ); Tue, 11 Aug 2015 05:38:48 -0400 Received: from mailout4.samsung.com ([203.254.224.34]:56022 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933927AbbHKJip (ORCPT ); Tue, 11 Aug 2015 05:38:45 -0400 X-AuditID: cbfee61a-f79a06d000005c6f-27-55c9c2a408cd 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, Jacek Anaszewski , Sakari Ailus , Ingi Kim Subject: [PATCH/RFC v5 08/57] leds: ktd2692: Remove work queue Date: Tue, 11 Aug 2015 11:37:21 +0200 Message-id: <1439285890-27329-9-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+NgFprHLMWRmVeSWpSXmKPExsVy+t9jQd0lh06GGuy5K2NxdOdEJosdN7+w WfRefc5ocXnXHDaLrW/WMVrs3vWU1eLTlm9MFp1901gcODx2zrrL7jHvZKDHnvk/WD36tqxi 9Gg61c7q8XmTXABbFJdNSmpOZllqkb5dAlfGs31XWQu+S1RMvnmSrYGxR7SLkZNDQsBEYumW pywQtpjEhXvr2UBsIYFZjBJb30V0MXIB2T8ZJdbsXAKWYBMwlPj54jVTFyMHh4iAnMTOM5Ug NcwCjxklXv44ATZIWMBOYvLtdnYQm0VAVWLF6c2sIDavgIfExQ8TmUF6JQQUJOZMsgEJcwp4 Slx/vogRYq+HxPHZTWwTGHkXMDKsYpRILUguKE5KzzXMSy3XK07MLS7NS9dLzs/dxAgOtWdS OxgP7nI/xCjAwajEwyvgeTJUiDWxrLgy9xCjBAezkghv4VSgEG9KYmVValF+fFFpTmrxIUZp DhYlcV7ZDZtDhQTSE0tSs1NTC1KLYLJMHJxSDYxnS9u1Pqtk/eh9yfTr8+wnygdfvQq2kkzr nXQu5YLhe0Vhbfsv6rfnLeL89k5lKn/J9vt8a5TmLbNJjTnCULFmT8vvFa/17s2W+noiV/Kh WPgT6TeC5w+nzWf/NOOQ2PHiqLWLtxX5vWPzu16+S0HuVn2ycIEgf5yP393KrBOb+H8p7vuj PFFKiaU4I9FQi7moOBEA6NwiZjECAAA= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3342 Lines: 99 Now the core implements the work queue, remove it from the drivers. Signed-off-by: Jacek Anaszewski Cc: Sakari Ailus Cc: Bryan Wu Cc: Ingi Kim --- drivers/leds/leds-ktd2692.c | 32 +++++++------------------------- 1 file changed, 7 insertions(+), 25 deletions(-) diff --git a/drivers/leds/leds-ktd2692.c b/drivers/leds/leds-ktd2692.c index 7f6758d..fc7f253 100644 --- a/drivers/leds/leds-ktd2692.c +++ b/drivers/leds/leds-ktd2692.c @@ -18,7 +18,6 @@ #include #include #include -#include /* Value related the movie mode */ #define KTD2692_MOVIE_MODE_CURRENT_LEVELS 16 @@ -82,7 +81,6 @@ struct ktd2692_context { /* secures access to the device */ struct mutex lock; struct regulator *regulator; - struct work_struct work_brightness_set; struct gpio_desc *aux_gpio; struct gpio_desc *ctrl_gpio; @@ -158,9 +156,12 @@ static void ktd2692_expresswire_write(struct ktd2692_context *led, u8 value) ktd2692_expresswire_end(led); } -static void ktd2692_brightness_set(struct ktd2692_context *led, - enum led_brightness brightness) +static void ktd2692_led_brightness_set(struct led_classdev *led_cdev, + enum led_brightness brightness) { + struct led_classdev_flash *fled_cdev = lcdev_to_flcdev(led_cdev); + struct ktd2692_context *led = fled_cdev_to_led(fled_cdev); + mutex_lock(&led->lock); if (brightness == LED_OFF) { @@ -176,24 +177,6 @@ static void ktd2692_brightness_set(struct ktd2692_context *led, mutex_unlock(&led->lock); } -static void ktd2692_brightness_set_work(struct work_struct *work) -{ - struct ktd2692_context *led = - container_of(work, struct ktd2692_context, work_brightness_set); - - ktd2692_brightness_set(led, led->torch_brightness); -} - -static void ktd2692_led_brightness_set(struct led_classdev *led_cdev, - enum led_brightness brightness) -{ - struct led_classdev_flash *fled_cdev = lcdev_to_flcdev(led_cdev); - struct ktd2692_context *led = fled_cdev_to_led(fled_cdev); - - led->torch_brightness = brightness; - schedule_work(&led->work_brightness_set); -} - static int ktd2692_led_flash_strobe_set(struct led_classdev_flash *fled_cdev, bool state) { @@ -371,10 +354,10 @@ static int ktd2692_probe(struct platform_device *pdev) led_cdev->max_brightness = led_cfg.max_brightness; led_cdev->brightness_set = ktd2692_led_brightness_set; - led_cdev->flags |= LED_CORE_SUSPENDRESUME | LED_DEV_CAP_FLASH; + led_cdev->flags |= LED_CORE_SUSPENDRESUME | LED_DEV_CAP_FLASH | + LED_BRIGHTNESS_BLOCKING; mutex_init(&led->lock); - INIT_WORK(&led->work_brightness_set, ktd2692_brightness_set_work); platform_set_drvdata(pdev, led); @@ -396,7 +379,6 @@ static int ktd2692_remove(struct platform_device *pdev) int ret; led_classdev_flash_unregister(&led->fled_cdev); - cancel_work_sync(&led->work_brightness_set); if (led->regulator) { ret = regulator_disable(led->regulator); -- 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/