Skip to content

Commit

Permalink
Input: lm8323 - add missing device_remove_file for dev_attr_time
Browse files Browse the repository at this point in the history
Add missing device_remove_file() for dev_attr_time in lm8323_remove().
Also calling device_remove_file() in lm8323_probe() error path to
remove sysfs attribute file.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
  • Loading branch information
Axel Lin authored and Dmitry Torokhov committed Jul 30, 2011
1 parent 3f27757 commit 52db981
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions drivers/input/keyboard/lm8323.c
Original file line number Diff line number Diff line change
Expand Up @@ -754,8 +754,11 @@ static int __devinit lm8323_probe(struct i2c_client *client,
device_remove_file(&client->dev, &dev_attr_disable_kp);
fail2:
while (--pwm >= 0)
if (lm->pwm[pwm].enabled)
if (lm->pwm[pwm].enabled) {
device_remove_file(lm->pwm[pwm].cdev.dev,
&dev_attr_time);
led_classdev_unregister(&lm->pwm[pwm].cdev);
}
fail1:
input_free_device(idev);
kfree(lm);
Expand All @@ -775,8 +778,10 @@ static int __devexit lm8323_remove(struct i2c_client *client)
device_remove_file(&lm->client->dev, &dev_attr_disable_kp);

for (i = 0; i < 3; i++)
if (lm->pwm[i].enabled)
if (lm->pwm[i].enabled) {
device_remove_file(lm->pwm[i].cdev.dev, &dev_attr_time);
led_classdev_unregister(&lm->pwm[i].cdev);
}

kfree(lm);

Expand Down

0 comments on commit 52db981

Please sign in to comment.