Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932431AbbGQIss (ORCPT ); Fri, 17 Jul 2015 04:48:48 -0400 Received: from mailout4.samsung.com ([203.254.224.34]:52861 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932065AbbGQIsk (ORCPT ); Fri, 17 Jul 2015 04:48:40 -0400 X-AuditID: cbfee61a-f79516d000006302-ca-55a8c166a400 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 , Milo Kim Subject: [PATCH/RFC 17/51] leds: lp8788: Remove work queue Date: Fri, 17 Jul 2015 10:47:03 +0200 Message-id: <1437122857-6765-18-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+t9jAd30gytCDZ7tYrE4f/cQs8XRnROZ LC7vmsNmsfXNOkaL5b/WsVjs3vWU1aKzbxqLA7vHzll3gcSOz0wee+b/YPU4fmM7k0fTqXZW j8+b5ALYorhsUlJzMstSi/TtErgy/q25wliwXbBi7qGN7A2MG/m6GDk5JARMJK7t2cQGYYtJ XLi3Hsjm4hASWMQo0TpnJzuE85NR4uD7RlaQKjYBQ4mfL14zdTFycIgIyEnsPFMJUsMssJBR YtHpvYwgNcICVhJfHt4Cs1kEVCWWnL3DBGLzCnhIzN7WzgbSKyGgIDFnkg1ImBMo/P7BShYQ W0jAXaLtz0W2CYy8CxgZVjGKphYkFxQnpeca6hUn5haX5qXrJefnbmIEh9czqR2MKxssDjEK cDAq8fA2uK4IFWJNLCuuzD3EKMHBrCTCW7kTKMSbklhZlVqUH19UmpNafIhRmoNFSZz3ZL5P qJBAemJJanZqakFqEUyWiYNTqoHx/PrCGV3uV56dDp7IWbis7zNL04fwWz+FuqOUlRXl0v1e rTtdX1KZf+axi73OrMY8pVsed6rm/Tyf6P/rnGZ24NH7Egxd3t277n1dtOXa860bFuVf8vx5 e3JN7facHUfPJ0YmH5STqWruWXf5kWR4yILrr9bVBDt9vNkUovn+g/tk7nVl3QbblViKMxIN tZiLihMBME9OqysCAAA= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2397 Lines: 84 From: Andrew Lunn Now the core implements the work queue, remove it from the drivers. Signed-off-by: Andrew Lunn Cc: Milo Kim --- drivers/leds/leds-lp8788.c | 22 +++++----------------- 1 file changed, 5 insertions(+), 17 deletions(-) diff --git a/drivers/leds/leds-lp8788.c b/drivers/leds/leds-lp8788.c index 3409f03..634c9ad 100644 --- a/drivers/leds/leds-lp8788.c +++ b/drivers/leds/leds-lp8788.c @@ -26,10 +26,8 @@ struct lp8788_led { struct lp8788 *lp; struct mutex lock; - struct work_struct work; struct led_classdev led_dev; enum lp8788_isink_number isink_num; - enum led_brightness brightness; int on; }; @@ -88,12 +86,14 @@ static void lp8788_led_enable(struct lp8788_led *led, led->on = on; } -static void lp8788_led_work(struct work_struct *work) +static void lp8788_brightness_set(struct led_classdev *led_cdev, + enum led_brightness val) { - struct lp8788_led *led = container_of(work, struct lp8788_led, work); + struct lp8788_led *led = + container_of(led_cdev, struct lp8788_led, led_dev); + enum lp8788_isink_number num = led->isink_num; int enable; - u8 val = led->brightness; mutex_lock(&led->lock); @@ -115,16 +115,6 @@ static void lp8788_led_work(struct work_struct *work) mutex_unlock(&led->lock); } -static void lp8788_brightness_set(struct led_classdev *led_cdev, - enum led_brightness brt_val) -{ - struct lp8788_led *led = - container_of(led_cdev, struct lp8788_led, led_dev); - - led->brightness = brt_val; - schedule_work(&led->work); -} - static int lp8788_led_probe(struct platform_device *pdev) { struct lp8788 *lp = dev_get_drvdata(pdev->dev.parent); @@ -149,7 +139,6 @@ static int lp8788_led_probe(struct platform_device *pdev) led->led_dev.name = led_pdata->name; mutex_init(&led->lock); - INIT_WORK(&led->work, lp8788_led_work); platform_set_drvdata(pdev, led); @@ -173,7 +162,6 @@ static int lp8788_led_remove(struct platform_device *pdev) struct lp8788_led *led = platform_get_drvdata(pdev); led_classdev_unregister(&led->led_dev); - flush_work(&led->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/