Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965031AbbHKJjj (ORCPT ); Tue, 11 Aug 2015 05:39:39 -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 S1755088AbbHKJj3 (ORCPT ); Tue, 11 Aug 2015 05:39:29 -0400 X-AuditID: cbfee61b-f79706d000001b96-57-55c9c2cdb3c4 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 , Milo Kim , Jacek Anaszewski Subject: [PATCH/RFC v5 22/57] leds: lp8788: Remove work queue Date: Tue, 11 Aug 2015 11:37:35 +0200 Message-id: <1439285890-27329-23-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+NgFlrKLMWRmVeSWpSXmKPExsVy+t9jQd2zh06GGmzv4LM4f/cQs8XRnROZ LHqvPme0uLxrDpvF1jfrGC2W/1rHYrF711NWi86+aSwOHB47Z91l99i54zOTx575P1g9+ras YvQ4fmM7k0fTqXZWj8+b5ALYo7hsUlJzMstSi/TtErgyDp6bxlywVqSiY/EtpgbGjwJdjJwc EgImErMu/WaHsMUkLtxbz9bFyMUhJDCLUeLu1d8sEM5PRon2D5tYQarYBAwlfr54zdTFyMEh IiAnsfNMJUgNs8A5Ronfi0+B1QgL2Ep8b10GZrMIqErsuzIBbAOvgKfEybNnWEB6JQQUJOZM sgEJcwKFrz9fxAhiCwl4SByf3cQ2gZF3ASPDKkaJ1ILkguKk9FyjvNRyveLE3OLSvHS95Pzc TYzgwHsmvYPx8C73Q4wCHIxKPEALToYKsSaWFVfmHmKU4GBWEuEtnAoU4k1JrKxKLcqPLyrN SS0+xCjNwaIkzqtvsilUSCA9sSQ1OzW1ILUIJsvEwSnVwOiWrL0pd/U6ke1zWho2xvNxSP/z 2f2xliHGp2kB14JJb3cckbn9PsIu93iyqNvsu5s9Zs5v4o1OivzMfu30rZSfT6Vdrl/+0Pgt /NC5INdkqcsFGtJSO34F6XEvmnz+KQe385nEO5ax8hc0P2zTU+78N9Hob0fJLk8tn6oJRqXv 501m5D68k0WJpTgj0VCLuag4EQD+gUkzOAIAAA== Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2762 Lines: 93 From: Andrew Lunn Now the core implements the work queue, remove it from the drivers. Signed-off-by: Andrew Lunn Cc: Milo Kim Signed-off-by: Jacek Anaszewski --- drivers/leds/leds-lp8788.c | 23 ++++++----------------- 1 file changed, 6 insertions(+), 17 deletions(-) diff --git a/drivers/leds/leds-lp8788.c b/drivers/leds/leds-lp8788.c index 3409f03..b8adacb 100644 --- a/drivers/leds/leds-lp8788.c +++ b/drivers/leds/leds-lp8788.c @@ -26,10 +26,8 @@ struct lp8788_led { struct lp8788 *lp; struct mutex lock; - struct work_struct work; struct led_classdev led_dev; enum lp8788_isink_number isink_num; - enum led_brightness brightness; int on; }; @@ -88,12 +86,14 @@ static void lp8788_led_enable(struct lp8788_led *led, led->on = on; } -static void lp8788_led_work(struct work_struct *work) +static void lp8788_brightness_set(struct led_classdev *led_cdev, + enum led_brightness val) { - struct lp8788_led *led = container_of(work, struct lp8788_led, work); + struct lp8788_led *led = + container_of(led_cdev, struct lp8788_led, led_dev); + enum lp8788_isink_number num = led->isink_num; int enable; - u8 val = led->brightness; mutex_lock(&led->lock); @@ -115,16 +115,6 @@ static void lp8788_led_work(struct work_struct *work) mutex_unlock(&led->lock); } -static void lp8788_brightness_set(struct led_classdev *led_cdev, - enum led_brightness brt_val) -{ - struct lp8788_led *led = - container_of(led_cdev, struct lp8788_led, led_dev); - - led->brightness = brt_val; - schedule_work(&led->work); -} - static int lp8788_led_probe(struct platform_device *pdev) { struct lp8788 *lp = dev_get_drvdata(pdev->dev.parent); @@ -140,6 +130,7 @@ static int lp8788_led_probe(struct platform_device *pdev) led->lp = lp; led->led_dev.max_brightness = MAX_BRIGHTNESS; led->led_dev.brightness_set = lp8788_brightness_set; + led->led_dev.flags |= LED_BRIGHTNESS_BLOCKING; led_pdata = lp->pdata ? lp->pdata->led_pdata : NULL; @@ -149,7 +140,6 @@ static int lp8788_led_probe(struct platform_device *pdev) led->led_dev.name = led_pdata->name; mutex_init(&led->lock); - INIT_WORK(&led->work, lp8788_led_work); platform_set_drvdata(pdev, led); @@ -173,7 +163,6 @@ static int lp8788_led_remove(struct platform_device *pdev) struct lp8788_led *led = platform_get_drvdata(pdev); led_classdev_unregister(&led->led_dev); - flush_work(&led->work); return 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/