mirror of
https://github.com/followmsi/android_kernel_google_msm.git
synced 2024-11-06 23:17:41 +00:00
Merge branch 'leds-fixes-for-3.13' of git://git.kernel.org/pub/scm/linux/kernel/git/cooloney/linux-leds
Pull LED fix from Bryan Wu: "Pali Rohár and Pavel Machek reported the LED of Nokia N900 doesn't work with our latest 3.13-rc6 kernel. Milo fixed the regression here" * 'leds-fixes-for-3.13' of git://git.kernel.org/pub/scm/linux/kernel/git/cooloney/linux-leds: leds: lp5521/5523: Remove duplicate mutex
This commit is contained in:
commit
324c66ff52
2 changed files with 8 additions and 16 deletions
|
@ -244,17 +244,11 @@ static int lp5521_update_program_memory(struct lp55xx_chip *chip,
|
|||
if (i % 2)
|
||||
goto err;
|
||||
|
||||
mutex_lock(&chip->lock);
|
||||
|
||||
for (i = 0; i < LP5521_PROGRAM_LENGTH; i++) {
|
||||
ret = lp55xx_write(chip, addr[idx] + i, pattern[i]);
|
||||
if (ret) {
|
||||
mutex_unlock(&chip->lock);
|
||||
if (ret)
|
||||
return -EINVAL;
|
||||
}
|
||||
}
|
||||
|
||||
mutex_unlock(&chip->lock);
|
||||
|
||||
return size;
|
||||
|
||||
|
@ -427,15 +421,17 @@ static ssize_t store_engine_load(struct device *dev,
|
|||
{
|
||||
struct lp55xx_led *led = i2c_get_clientdata(to_i2c_client(dev));
|
||||
struct lp55xx_chip *chip = led->chip;
|
||||
int ret;
|
||||
|
||||
mutex_lock(&chip->lock);
|
||||
|
||||
chip->engine_idx = nr;
|
||||
lp5521_load_engine(chip);
|
||||
ret = lp5521_update_program_memory(chip, buf, len);
|
||||
|
||||
mutex_unlock(&chip->lock);
|
||||
|
||||
return lp5521_update_program_memory(chip, buf, len);
|
||||
return ret;
|
||||
}
|
||||
store_load(1)
|
||||
store_load(2)
|
||||
|
|
|
@ -337,17 +337,11 @@ static int lp5523_update_program_memory(struct lp55xx_chip *chip,
|
|||
if (i % 2)
|
||||
goto err;
|
||||
|
||||
mutex_lock(&chip->lock);
|
||||
|
||||
for (i = 0; i < LP5523_PROGRAM_LENGTH; i++) {
|
||||
ret = lp55xx_write(chip, LP5523_REG_PROG_MEM + i, pattern[i]);
|
||||
if (ret) {
|
||||
mutex_unlock(&chip->lock);
|
||||
if (ret)
|
||||
return -EINVAL;
|
||||
}
|
||||
}
|
||||
|
||||
mutex_unlock(&chip->lock);
|
||||
|
||||
return size;
|
||||
|
||||
|
@ -548,15 +542,17 @@ static ssize_t store_engine_load(struct device *dev,
|
|||
{
|
||||
struct lp55xx_led *led = i2c_get_clientdata(to_i2c_client(dev));
|
||||
struct lp55xx_chip *chip = led->chip;
|
||||
int ret;
|
||||
|
||||
mutex_lock(&chip->lock);
|
||||
|
||||
chip->engine_idx = nr;
|
||||
lp5523_load_engine_and_select_page(chip);
|
||||
ret = lp5523_update_program_memory(chip, buf, len);
|
||||
|
||||
mutex_unlock(&chip->lock);
|
||||
|
||||
return lp5523_update_program_memory(chip, buf, len);
|
||||
return ret;
|
||||
}
|
||||
store_load(1)
|
||||
store_load(2)
|
||||
|
|
Loading…
Reference in a new issue