Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932483AbbGQIsx (ORCPT ); Fri, 17 Jul 2015 04:48:53 -0400 Received: from mailout3.samsung.com ([203.254.224.33]:56712 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932388AbbGQIsj (ORCPT ); Fri, 17 Jul 2015 04:48:39 -0400 X-AuditID: cbfee61b-f79416d0000014c0-cb-55a8c15e1b4d 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 Subject: [PATCH/RFC 14/51] leds: pca9532: Remove work queue for LEDs. Date: Fri, 17 Jul 2015 10:47:00 +0200 Message-id: <1437122857-6765-15-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+NgFuplluLIzCtJLcpLzFFi42I5/e+xgG7cwRWhBmsPCFmcv3uI2eLozolM Fpd3zWGz2PpmHaPF7l1PWS06+6axOLB57Jx1l91j547PTB575v9g9Wg61c7q8XmTXABrFJdN SmpOZllqkb5dAlfG9p4rTAU/BSueTD/A1MD4ga+LkZNDQsBE4kjnQ2YIW0ziwr31bF2MXBxC AosYJbom3GeGcH4ySkxa9xSsik3AUOLni9dMXYwcHCICchI7z1SC1DALNDNKtP1rYgWJCwu4 Shx5bwFSziKgKnHq7xmwVl4BD4kt7e1sICUSAgoScybZgIQ5gcLvH6xkAbGFBNwl2v5cZJvA yLuAkWEVo2hqQXJBcVJ6rpFecWJucWleul5yfu4mRnAgPZPewbiqweIQowAHoxIPb4PrilAh 1sSy4srcQ4wSHMxKIryVO4FCvCmJlVWpRfnxRaU5qcWHGKU5WJTEeU/m+4QKCaQnlqRmp6YW pBbBZJk4OKUaGJd69W3T/nzcrX95t8HN5RN1eifdSPoY+X/1Na1i8bq52vkX/9TtKl7//vbd tuutpc8OywccuFb9y1Zh6jLDO32/j2vJvTY22D+jcN0Ljhcu/dvzXGwSlgd9n+ys27/DsWKt vNeLmxZ80iq8vi9f1E38P1fqf8FSA2vf66c4TFc5886SeB2ot0CJpTgj0VCLuag4EQBRNLEd IAIAAA== Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2471 Lines: 76 From: Andrew Lunn Now the core implements the work queue, remove it from the driver. Signed-off-by: Andrew Lunn --- drivers/leds/leds-pca9532.c | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/drivers/leds/leds-pca9532.c b/drivers/leds/leds-pca9532.c index 5a6363d..85ffc30 100644 --- a/drivers/leds/leds-pca9532.c +++ b/drivers/leds/leds-pca9532.c @@ -174,7 +174,9 @@ static void pca9532_set_brightness(struct led_classdev *led_cdev, if (err) return; /* XXX: led api doesn't allow error code? */ } - schedule_work(&led->work); + if (led->state == PCA9532_PWM0) + pca9532_setpwm(led->client, 0); + pca9532_setled(led); } static int pca9532_set_blink(struct led_classdev *led_cdev, @@ -198,7 +200,10 @@ static int pca9532_set_blink(struct led_classdev *led_cdev, err = pca9532_calcpwm(client, 0, psc, led_cdev->brightness); if (err) return err; - schedule_work(&led->work); + if (led->state == PCA9532_PWM0) + pca9532_setpwm(led->client, 0); + pca9532_setled(led); + return 0; } @@ -233,15 +238,6 @@ static void pca9532_input_work(struct work_struct *work) mutex_unlock(&data->update_lock); } -static void pca9532_led_work(struct work_struct *work) -{ - struct pca9532_led *led; - led = container_of(work, struct pca9532_led, work); - if (led->state == PCA9532_PWM0) - pca9532_setpwm(led->client, 0); - pca9532_setled(led); -} - #ifdef CONFIG_LEDS_PCA9532_GPIO static int pca9532_gpio_request_pin(struct gpio_chip *gc, unsigned offset) { @@ -307,7 +303,6 @@ static int pca9532_destroy_devices(struct pca9532_data *data, int n_devs) break; case PCA9532_TYPE_LED: led_classdev_unregister(&data->leds[i].ldev); - cancel_work_sync(&data->leds[i].work); break; case PCA9532_TYPE_N2100_BEEP: if (data->idev != NULL) { @@ -361,7 +356,6 @@ static int pca9532_configure(struct i2c_client *client, led->ldev.brightness = LED_OFF; led->ldev.brightness_set = pca9532_set_brightness; led->ldev.blink_set = pca9532_set_blink; - INIT_WORK(&led->work, pca9532_led_work); err = led_classdev_register(&client->dev, &led->ldev); if (err < 0) { dev_err(&client->dev, -- 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/