aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/drivers/push-switch.c
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2006-12-06 23:20:58 -0500
committerPaul Mundt <lethal@linux-sh.org>2006-12-11 18:42:07 -0500
commitfce3a24e7087ba1f56eea5ec14fec592e677e672 (patch)
tree47d38266092fc9087e2d5a7605775a8642efbb40 /arch/sh/drivers/push-switch.c
parentb482ad5daef786962279ae03090970b0ee8b8d1c (diff)
sh: push-switch fixups for work_struct API damage.
INIT_WORK() dropped the data arg, so now we have to stash an extra pointer and backpedal instead. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/drivers/push-switch.c')
-rw-r--r--arch/sh/drivers/push-switch.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/arch/sh/drivers/push-switch.c b/arch/sh/drivers/push-switch.c
index f2b9157c314f..b3d20c0e021f 100644
--- a/arch/sh/drivers/push-switch.c
+++ b/arch/sh/drivers/push-switch.c
@@ -14,7 +14,7 @@
14#include <asm/push-switch.h> 14#include <asm/push-switch.h>
15 15
16#define DRV_NAME "push-switch" 16#define DRV_NAME "push-switch"
17#define DRV_VERSION "0.1.0" 17#define DRV_VERSION "0.1.1"
18 18
19static ssize_t switch_show(struct device *dev, 19static ssize_t switch_show(struct device *dev,
20 struct device_attribute *attr, 20 struct device_attribute *attr,
@@ -32,10 +32,10 @@ static void switch_timer(unsigned long data)
32 schedule_work(&psw->work); 32 schedule_work(&psw->work);
33} 33}
34 34
35static void switch_work_handler(void *data) 35static void switch_work_handler(struct work_struct *work)
36{ 36{
37 struct platform_device *pdev = data; 37 struct push_switch *psw = container_of(work, struct push_switch, work);
38 struct push_switch *psw = platform_get_drvdata(pdev); 38 struct platform_device *pdev = psw->pdev;
39 39
40 psw->state = 0; 40 psw->state = 0;
41 41
@@ -76,12 +76,15 @@ static int switch_drv_probe(struct platform_device *pdev)
76 } 76 }
77 } 77 }
78 78
79 INIT_WORK(&psw->work, switch_work_handler, pdev); 79 INIT_WORK(&psw->work, switch_work_handler);
80 init_timer(&psw->debounce); 80 init_timer(&psw->debounce);
81 81
82 psw->debounce.function = switch_timer; 82 psw->debounce.function = switch_timer;
83 psw->debounce.data = (unsigned long)psw; 83 psw->debounce.data = (unsigned long)psw;
84 84
85 /* Workqueue API brain-damage */
86 psw->pdev = pdev;
87
85 platform_set_drvdata(pdev, psw); 88 platform_set_drvdata(pdev, psw);
86 89
87 return 0; 90 return 0;