Skip to contentSkip to conversation

Input: lm8323: add missing device_remove_file for dev_attr_time

PATCH Applied Axel Lin 2 participants 2 messages Jul 28, 2011 – Jul 30, 2011

Subsystems (2)
lore
Share & tools
lore

Axel Lin

author
#0 lore raw

PATCH 1/1 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.

---
 drivers/input/keyboard/lm8323.c |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)
drivers/input/keyboard/lm8323.c +7 -2
index ab0acaf..756348a 100644
@@ -754,8 +754,11 @@ fail3:
 	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);
@@ -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);
 
Signature · 1 line
1.7.4.1
maintainer Applied
#1 lore raw
Quoted 5 lines · Axel Lin

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.

Applied, thanks Axel.

Signature · 1 line
Dmitry