Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964977AbbHKJry (ORCPT ); Tue, 11 Aug 2015 05:47:54 -0400 Received: from mailout4.samsung.com ([203.254.224.34]:60724 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965085AbbHKJkL (ORCPT ); Tue, 11 Aug 2015 05:40:11 -0400 X-AuditID: cbfee61a-f79a06d000005c6f-bb-55c9c2e92c4b 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 32/57] leds: mc13783: Remove work queue Date: Tue, 11 Aug 2015 11:37:45 +0200 Message-id: <1439285890-27329-33-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+t9jQd2Xh06GGlxuV7E4f/cQs8XRnROZ LHqvPme0uLxrDpvF1jfrGC1273rKatHZN43Fgd1j56y7QGLHZyaPPfN/sHr0bVnF6NF0qp3V 4/MmuQC2KC6blNSczLLUIn27BK6M06dWsBb8Fq+4uuwWSwPjfeEuRk4OCQETifWftzFC2GIS F+6tZwOxhQRmMUocWabSxcgFZP9klNg65y8TSIJNwFDi54vXQDYHh4iAnMTOM5UgNcwCmxgl Lh/tYgWpERawk9h0YzELiM0ioCox5+BlsF5eAU+Je4t7GUF6JQQUJOZMsgEJcwKFrz9fxAix 10Pi+OwmtgmMvAsYGVYxSqQWJBcUJ6XnGuallusVJ+YWl+al6yXn525iBIfYM6kdjAd3uR9i FOBgVOIBWnAyVIg1say4MvcQowQHs5IIb+FUoBBvSmJlVWpRfnxRaU5q8SFGaQ4WJXFe2Q2b Q4UE0hNLUrNTUwtSi2CyTBycUg2MXStZTNbuvPX20unK6Cd7LK8W/3J5f9/IbqKU4zOupITZ sSLtLcVvz7VsUfr2ecpvnj6u+cVZJlOv/L4i4yskt3r9m9CDatYvVsvPtBc82eg21e35DpvE DUq/haN0Hzy6MCXji0mYxKNPb+M7o45J9qg4tkccct/63jw/OPLByhizYB7ZnBZOJZbijERD Leai4kQAmQnhJy0CAAA= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3211 Lines: 106 From: Andrew Lunn Now the core implements the work queue, remove it from the drivers. Signed-off-by: Andrew Lunn Signed-off-by: Jacek Anaszewski --- drivers/leds/leds-mc13783.c | 32 ++++++++------------------------ 1 file changed, 8 insertions(+), 24 deletions(-) diff --git a/drivers/leds/leds-mc13783.c b/drivers/leds/leds-mc13783.c index e2b847f..17909dd 100644 --- a/drivers/leds/leds-mc13783.c +++ b/drivers/leds/leds-mc13783.c @@ -20,7 +20,6 @@ #include #include #include -#include #include struct mc13xxx_led_devtype { @@ -32,8 +31,6 @@ struct mc13xxx_led_devtype { struct mc13xxx_led { struct led_classdev cdev; - struct work_struct work; - enum led_brightness new_brightness; int id; struct mc13xxx_leds *leds; }; @@ -55,9 +52,11 @@ static unsigned int mc13xxx_max_brightness(int id) return 0x3f; } -static void mc13xxx_led_work(struct work_struct *work) +static void mc13xxx_led_set(struct led_classdev *led_cdev, + enum led_brightness value) { - struct mc13xxx_led *led = container_of(work, struct mc13xxx_led, work); + struct mc13xxx_led *led = + container_of(led_cdev, struct mc13xxx_led, cdev); struct mc13xxx_leds *leds = led->leds; unsigned int reg, bank, off, shift; @@ -107,17 +106,7 @@ static void mc13xxx_led_work(struct work_struct *work) mc13xxx_reg_rmw(leds->master, leds->devtype->ledctrl_base + reg, mc13xxx_max_brightness(led->id) << shift, - led->new_brightness << shift); -} - -static void mc13xxx_led_set(struct led_classdev *led_cdev, - enum led_brightness value) -{ - struct mc13xxx_led *led = - container_of(led_cdev, struct mc13xxx_led, cdev); - - led->new_brightness = value; - schedule_work(&led->work); + value << shift); } #ifdef CONFIG_OF @@ -259,8 +248,7 @@ static int __init mc13xxx_led_probe(struct platform_device *pdev) leds->led[i].cdev.flags = LED_CORE_SUSPENDRESUME; leds->led[i].cdev.brightness_set = mc13xxx_led_set; leds->led[i].cdev.max_brightness = mc13xxx_max_brightness(id); - - INIT_WORK(&leds->led[i].work, mc13xxx_led_work); + leds->led[i].cdev.flags |= LED_BRIGHTNESS_BLOCKING; ret = led_classdev_register(dev->parent, &leds->led[i].cdev); if (ret) { @@ -270,10 +258,8 @@ static int __init mc13xxx_led_probe(struct platform_device *pdev) } if (ret) - while (--i >= 0) { + while (--i >= 0) led_classdev_unregister(&leds->led[i].cdev); - cancel_work_sync(&leds->led[i].work); - } return ret; } @@ -283,10 +269,8 @@ static int mc13xxx_led_remove(struct platform_device *pdev) struct mc13xxx_leds *leds = platform_get_drvdata(pdev); int i; - for (i = 0; i < leds->num_leds; i++) { + for (i = 0; i < leds->num_leds; i++) led_classdev_unregister(&leds->led[i].cdev); - cancel_work_sync(&leds->led[i].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/