Skip to content

Commit 52db981

Browse files
AxelLindtor
authored andcommitted
Input: lm8323 - add missing device_remove_file for dev_attr_time
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>
1 parent 3f27757 commit 52db981

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

‎drivers/input/keyboard/lm8323.c‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -754,8 +754,11 @@ static int __devinit lm8323_probe(struct i2c_client *client,
754754
device_remove_file(&client->dev, &dev_attr_disable_kp);
755755
fail2:
756756
while (--pwm >= 0)
757-
if (lm->pwm[pwm].enabled)
757+
if (lm->pwm[pwm].enabled) {
758+
device_remove_file(lm->pwm[pwm].cdev.dev,
759+
&dev_attr_time);
758760
led_classdev_unregister(&lm->pwm[pwm].cdev);
761+
}
759762
fail1:
760763
input_free_device(idev);
761764
kfree(lm);
@@ -775,8 +778,10 @@ static int __devexit lm8323_remove(struct i2c_client *client)
775778
device_remove_file(&lm->client->dev, &dev_attr_disable_kp);
776779

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

781786
kfree(lm);
782787

0 commit comments

Comments
 (0)