Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1946212AbbGQJD0 (ORCPT ); Fri, 17 Jul 2015 05:03:26 -0400 Received: from mailout2.samsung.com ([203.254.224.25]:51287 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1945911AbbGQItD (ORCPT ); Fri, 17 Jul 2015 04:49:03 -0400 X-AuditID: cbfee61b-f79416d0000014c0-06-55a8c17d56e7 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 , Daniel Mack Subject: [PATCH/RFC 25/51] leds: lt3593: Remove work queue Date: Fri, 17 Jul 2015 10:47:11 +0200 Message-id: <1437122857-6765-26-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+NgFprBLMWRmVeSWpSXmKPExsVy+t9jAd26gytCDa4sZ7Y4f/cQs8XRnROZ LN6ebmCzuLxrDpvF1jfrGC1273rKatHZN43Fgd1j45eVTB47Z91l99i54zOTx575P1g9mk61 s3p83iQXwBbFZZOSmpNZllqkb5fAlTHhwgu2gnsiFTPv/GZqYPws0MXIySEhYCJx4PM9Rghb TOLCvfVsXYxcHEICixglLhw9xwzh/GSUmD+jC6yKTcBQ4ueL10xdjBwcIgJyEjvPVILUMAss YZRY0/MGrEZYwEri5Mwt7CA2i4CqxJcpy1lBbF4BD4knN56wgfRKCChIzJlkAxLmBAq/f7CS BcQWEnCXaPtzkW0CI+8CRoZVjKKpBckFxUnpuUZ6xYm5xaV56XrJ+bmbGMHh9Ux6B+OqBotD jAIcjEo8vA2uK0KFWBPLiitzDzFKcDArifBW7gQK8aYkVlalFuXHF5XmpBYfYpTmYFES5z2Z 7xMqJJCeWJKanZpakFoEk2Xi4JRqYAxlO5qvoLCvzv7xxjBp6x0n+ZtVspvmz9O7+Upp4Xa3 eWmmbjmdC7e9sdm3aMrKJ46m8c7Wag9lFl65L8LD9LXz18OlQoaTGB0qzjDc3l93TSH/2DS9 8Mun2mbe2Dlz7dVszdXXpp/gNKm5x/5KZnHnAx2NtMSfHR6GJzwiJz1Vt4lw/PRT57sSS3FG oqEWc1FxIgBVOscvKwIAAA== Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2805 Lines: 99 From: Andrew Lunn Now the core implements the work queue, remove it from the drivers. Signed-off-by: Andrew Lunn Cc: Daniel Mack --- drivers/leds/leds-lt3593.c | 27 ++++++--------------------- 1 file changed, 6 insertions(+), 21 deletions(-) diff --git a/drivers/leds/leds-lt3593.c b/drivers/leds/leds-lt3593.c index 9f41124..5e456ee 100644 --- a/drivers/leds/leds-lt3593.c +++ b/drivers/leds/leds-lt3593.c @@ -19,7 +19,6 @@ #include #include #include -#include #include #include #include @@ -28,15 +27,14 @@ struct lt3593_led_data { struct led_classdev cdev; unsigned gpio; - struct work_struct work; - u8 new_level; }; -static void lt3593_led_work(struct work_struct *work) +static void lt3593_led_set(struct led_classdev *led_cdev, + enum led_brightness value) { - int pulses; struct lt3593_led_data *led_dat = - container_of(work, struct lt3593_led_data, work); + container_of(led_cdev, struct lt3593_led_data, cdev); + int pulses; /* * The LT3593 resets its internal current level register to the maximum @@ -47,12 +45,12 @@ static void lt3593_led_work(struct work_struct *work) * applied is to the output driver. */ - if (led_dat->new_level == 0) { + if (value == 0) { gpio_set_value_cansleep(led_dat->gpio, 0); return; } - pulses = 32 - (led_dat->new_level * 32) / 255; + pulses = 32 - (value * 32) / 255; if (pulses == 0) { gpio_set_value_cansleep(led_dat->gpio, 0); @@ -71,16 +69,6 @@ static void lt3593_led_work(struct work_struct *work) } } -static void lt3593_led_set(struct led_classdev *led_cdev, - enum led_brightness value) -{ - struct lt3593_led_data *led_dat = - container_of(led_cdev, struct lt3593_led_data, cdev); - - led_dat->new_level = value; - schedule_work(&led_dat->work); -} - static int create_lt3593_led(const struct gpio_led *template, struct lt3593_led_data *led_dat, struct device *parent) { @@ -111,8 +99,6 @@ static int create_lt3593_led(const struct gpio_led *template, if (ret < 0) return ret; - INIT_WORK(&led_dat->work, lt3593_led_work); - ret = led_classdev_register(parent, &led_dat->cdev); if (ret < 0) return ret; @@ -129,7 +115,6 @@ static void delete_lt3593_led(struct lt3593_led_data *led) return; led_classdev_unregister(&led->cdev); - cancel_work_sync(&led->work); } static int lt3593_led_probe(struct platform_device *pdev) -- 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/