Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934494AbbHKJvk (ORCPT ); Tue, 11 Aug 2015 05:51:40 -0400 Received: from mailout2.samsung.com ([203.254.224.25]:48172 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964932AbbHKJjL (ORCPT ); Tue, 11 Aug 2015 05:39:11 -0400 X-AuditID: cbfee61b-f79706d000001b96-32-55c9c2bef189 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 , Johan Hovold Subject: [PATCH/RFC v5 17/57] leds: lm3533: Remove work queue Date: Tue, 11 Aug 2015 11:37:30 +0200 Message-id: <1439285890-27329-18-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+t9jQd19h06GGqxfwW9x/u4hZoujOycy WfRefc5o0XSjh9Xi8q45bBZb36xjtNi96ymrRWffNBYHDo+ds+6ye2xa1cnmsXPHZyaPPfN/ sHr0bVnF6NF0qp3V4/MmuQD2KC6blNSczLLUIn27BK6M47+/MhWsFa+Yuu0pSwPjRuEuRk4O CQETiUfzjjFD2GISF+6tZ+ti5OIQEpjFKPHpbD8zhPOTUWLN8h5GkCo2AUOJny9eM3UxcnCI CMhJ7DxTCVLDLHCZUWLj7h42kBphAVuJnjudYPUsAqoSJ5pfsoDYvAKeEtNnfmYB6ZUQUJCY M8kGJMwJFL7+fBFYuZCAh8Tx2U1sExh5FzAyrGKUSC1ILihOSs81ykst1ytOzC0uzUvXS87P 3cQIDrxn0jsYD+9yP8QowMGoxAO04GSoEGtiWXFl7iFGCQ5mJRHewqlAId6UxMqq1KL8+KLS nNTiQ4zSHCxK4rz6JptChQTSE0tSs1NTC1KLYLJMHJxSDYwKL3zjWmo8ntu4aWvc+nPsR4HU 6zWmFkpVIRP7p/67GB55SGZBt2XU0YTtjCKXUx7xMc5bpHsloUPnkvuCNR1ZOicjNMr0TP6q L61uOfX5f3rGt+fr0uMPnruXMPNs7Yw3ynUhQRe+bn+xw1TY9peGOMfu6W0ZTY+X8lf/F3/c eS/lcJKsBKMSS3FGoqEWc1FxIgBkDveiOAIAAA== Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3130 Lines: 109 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 Cc: Johan Hovold --- drivers/leds/leds-lm3533.c | 27 +++++---------------------- 1 file changed, 5 insertions(+), 22 deletions(-) diff --git a/drivers/leds/leds-lm3533.c b/drivers/leds/leds-lm3533.c index 6e2e020..5a9ae74 100644 --- a/drivers/leds/leds-lm3533.c +++ b/drivers/leds/leds-lm3533.c @@ -17,7 +17,6 @@ #include #include #include -#include #include @@ -53,9 +52,6 @@ struct lm3533_led { struct mutex mutex; unsigned long flags; - - struct work_struct work; - u8 new_brightness; }; @@ -123,18 +119,6 @@ out: return ret; } -static void lm3533_led_work(struct work_struct *work) -{ - struct lm3533_led *led = container_of(work, struct lm3533_led, work); - - dev_dbg(led->cdev.dev, "%s - %u\n", __func__, led->new_brightness); - - if (led->new_brightness == 0) - lm3533_led_pattern_enable(led, 0); /* disable blink */ - - lm3533_ctrlbank_set_brightness(&led->cb, led->new_brightness); -} - static void lm3533_led_set(struct led_classdev *cdev, enum led_brightness value) { @@ -142,8 +126,10 @@ static void lm3533_led_set(struct led_classdev *cdev, dev_dbg(led->cdev.dev, "%s - %d\n", __func__, value); - led->new_brightness = value; - schedule_work(&led->work); + if (value == 0) + lm3533_led_pattern_enable(led, 0); /* disable blink */ + + lm3533_ctrlbank_set_brightness(&led->cb, value); } static enum led_brightness lm3533_led_get(struct led_classdev *cdev) @@ -698,10 +684,10 @@ static int lm3533_led_probe(struct platform_device *pdev) led->cdev.blink_set = lm3533_led_blink_set; led->cdev.brightness = LED_OFF; led->cdev.groups = lm3533_led_attribute_groups, + led->cdev.flags |= LED_BRIGHTNESS_BLOCKING; led->id = pdev->id; mutex_init(&led->mutex); - INIT_WORK(&led->work, lm3533_led_work); /* The class framework makes a callback to get brightness during * registration so use parent device (for error reporting) until @@ -733,7 +719,6 @@ static int lm3533_led_probe(struct platform_device *pdev) err_unregister: led_classdev_unregister(&led->cdev); - flush_work(&led->work); return ret; } @@ -746,7 +731,6 @@ static int lm3533_led_remove(struct platform_device *pdev) lm3533_ctrlbank_disable(&led->cb); led_classdev_unregister(&led->cdev); - flush_work(&led->work); return 0; } @@ -760,7 +744,6 @@ static void lm3533_led_shutdown(struct platform_device *pdev) lm3533_ctrlbank_disable(&led->cb); lm3533_led_set(&led->cdev, LED_OFF); /* disable blink */ - flush_work(&led->work); } static struct platform_driver lm3533_led_driver = { -- 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/