Skip to contentSkip to conversation

mfd: Fix resource reclaim in pcf50633_remove()

PATCH In review Axel Lin 3 participants 3 messages Oct 20, 2010 – Oct 21, 2010 Multifunction devices (MFD)

lore
Share & tools
lore

Axel Lin

author
#0 lore raw

PATCH 1/1 mfd: Fix resource reclaim in pcf50633_remove()

Calling sysfs_remove_group() to remove sysfs entries and unregister bl_pdev in pcf50633_remove().

---
 drivers/mfd/pcf50633-core.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
drivers/mfd/pcf50633-core.c +2 -0
index 6d4233f..501ce13 100644
@@ -339,12 +339,14 @@ static int __devexit pcf50633_remove(struct i2c_client *client)
 	struct pcf50633 *pcf = i2c_get_clientdata(client);
 	int i;
 
+	sysfs_remove_group(&client->dev.kobj, &pcf_attr_group);
 	pcf50633_irq_free(pcf);
 
 	platform_device_unregister(pcf->input_pdev);
 	platform_device_unregister(pcf->rtc_pdev);
 	platform_device_unregister(pcf->mbc_pdev);
 	platform_device_unregister(pcf->adc_pdev);
+	platform_device_unregister(pcf->bl_pdev);
 
 	for (i = 0; i < PCF50633_NUM_REGULATORS; i++)
 		platform_device_unregister(pcf->regulator_pdev[i]);
Signature · 1 line
1.7.2
Acked-by on v1 1/1
#1 lore raw
Quoted 32 lines · Axel Lin

Calling sysfs_remove_group() to remove sysfs entries and unregister bl_pdev in pcf50633_remove().

---
 drivers/mfd/pcf50633-core.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
drivers/mfd/pcf50633-core.c +2 -0
index 6d4233f..501ce13 100644
@@ -339,12 +339,14 @@ static int __devexit pcf50633_remove(struct i2c_client *client)
 	struct pcf50633 *pcf = i2c_get_clientdata(client);
 	int i;
 
+	sysfs_remove_group(&client->dev.kobj, &pcf_attr_group);
 	pcf50633_irq_free(pcf);
 
 	platform_device_unregister(pcf->input_pdev);
 	platform_device_unregister(pcf->rtc_pdev);
 	platform_device_unregister(pcf->mbc_pdev);
 	platform_device_unregister(pcf->adc_pdev);
+	platform_device_unregister(pcf->bl_pdev);
 
 	for (i = 0; i < PCF50633_NUM_REGULATORS; i++)
 		platform_device_unregister(pcf->regulator_pdev[i]);
Signature · 1 line
1.7.2
Signature · 4 lines
- Harald Welte <[email protected]>           http://laforge.gnumonks.org/
============================================================================
"Privacy in residential applications is a desirable marketing option."
                                                  (ETSI EN 300 175-7 Ch. A6)
#2 lore raw
In reply to Axel Lin

Hi Axel,

Quoted 2 lines · Axel Lin

Calling sysfs_remove_group() to remove sysfs entries and unregister bl_pdev in pcf50633_remove().

patch applied, thanks.

Cheers,
Samuel.

Quoted 29 lines
---
 drivers/mfd/pcf50633-core.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
drivers/mfd/pcf50633-core.c +2 -0
index 6d4233f..501ce13 100644
@@ -339,12 +339,14 @@ static int __devexit pcf50633_remove(struct i2c_client *client)
 	struct pcf50633 *pcf = i2c_get_clientdata(client);
 	int i;
 
+	sysfs_remove_group(&client->dev.kobj, &pcf_attr_group);
 	pcf50633_irq_free(pcf);
 
 	platform_device_unregister(pcf->input_pdev);
 	platform_device_unregister(pcf->rtc_pdev);
 	platform_device_unregister(pcf->mbc_pdev);
 	platform_device_unregister(pcf->adc_pdev);
+	platform_device_unregister(pcf->bl_pdev);
 
 	for (i = 0; i < PCF50633_NUM_REGULATORS; i++)
 		platform_device_unregister(pcf->regulator_pdev[i]);
Signature · 1 line
1.7.2
Signature · 2 lines
Intel Open Source Technology Centre
http://oss.intel.com/