Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 115516
b: refs/heads/master
c: dbee356
h: refs/heads/master
v: v3
  • Loading branch information
Dmitry Torokhov authored and Jean Delvare committed Oct 17, 2008
1 parent b31561b commit 3cd9972
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 26 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: ee4cd32ee8a68e22081f698602e4315fb4272853
refs/heads/master: dbee356262bb1c84cfa585530e33e7003534052a
42 changes: 17 additions & 25 deletions trunk/drivers/hwmon/ams/ams-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,39 +99,31 @@ static struct pmf_irq_client ams_shock_client = {
*/
static void ams_worker(struct work_struct *work)
{
mutex_lock(&ams_info.lock);

if (ams_info.has_device) {
unsigned long flags;
unsigned long flags;
u8 irqs_to_clear;

spin_lock_irqsave(&ams_info.irq_lock, flags);
mutex_lock(&ams_info.lock);

if (ams_info.worker_irqs & AMS_IRQ_FREEFALL) {
if (verbose)
printk(KERN_INFO "ams: freefall detected!\n");
spin_lock_irqsave(&ams_info.irq_lock, flags);
irqs_to_clear = ams_info.worker_irqs;

ams_info.worker_irqs &= ~AMS_IRQ_FREEFALL;
if (ams_info.worker_irqs & AMS_IRQ_FREEFALL) {
if (verbose)
printk(KERN_INFO "ams: freefall detected!\n");

/* we must call this with interrupts enabled */
spin_unlock_irqrestore(&ams_info.irq_lock, flags);
ams_info.clear_irq(AMS_IRQ_FREEFALL);
spin_lock_irqsave(&ams_info.irq_lock, flags);
}
ams_info.worker_irqs &= ~AMS_IRQ_FREEFALL;
}

if (ams_info.worker_irqs & AMS_IRQ_SHOCK) {
if (verbose)
printk(KERN_INFO "ams: shock detected!\n");
if (ams_info.worker_irqs & AMS_IRQ_SHOCK) {
if (verbose)
printk(KERN_INFO "ams: shock detected!\n");

ams_info.worker_irqs &= ~AMS_IRQ_SHOCK;
ams_info.worker_irqs &= ~AMS_IRQ_SHOCK;
}

/* we must call this with interrupts enabled */
spin_unlock_irqrestore(&ams_info.irq_lock, flags);
ams_info.clear_irq(AMS_IRQ_SHOCK);
spin_lock_irqsave(&ams_info.irq_lock, flags);
}
spin_unlock_irqrestore(&ams_info.irq_lock, flags);

spin_unlock_irqrestore(&ams_info.irq_lock, flags);
}
ams_info.clear_irq(irqs_to_clear);

mutex_unlock(&ams_info.lock);
}
Expand Down

0 comments on commit 3cd9972

Please sign in to comment.