diff options
Diffstat (limited to 'drivers/input/keyboard/lm8323.c')
-rw-r--r-- | drivers/input/keyboard/lm8323.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/input/keyboard/lm8323.c b/drivers/input/keyboard/lm8323.c index 40b032f0e32c..f7c2a166576b 100644 --- a/drivers/input/keyboard/lm8323.c +++ b/drivers/input/keyboard/lm8323.c | |||
@@ -642,6 +642,7 @@ static int __devinit lm8323_probe(struct i2c_client *client, | |||
642 | struct lm8323_platform_data *pdata = client->dev.platform_data; | 642 | struct lm8323_platform_data *pdata = client->dev.platform_data; |
643 | struct input_dev *idev; | 643 | struct input_dev *idev; |
644 | struct lm8323_chip *lm; | 644 | struct lm8323_chip *lm; |
645 | int pwm; | ||
645 | int i, err; | 646 | int i, err; |
646 | unsigned long tmo; | 647 | unsigned long tmo; |
647 | u8 data[2]; | 648 | u8 data[2]; |
@@ -710,8 +711,9 @@ static int __devinit lm8323_probe(struct i2c_client *client, | |||
710 | goto fail1; | 711 | goto fail1; |
711 | } | 712 | } |
712 | 713 | ||
713 | for (i = 0; i < LM8323_NUM_PWMS; i++) { | 714 | for (pwm = 0; pwm < LM8323_NUM_PWMS; pwm++) { |
714 | err = init_pwm(lm, i + 1, &client->dev, pdata->pwm_names[i]); | 715 | err = init_pwm(lm, pwm + 1, &client->dev, |
716 | pdata->pwm_names[pwm]); | ||
715 | if (err < 0) | 717 | if (err < 0) |
716 | goto fail2; | 718 | goto fail2; |
717 | } | 719 | } |
@@ -764,9 +766,9 @@ fail4: | |||
764 | fail3: | 766 | fail3: |
765 | device_remove_file(&client->dev, &dev_attr_disable_kp); | 767 | device_remove_file(&client->dev, &dev_attr_disable_kp); |
766 | fail2: | 768 | fail2: |
767 | while (--i >= 0) | 769 | while (--pwm >= 0) |
768 | if (lm->pwm[i].enabled) | 770 | if (lm->pwm[pwm].enabled) |
769 | led_classdev_unregister(&lm->pwm[i].cdev); | 771 | led_classdev_unregister(&lm->pwm[pwm].cdev); |
770 | fail1: | 772 | fail1: |
771 | input_free_device(idev); | 773 | input_free_device(idev); |
772 | kfree(lm); | 774 | kfree(lm); |