| Submitter | Jean Delvare |
|---|---|
| Date | Jan. 31, 2010, 2:03 p.m. |
| Message ID | <20100131150323.06e0c876@hyperion.delvare> |
| Download | mbox | patch |
| Permalink | /patch/44119/ |
| State | Accepted |
| Commit | 98ceb75c7c14eada76b0aa9f03a635a735cee3cb |
| Delegated to: | Benjamin Herrenschmidt |
| Headers | show |
Comments
Ben,
I cannot find those two patches from Jean [0] in your tree, I take it
they'll be included and pushed to Linus in 2.6.34 then?
(Although I had hoped to see them in 2.6.33, I'm "testing"[1] them since
-rc2 on my PowerBook)
Thanks,
Christian.
[0] http://lists.ozlabs.org/pipermail/linuxppc-dev/2010-February/079958.html
http://lists.ozlabs.org/pipermail/linuxppc-dev/2010-February/079959.html
[1] http://www.mail-archive.com/linuxppc-dev@lists.ozlabs.org/msg40983.html
Patch
--- linux-2.6.33-rc3.orig/drivers/hwmon/ams/ams-core.c 2009-06-10 05:05:27.000000000 +0200 +++ linux-2.6.33-rc3/drivers/hwmon/ams/ams-core.c 2010-01-07 17:14:25.000000000 +0100 @@ -213,7 +213,7 @@ int __init ams_init(void) return -ENODEV; } -void ams_exit(void) +void ams_sensor_detach(void) { /* Remove input device */ ams_input_exit(); @@ -221,9 +221,6 @@ void ams_exit(void) /* Remove attributes */ device_remove_file(&ams_info.of_dev->dev, &dev_attr_current); - /* Shut down implementation */ - ams_info.exit(); - /* Flush interrupt worker * * We do this after ams_info.exit(), because an interrupt might @@ -239,6 +236,12 @@ void ams_exit(void) pmf_unregister_irq_client(&ams_freefall_client); } +static void __exit ams_exit(void) +{ + /* Shut down implementation */ + ams_info.exit(); +} + MODULE_AUTHOR("Stelian Pop, Michael Hanselmann"); MODULE_DESCRIPTION("Apple Motion Sensor driver"); MODULE_LICENSE("GPL"); --- linux-2.6.33-rc3.orig/drivers/hwmon/ams/ams-i2c.c 2009-06-10 05:05:27.000000000 +0200 +++ linux-2.6.33-rc3/drivers/hwmon/ams/ams-i2c.c 2010-01-07 17:12:46.000000000 +0100 @@ -238,6 +238,8 @@ static int ams_i2c_probe(struct i2c_clie static int ams_i2c_remove(struct i2c_client *client) { if (ams_info.has_device) { + ams_sensor_detach(); + /* Disable interrupts */ ams_i2c_set_irq(AMS_IRQ_ALL, 0); --- linux-2.6.33-rc3.orig/drivers/hwmon/ams/ams-pmu.c 2009-06-10 05:05:27.000000000 +0200 +++ linux-2.6.33-rc3/drivers/hwmon/ams/ams-pmu.c 2010-01-07 17:13:47.000000000 +0100 @@ -133,6 +133,8 @@ static void ams_pmu_get_xyz(s8 *x, s8 *y static void ams_pmu_exit(void) { + ams_sensor_detach(); + /* Disable interrupts */ ams_pmu_set_irq(AMS_IRQ_ALL, 0); --- linux-2.6.33-rc3.orig/drivers/hwmon/ams/ams.h 2009-06-10 05:05:27.000000000 +0200 +++ linux-2.6.33-rc3/drivers/hwmon/ams/ams.h 2010-01-07 17:11:43.000000000 +0100 @@ -61,6 +61,7 @@ extern struct ams ams_info; extern void ams_sensors(s8 *x, s8 *y, s8 *z); extern int ams_sensor_attach(void); +extern void ams_sensor_detach(void); extern int ams_pmu_init(struct device_node *np); extern int ams_i2c_init(struct device_node *np);