Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757349AbbGQJMo (ORCPT ); Fri, 17 Jul 2015 05:12:44 -0400 Received: from mailout2.samsung.com ([203.254.224.25]:49595 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932321AbbGQIsZ (ORCPT ); Fri, 17 Jul 2015 04:48:25 -0400 X-AuditID: cbfee61a-f79516d000006302-b0-55a8c15818cd 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 , Jacek Anaszewski , Johan Hovold Subject: [PATCH/RFC 12/51] leds: lm3533: Remove work queue Date: Fri, 17 Jul 2015 10:46:58 +0200 Message-id: <1437122857-6765-13-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+NgFlrILMWRmVeSWpSXmKPExsVy+t9jAd2IgytCDXatU7c4f/cQs8XRnROZ LHqvPme0aLrRw2pxedccNoutb9YxWuze9ZTVorNvGosDh8fOWXfZPTat6mTz2LnjM5PHnvk/ WD36tqxi9Gg61c7q8XmTXAB7FJdNSmpOZllqkb5dAlfG4U9XWQv2iFXM2v+CpYHxpFAXIyeH hICJxNz+NUwQtpjEhXvr2boYuTiEBBYxSkx70MIKkhAS+Mko0XwxAsRmEzCU+PniNVADB4eI gJzEzjOVIPXMApcZJTbu7mEDqREWsJLof7CNHcRmEVCVeL3wJFicV8BDYuaaoywgvRICChJz JtmAhDmBwu8frGSBWOUu0fbnItsERt4FjAyrGEVTC5ILipPScw31ihNzi0vz0vWS83M3MYID 7pnUDsaVDRaHGAU4GJV4eBtcV4QKsSaWFVfmHmKU4GBWEuGt3AkU4k1JrKxKLcqPLyrNSS0+ xCjNwaIkznsy3ydUSCA9sSQ1OzW1ILUIJsvEwSnVwNiUpVDQc+6K+IZN/e43cj64cpUwB68u viUz97Ku97Pp99xfBZaxF4bvK7tVxqBb/fDGqUeHl+xt3PU3v4Pxa3Vpp2bMhte8yWYmOq2b 93vN1Z14cI7BjCWeQexxaYwLTbUMtJO3n/gbL+Vsbj/tWsGenL5dn072zXGV9DQq+LFNXvja v+56XyWW4oxEQy3mouJEAHSA2BI0AgAA Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3019 Lines: 107 From: Andrew Lunn Now the core implements the work queue, remove it from the driver. Signed-off-by: Andrew Lunn Signed-off-by: Jacek Anaszewski Cc: Johan Hovold --- drivers/leds/leds-lm3533.c | 30 ++++++------------------------ 1 file changed, 6 insertions(+), 24 deletions(-) diff --git a/drivers/leds/leds-lm3533.c b/drivers/leds/leds-lm3533.c index 6e2e020..52496d8 100644 --- a/drivers/leds/leds-lm3533.c +++ b/drivers/leds/leds-lm3533.c @@ -17,7 +17,6 @@ #include #include #include -#include #include @@ -53,9 +52,6 @@ struct lm3533_led { struct mutex mutex; unsigned long flags; - - struct work_struct work; - u8 new_brightness; }; @@ -123,27 +119,17 @@ out: return ret; } -static void lm3533_led_work(struct work_struct *work) -{ - struct lm3533_led *led = container_of(work, struct lm3533_led, work); - - dev_dbg(led->cdev.dev, "%s - %u\n", __func__, led->new_brightness); - - if (led->new_brightness == 0) - lm3533_led_pattern_enable(led, 0); /* disable blink */ - - lm3533_ctrlbank_set_brightness(&led->cb, led->new_brightness); -} - static void lm3533_led_set(struct led_classdev *cdev, - enum led_brightness value) + enum led_brightness value) { struct lm3533_led *led = to_lm3533_led(cdev); - dev_dbg(led->cdev.dev, "%s - %d\n", __func__, value); + dev_dbg(led->cdev.dev, "%s - %u\n", __func__, value); + + if (value == 0) + lm3533_led_pattern_enable(led, 0); /* disable blink */ - led->new_brightness = value; - schedule_work(&led->work); + lm3533_ctrlbank_set_brightness(&led->cb, value); } static enum led_brightness lm3533_led_get(struct led_classdev *cdev) @@ -701,7 +687,6 @@ static int lm3533_led_probe(struct platform_device *pdev) led->id = pdev->id; mutex_init(&led->mutex); - INIT_WORK(&led->work, lm3533_led_work); /* The class framework makes a callback to get brightness during * registration so use parent device (for error reporting) until @@ -733,7 +718,6 @@ static int lm3533_led_probe(struct platform_device *pdev) err_unregister: led_classdev_unregister(&led->cdev); - flush_work(&led->work); return ret; } @@ -746,7 +730,6 @@ static int lm3533_led_remove(struct platform_device *pdev) lm3533_ctrlbank_disable(&led->cb); led_classdev_unregister(&led->cdev); - flush_work(&led->work); return 0; } @@ -760,7 +743,6 @@ static void lm3533_led_shutdown(struct platform_device *pdev) lm3533_ctrlbank_disable(&led->cb); lm3533_led_set(&led->cdev, LED_OFF); /* disable blink */ - flush_work(&led->work); } static struct platform_driver lm3533_led_driver = { -- 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/