Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 181878
b: refs/heads/master
c: 98ceb75
h: refs/heads/master
v: v3
  • Loading branch information
Jean Delvare authored and Benjamin Herrenschmidt committed Feb 3, 2010
1 parent e40f840 commit 414f6df
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 33a470f6d5e1879c26f16f6b34dc09f82d44f6e9
refs/heads/master: 98ceb75c7c14eada76b0aa9f03a635a735cee3cb
11 changes: 7 additions & 4 deletions trunk/drivers/hwmon/ams/ams-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -213,17 +213,14 @@ int __init ams_init(void)
return -ENODEV;
}

void ams_exit(void)
void ams_sensor_detach(void)
{
/* Remove input device */
ams_input_exit();

/* 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
Expand All @@ -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");
Expand Down
2 changes: 2 additions & 0 deletions trunk/drivers/hwmon/ams/ams-i2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,8 @@ static int ams_i2c_probe(struct i2c_client *client,
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);

Expand Down
2 changes: 2 additions & 0 deletions trunk/drivers/hwmon/ams/ams-pmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,8 @@ static void ams_pmu_get_xyz(s8 *x, s8 *y, s8 *z)

static void ams_pmu_exit(void)
{
ams_sensor_detach();

/* Disable interrupts */
ams_pmu_set_irq(AMS_IRQ_ALL, 0);

Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/hwmon/ams/ams.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 414f6df

Please sign in to comment.