Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964967AbbHKJjQ (ORCPT ); Tue, 11 Aug 2015 05:39:16 -0400 Received: from mailout4.samsung.com ([203.254.224.34]:55959 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964861AbbHKJjD (ORCPT ); Tue, 11 Aug 2015 05:39:03 -0400 X-AuditID: cbfee61a-f79a06d000005c6f-40-55c9c2b2094a 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 Subject: [PATCH/RFC v5 13/57] leds: 88pm860x: Remove work queue Date: Tue, 11 Aug 2015 11:37:26 +0200 Message-id: <1439285890-27329-14-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+NgFprFLMWRmVeSWpSXmKPExsVy+t9jQd1Nh06GGmzYLW1x/u4hZoujOycy WfRefc5ocXnXHDaLrW/WMVrs3vWU1aKzbxqLA7vHzll3gcSOz0wee+b/YPXo27KK0aPpVDur x+dNcgFsUVw2Kak5mWWpRfp2CVwZt3vdCtYIV3xte8/YwPiDv4uRk0NCwERi8adbzBC2mMSF e+vZuhi5OIQEZjFK9C3bxQTh/GSU2LDuM1gVm4ChxM8Xr4ESHBwiAnISO89UgtQwC2xilLh8 tIsVpEZYwF7i847JLCA2i4CqxLzN3WBxXgFPiZVLelhAeiUEFCTmTLIBCXMCha8/X8QIYgsJ eEgcn93ENoGRdwEjwypGidSC5ILipPRcw7zUcr3ixNzi0rx0veT83E2M4BB7JrWD8eAu90OM AhyMSjxAC06GCrEmlhVX5h5ilOBgVhLhLZwKFOJNSaysSi3Kjy8qzUktPsQozcGiJM4ru2Fz qJBAemJJanZqakFqEUyWiYNTqoGRw22PlZvRGyen5CM7t25488bpo5AM+9Pv8g9iUtaLdNx/ utnn3US1T3Y/S7z0J97atVlWjP9T9NfDafYbuGPPKblnSzUGrEpdkTp78Z6qlDT+21vuMPqe kxLUeOpiqRz5MaVv98Jt/3f9sb/lcvrmHfe7uhfWHmCMmWqpUczw3DZo1+VNfRuDlViKMxIN tZiLihMBv4TGQi0CAAA= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2639 Lines: 87 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 --- drivers/leds/leds-88pm860x.c | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/drivers/leds/leds-88pm860x.c b/drivers/leds/leds-88pm860x.c index 1497a09..a2f7b10 100644 --- a/drivers/leds/leds-88pm860x.c +++ b/drivers/leds/leds-88pm860x.c @@ -16,7 +16,6 @@ #include #include #include -#include #include #include @@ -33,7 +32,6 @@ struct pm860x_led { struct led_classdev cdev; struct i2c_client *i2c; - struct work_struct work; struct pm860x_chip *chip; struct mutex lock; char name[MFD_NAME_SIZE]; @@ -69,17 +67,18 @@ static int led_power_set(struct pm860x_chip *chip, int port, int on) return ret; } -static void pm860x_led_work(struct work_struct *work) +static void pm860x_led_set(struct led_classdev *cdev, + enum led_brightness value) { - - struct pm860x_led *led; + struct pm860x_led *led = container_of(cdev, struct pm860x_led, cdev); struct pm860x_chip *chip; unsigned char buf[3]; int ret; - led = container_of(work, struct pm860x_led, work); chip = led->chip; mutex_lock(&led->lock); + led->brightness = value >> 3; + if ((led->current_brightness == 0) && led->brightness) { led_power_set(chip, led->port, 1); if (led->iset) { @@ -114,15 +113,6 @@ static void pm860x_led_work(struct work_struct *work) mutex_unlock(&led->lock); } -static void pm860x_led_set(struct led_classdev *cdev, - enum led_brightness value) -{ - struct pm860x_led *data = container_of(cdev, struct pm860x_led, cdev); - - data->brightness = value >> 3; - schedule_work(&data->work); -} - #ifdef CONFIG_OF static int pm860x_led_dt_init(struct platform_device *pdev, struct pm860x_led *data) @@ -213,8 +203,8 @@ static int pm860x_led_probe(struct platform_device *pdev) data->current_brightness = 0; data->cdev.name = data->name; data->cdev.brightness_set = pm860x_led_set; + data->cdev.flags = LED_BRIGHTNESS_BLOCKING; mutex_init(&data->lock); - INIT_WORK(&data->work, pm860x_led_work); ret = led_classdev_register(chip->dev, &data->cdev); if (ret < 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/