Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965077AbbHKJw3 (ORCPT ); Tue, 11 Aug 2015 05:52:29 -0400 Received: from mailout3.samsung.com ([203.254.224.33]:40156 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964821AbbHKJi5 (ORCPT ); Tue, 11 Aug 2015 05:38:57 -0400 X-AuditID: cbfee61b-f79706d000001b96-15-55c9c2af6720 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 Subject: [PATCH/RFC v5 12/57] leds: tlc591xx: Remove work queue Date: Tue, 11 Aug 2015 11:37:25 +0200 Message-id: <1439285890-27329-13-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+NgFprFLMWRmVeSWpSXmKPExsVy+t9jQd31h06GGnRM1bU4f/cQs8XRnROZ LHqvPme0uLxrDpvF1jfrGC1273rKatHZN43Fgd1j56y7QGLHZyaPPfN/sHr0bVnF6NF0qp3V 4/MmuQC2KC6blNSczLLUIn27BK6MezcPshR0iFQcanzH0sB4UqCLkZNDQsBEYuPNBYwQtpjE hXvr2boYuTiEBGYxSrxsmsUK4fxklNj5uokdpIpNwFDi54vXTF2MHBwiAnISO89UgtQwC2xi lLh8tIsVpEZYwF7i+bHLYDUsAqoSr+6JgoR5BTwlFt5pYgYJSwgoSMyZZAMS5gQKX3++COwG IQEPieOzm9gmMPIuYGRYxSiRWpBcUJyUnmuUl1quV5yYW1yal66XnJ+7iREcYs+kdzAe3uV+ iFGAg1GJB2jByVAh1sSy4srcQ4wSHMxKIryFU4FCvCmJlVWpRfnxRaU5qcWHGKU5WJTEefVN NoUKCaQnlqRmp6YWpBbBZJk4OKUaGE1ywureMxo8dnt7QeOSxYp5pZ82u98QrHgUbNtny1wY OG/Dau3jXiy+fCGTpzXv/Kb9uOmw5Jl05w3vVS6Wb/30zOj3xG0fFy9dv+d6W69H5BM3Xl/u GE2m6TVdIkGy684+vtxZ8VDDSv1ByYYfDYsutZ2eaa4ysXt1o6/+yrC10ee1CtYuOKLEUpyR aKjFXFScCACHlLNsLQIAAA== Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2723 Lines: 95 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 --- drivers/leds/leds-tlc591xx.c | 25 +++++-------------------- 1 file changed, 5 insertions(+), 20 deletions(-) diff --git a/drivers/leds/leds-tlc591xx.c b/drivers/leds/leds-tlc591xx.c index b806eca..f7e6711 100644 --- a/drivers/leds/leds-tlc591xx.c +++ b/drivers/leds/leds-tlc591xx.c @@ -14,7 +14,6 @@ #include #include #include -#include #define TLC591XX_MAX_LEDS 16 @@ -42,13 +41,11 @@ #define LEDOUT_MASK 0x3 #define ldev_to_led(c) container_of(c, struct tlc591xx_led, ldev) -#define work_to_led(work) container_of(work, struct tlc591xx_led, work) struct tlc591xx_led { bool active; unsigned int led_no; struct led_classdev ldev; - struct work_struct work; struct tlc591xx_priv *priv; }; @@ -111,11 +108,11 @@ tlc591xx_set_pwm(struct tlc591xx_priv *priv, struct tlc591xx_led *led, } static void -tlc591xx_led_work(struct work_struct *work) +tlc591xx_brightness_set(struct led_classdev *led_cdev, + enum led_brightness brightness) { - struct tlc591xx_led *led = work_to_led(work); + struct tlc591xx_led *led = ldev_to_led(led_cdev); struct tlc591xx_priv *priv = led->priv; - enum led_brightness brightness = led->ldev.brightness; int err; switch (brightness) { @@ -136,25 +133,13 @@ tlc591xx_led_work(struct work_struct *work) } static void -tlc591xx_brightness_set(struct led_classdev *led_cdev, - enum led_brightness brightness) -{ - struct tlc591xx_led *led = ldev_to_led(led_cdev); - - led->ldev.brightness = brightness; - schedule_work(&led->work); -} - -static void tlc591xx_destroy_devices(struct tlc591xx_priv *priv, unsigned int j) { int i = j; while (--i >= 0) { - if (priv->leds[i].active) { + if (priv->leds[i].active) led_classdev_unregister(&priv->leds[i].ldev); - cancel_work_sync(&priv->leds[i].work); - } } } @@ -177,7 +162,7 @@ tlc591xx_configure(struct device *dev, led->led_no = i; led->ldev.brightness_set = tlc591xx_brightness_set; led->ldev.max_brightness = LED_FULL; - INIT_WORK(&led->work, tlc591xx_led_work); + led->ldev.flags |= LED_BRIGHTNESS_BLOCKING; err = led_classdev_register(dev, &led->ldev); if (err < 0) { dev_err(dev, "couldn't register LED %s\n", -- 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/