summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorAlexander Shiyan <shc_work@mail.ru>2013-12-07 07:22:19 +0100
committerBryan Wu <cooloney@gmail.com>2014-01-28 02:28:50 +0100
commit3df22c06b9ca7df02e095595994d229811305825 (patch)
treec091ce23792544dab6408c1d44893de12fb1afde /drivers
parentleds: leds-mc13783: Remove duplicate field in platform data (diff)
downloadlinux-3df22c06b9ca7df02e095595994d229811305825.tar.xz
linux-3df22c06b9ca7df02e095595994d229811305825.zip
leds: leds-mc13783: Remove unneeded mc13xxx_{un}lock
LED registers are used only in this driver, so no additional locking is needed. Read-Modify-Write cycle in workqueue is already protected by regmap. Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Bryan Wu <cooloney@gmail.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/leds/leds-mc13783.c13
1 files changed, 1 insertions, 12 deletions
diff --git a/drivers/leds/leds-mc13783.c b/drivers/leds/leds-mc13783.c
index ec704f2ab70d..ca87a1b4a0db 100644
--- a/drivers/leds/leds-mc13783.c
+++ b/drivers/leds/leds-mc13783.c
@@ -117,9 +117,7 @@ static void mc13xxx_led_work(struct work_struct *work)
BUG();
}
- mc13xxx_lock(led->master);
mc13xxx_reg_rmw(led->master, reg, mask << shift, value << shift);
- mc13xxx_unlock(led->master);
}
static void mc13xxx_led_set(struct led_classdev *led_cdev,
@@ -164,19 +162,12 @@ static int __init mc13xxx_led_probe(struct platform_device *pdev)
leds->num_leds = num_leds;
platform_set_drvdata(pdev, leds);
- mc13xxx_lock(mcdev);
for (i = 0; i < devtype->num_regs; i++) {
reg = pdata->led_control[i];
WARN_ON(reg >= (1 << 24));
ret = mc13xxx_reg_write(mcdev, MC13XXX_REG_LED_CONTROL(i), reg);
if (ret)
- break;
- }
- mc13xxx_unlock(mcdev);
-
- if (ret) {
- dev_err(&pdev->dev, "Unable to init LED driver\n");
- return ret;
+ return ret;
}
for (i = 0; i < num_leds; i++) {
@@ -237,10 +228,8 @@ static int mc13xxx_led_remove(struct platform_device *pdev)
cancel_work_sync(&leds->led[i].work);
}
- mc13xxx_lock(mcdev);
for (i = 0; i < leds->devtype->num_regs; i++)
mc13xxx_reg_write(mcdev, MC13XXX_REG_LED_CONTROL(i), 0);
- mc13xxx_unlock(mcdev);
return 0;
}