Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932359AbbGQIs1 (ORCPT ); Fri, 17 Jul 2015 04:48:27 -0400 Received: from mailout2.samsung.com ([203.254.224.25]:50381 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932065AbbGQIsT (ORCPT ); Fri, 17 Jul 2015 04:48:19 -0400 X-AuditID: cbfee61a-f79516d000006302-a9-55a8c152ea5b 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 , Kim Kyuwon Subject: [PATCH/RFC 10/51] leds: bd2802: Remove work queue Date: Fri, 17 Jul 2015 10:46:56 +0200 Message-id: <1437122857-6765-11-git-send-email-j.anaszewski@samsung.com> X-Mailer: git-send-email 1.7.9.5 In-reply-to: <1437122857-6765-1-git-send-email-j.anaszewski@samsung.com> References: <1437122857-6765-1-git-send-email-j.anaszewski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprOLMWRmVeSWpSXmKPExsVy+t9jAd2ggytCDV68UrM4f/cQs8XRnROZ LC7vmsNmsfXNOkaLjY9mMVns3vWU1aKzbxqLA7vHzll3gcSOz0wee+b/YPXo27KK0aPpVDur x+dNcgFsUVw2Kak5mWWpRfp2CVwZC25fZi1YJVbxeP8apgbGJqEuRk4OCQETiSsrZrFA2GIS F+6tZwOxhQQWMUrM7DHqYuQCsn8ySsxevAusiE3AUOLni9dMXYwcHCICchI7z1SC1DALLGOU +D5hKStIjbCAlcTdb61gg1gEVCXal1xkBLF5BTwkFjdOZgXplRBQkJgzyQYkzAkUfv9gJQvE XneJtj8X2SYw8i5gZFjFKJpakFxQnJSea6hXnJhbXJqXrpecn7uJERxcz6R2MK5ssDjEKMDB qMTD2+C6IlSINbGsuDL3EKMEB7OSCG/lTqAQb0piZVVqUX58UWlOavEhRmkOFiVx3pP5PqFC AumJJanZqakFqUUwWSYOTqkGxuLXoZweLfP5OM5N2Xy9dMqTwsDWNwF7+b/KJv+/MKvxX99W hoRja2eZmjhtWH/JOM/z5EvZjnd317pt7VrvuLHmlPPNm/c7vwsflOySTGQ7YbDr/4I0Z3lW zyAv9ZsVLE2pbtXC+cmqOduVWIJftJ9In1cu/UvZcGrChB/c++uuWnocXvy3UImlOCPRUIu5 qDgRAHLTd7YqAgAA Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3018 Lines: 90 From: Andrew Lunn Now the core implements the work queue, remove it from the driver. Signed-off-by: Andrew Lunn Cc: Kim Kyuwon --- drivers/leds/leds-bd2802.c | 24 ++++++------------------ 1 file changed, 6 insertions(+), 18 deletions(-) diff --git a/drivers/leds/leds-bd2802.c b/drivers/leds/leds-bd2802.c index 6078c15d..19113c0 100644 --- a/drivers/leds/leds-bd2802.c +++ b/drivers/leds/leds-bd2802.c @@ -72,7 +72,6 @@ struct bd2802_led { struct bd2802_led_platform_data *pdata; struct i2c_client *client; struct rw_semaphore rwsem; - struct work_struct work; struct led_state led[2]; @@ -518,16 +517,6 @@ static struct device_attribute *bd2802_attributes[] = { &bd2802_rgb_current_attr, }; -static void bd2802_led_work(struct work_struct *work) -{ - struct bd2802_led *led = container_of(work, struct bd2802_led, work); - - if (led->state) - bd2802_turn_on(led, led->led_id, led->color, led->state); - else - bd2802_turn_off(led, led->led_id, led->color); -} - #define BD2802_CONTROL_RGBS(name, id, clr) \ static void bd2802_set_##name##_brightness(struct led_classdev *led_cdev,\ enum led_brightness value) \ @@ -536,11 +525,13 @@ static void bd2802_set_##name##_brightness(struct led_classdev *led_cdev,\ container_of(led_cdev, struct bd2802_led, cdev_##name); \ led->led_id = id; \ led->color = clr; \ - if (value == LED_OFF) \ + if (value == LED_OFF) { \ led->state = BD2802_OFF; \ - else \ + bd2802_turn_off(led, led->led_id, led->color); \ + } else { \ led->state = BD2802_ON; \ - schedule_work(&led->work); \ + bd2802_turn_on(led, led->led_id, led->color, BD2802_ON);\ + } \ } \ static int bd2802_set_##name##_blink(struct led_classdev *led_cdev, \ unsigned long *delay_on, unsigned long *delay_off) \ @@ -552,7 +543,7 @@ static int bd2802_set_##name##_blink(struct led_classdev *led_cdev, \ led->led_id = id; \ led->color = clr; \ led->state = BD2802_BLINK; \ - schedule_work(&led->work); \ + bd2802_turn_on(led, led->led_id, led->color, BD2802_BLINK); \ return 0; \ } @@ -567,8 +558,6 @@ static int bd2802_register_led_classdev(struct bd2802_led *led) { int ret; - INIT_WORK(&led->work, bd2802_led_work); - led->cdev_led1r.name = "led1_R"; led->cdev_led1r.brightness = LED_OFF; led->cdev_led1r.brightness_set = bd2802_set_led1r_brightness; @@ -661,7 +650,6 @@ failed_unregister_led1_R: static void bd2802_unregister_led_classdev(struct bd2802_led *led) { - cancel_work_sync(&led->work); led_classdev_unregister(&led->cdev_led2b); led_classdev_unregister(&led->cdev_led2g); led_classdev_unregister(&led->cdev_led2r); -- 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/