Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1946160AbbGQJBn (ORCPT ); Fri, 17 Jul 2015 05:01:43 -0400 Received: from mailout4.samsung.com ([203.254.224.34]:37780 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1945950AbbGQItO (ORCPT ); Fri, 17 Jul 2015 04:49:14 -0400 X-AuditID: cbfee61a-f79516d000006302-18-55a8c1899926 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, Jacek Anaszewski , Andrew Lunn , Mark Brown Subject: [PATCH/RFC 29/51] leds: wm8350: Remove work queue Date: Fri, 17 Jul 2015 10:47:15 +0200 Message-id: <1437122857-6765-30-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+NgFlrILMWRmVeSWpSXmKPExsVy+t9jAd3OgytCDWa/E7M4f/cQs8XUh0/Y LI7unMhk0Xv1OaPF5V1z2Cy2vlnHaLF711NWi86+aSwOHB47Z91l99i0qpPNY+eOz0wee+b/ YPXo27KK0aPpVDurx+dNcgHsUVw2Kak5mWWpRfp2CVwZlzpOsBV0S1R8OLeEtYHxv3AXIweH hICJxKPvtl2MnECmmMSFe+vZuhi5OIQEFjFKdP1bxATh/GSUWHXhLjtIFZuAocTPF6+ZQJpF BOQkdp6pBKlhFrjMKDH3xilWkBphASuJXy/nMIPYLAKqEjePTGEBsXkFPCR+v/zNCrFYQWLO JBuQMCdQ+P2DlWAlQgLuEm1/LrJNYORdwMiwilE0tSC5oDgpPddQrzgxt7g0L10vOT93EyM4 4J5J7WBc2WBxiFGAg1GJh7fBdUWoEGtiWXFl7iFGCQ5mJRHeyp1AId6UxMqq1KL8+KLSnNTi Q4zSHCxK4rwn831ChQTSE0tSs1NTC1KLYLJMHJxSDYy7/Jw0oqXMH98QbLq+Km751V1fFXwf v7r7400X2/ODjMolnYVKLw6l/FCpNSp+k7ixYl1T7eRtZ+ZMaNZkjPure45lcsPqdZeTGeyT jMMfLtvdcuzPxgu/LuSF/8vZ++L3OZcfrhxxq3qlGwIfMqw/fyREnKHWesXDLAGnxaKfPnl5 Bt36pnhaiaU4I9FQi7moOBEAqtNn6TQCAAA= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3222 Lines: 111 Now the core implements the work queue, remove it from the drivers. Signed-off-by: Andrew Lunn Signed-off-by: Jacek Anaszewski Cc: Mark Brown --- drivers/leds/leds-wm8350.c | 31 ++++++------------------------- include/linux/mfd/wm8350/pmic.h | 1 - 2 files changed, 6 insertions(+), 26 deletions(-) diff --git a/drivers/leds/leds-wm8350.c b/drivers/leds/leds-wm8350.c index 0d12183..149579a 100644 --- a/drivers/leds/leds-wm8350.c +++ b/drivers/leds/leds-wm8350.c @@ -138,21 +138,22 @@ static void wm8350_led_disable(struct wm8350_led *led) led->enabled = 0; } -static void led_work(struct work_struct *work) +static void wm8350_led_set(struct led_classdev *led_cdev, + enum led_brightness value) { - struct wm8350_led *led = container_of(work, struct wm8350_led, work); + struct wm8350_led *led = to_wm8350_led(led_cdev); + unsigned long flags; int ret; int uA; - unsigned long flags; - mutex_lock(&led->mutex); + led->value = value; spin_lock_irqsave(&led->value_lock, flags); if (led->value == LED_OFF) { spin_unlock_irqrestore(&led->value_lock, flags); wm8350_led_disable(led); - goto out; + return; } /* This scales linearly into the index of valid current @@ -171,31 +172,14 @@ static void led_work(struct work_struct *work) isink_cur[uA], ret); wm8350_led_enable(led); - -out: - mutex_unlock(&led->mutex); -} - -static void wm8350_led_set(struct led_classdev *led_cdev, - enum led_brightness value) -{ - struct wm8350_led *led = to_wm8350_led(led_cdev); - unsigned long flags; - - spin_lock_irqsave(&led->value_lock, flags); - led->value = value; - schedule_work(&led->work); - spin_unlock_irqrestore(&led->value_lock, flags); } static void wm8350_led_shutdown(struct platform_device *pdev) { struct wm8350_led *led = platform_get_drvdata(pdev); - mutex_lock(&led->mutex); led->value = LED_OFF; wm8350_led_disable(led); - mutex_unlock(&led->mutex); } static int wm8350_led_probe(struct platform_device *pdev) @@ -251,8 +235,6 @@ static int wm8350_led_probe(struct platform_device *pdev) pdata->max_uA); spin_lock_init(&led->value_lock); - mutex_init(&led->mutex); - INIT_WORK(&led->work, led_work); led->value = LED_OFF; platform_set_drvdata(pdev, led); @@ -264,7 +246,6 @@ static int wm8350_led_remove(struct platform_device *pdev) struct wm8350_led *led = platform_get_drvdata(pdev); led_classdev_unregister(&led->cdev); - flush_work(&led->work); wm8350_led_disable(led); return 0; } diff --git a/include/linux/mfd/wm8350/pmic.h b/include/linux/mfd/wm8350/pmic.h index 579b50c..7a09e7f 100644 --- a/include/linux/mfd/wm8350/pmic.h +++ b/include/linux/mfd/wm8350/pmic.h @@ -715,7 +715,6 @@ struct wm8350_led_platform_data { struct wm8350_led { struct platform_device *pdev; - struct mutex mutex; struct work_struct work; spinlock_t value_lock; enum led_brightness value; -- 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/