Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932399AbbGQIsj (ORCPT ); Fri, 17 Jul 2015 04:48:39 -0400 Received: from mailout3.samsung.com ([203.254.224.33]:56712 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932065AbbGQIsc (ORCPT ); Fri, 17 Jul 2015 04:48:32 -0400 X-AuditID: cbfee61a-f79516d000006302-a8-55a8c14f9c8c 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 , Michael Hennerich Subject: [PATCH/RFC 09/51] leds: adp5520: Remove work queue Date: Fri, 17 Jul 2015 10:46:55 +0200 Message-id: <1437122857-6765-10-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+NgFprGLMWRmVeSWpSXmKPExsVy+t9jAV3/gytCDS4s07c4f/cQs8XRnROZ LC7vmsNmsfXNOkaLCYc3s1vs3vWU1aKzbxqLA7vHq6uOHjtn3WX32LnjM5PHnvk/WD2aTrWz enzeJBfAFsVlk5Kak1mWWqRvl8CVse7CWdaCN0IVnZtvMTUwruDvYuTkkBAwkbi6+gsbhC0m ceHeeiCbi0NIYBGjRPPvX1DOT0aJE7Nus4NUsQkYSvx88Zqpi5GDQ0RATmLnmUqQMLPAdkaJ BxNTQGxhAWuJWyd+MIHYLAKqErMezmIGsXkFPCReXZjFAtIqIaAgMWeSDUiYEyj8/sFKFhBb SMBdou3PRbYJjLwLGBlWMYqmFiQXFCel5xrqFSfmFpfmpesl5+duYgSH1jOpHYwrGywOMQpw MCrx8Da4rggVYk0sK67MPcQowcGsJMJbuRMoxJuSWFmVWpQfX1Sak1p8iFGag0VJnPdkvk+o kEB6YklqdmpqQWoRTJaJg1OqgdHovOy5hYu3qn/3Uciad6h425sL2+7HPnYU59U7MldfYVIo 78zgqKdq52ov73/cp9p1jcdpd6zwwuua7Kze/dINCy8/9D131St7Rn/i2s1+i858V1M1YZac 65nBMFXh5Huvv+WBm2vfv6503KFy7BPj5Owkmd/xFTYOOYEy+4/PD+a9/nOvQagSS3FGoqEW c1FxIgB48lLZKQIAAA== Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2573 Lines: 89 From: Andrew Lunn Now the core implements the work queue, remove it from the driver. Signed-off-by: Andrew Lunn Cc: Michael Hennerich --- drivers/leds/leds-adp5520.c | 22 +++------------------- 1 file changed, 3 insertions(+), 19 deletions(-) diff --git a/drivers/leds/leds-adp5520.c b/drivers/leds/leds-adp5520.c index 07e66ca..6378150 100644 --- a/drivers/leds/leds-adp5520.c +++ b/drivers/leds/leds-adp5520.c @@ -17,34 +17,24 @@ #include #include #include -#include #include #include struct adp5520_led { struct led_classdev cdev; - struct work_struct work; struct device *master; - enum led_brightness new_brightness; int id; int flags; }; -static void adp5520_led_work(struct work_struct *work) -{ - struct adp5520_led *led = container_of(work, struct adp5520_led, work); - adp5520_write(led->master, ADP5520_LED1_CURRENT + led->id - 1, - led->new_brightness >> 2); -} - static void adp5520_led_set(struct led_classdev *led_cdev, enum led_brightness value) { struct adp5520_led *led; led = container_of(led_cdev, struct adp5520_led, cdev); - led->new_brightness = value; - schedule_work(&led->work); + adp5520_write(led->master, ADP5520_LED1_CURRENT + led->id - 1, + value >> 2); } static int adp5520_led_setup(struct adp5520_led *led) @@ -146,9 +136,6 @@ static int adp5520_led_probe(struct platform_device *pdev) led_dat->id = led_dat->flags & ADP5520_FLAG_LED_MASK; led_dat->master = pdev->dev.parent; - led_dat->new_brightness = LED_OFF; - - INIT_WORK(&led_dat->work, adp5520_led_work); ret = led_classdev_register(led_dat->master, &led_dat->cdev); if (ret) { @@ -170,10 +157,8 @@ static int adp5520_led_probe(struct platform_device *pdev) err: if (i > 0) { - for (i = i - 1; i >= 0; i--) { + for (i = i - 1; i >= 0; i--) led_classdev_unregister(&led[i].cdev); - cancel_work_sync(&led[i].work); - } } return ret; @@ -192,7 +177,6 @@ static int adp5520_led_remove(struct platform_device *pdev) for (i = 0; i < pdata->num_leds; i++) { led_classdev_unregister(&led[i].cdev); - cancel_work_sync(&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/