diff options
author | Paul Mundt <lethal@linux-sh.org> | 2006-12-07 05:20:58 +0100 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2006-12-12 00:42:07 +0100 |
commit | fce3a24e7087ba1f56eea5ec14fec592e677e672 (patch) | |
tree | 47d38266092fc9087e2d5a7605775a8642efbb40 /arch/sh/drivers/push-switch.c | |
parent | sh: Shut up csum_ipv6_magic() warnings. (diff) | |
download | linux-fce3a24e7087ba1f56eea5ec14fec592e677e672.tar.xz linux-fce3a24e7087ba1f56eea5ec14fec592e677e672.zip |
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.c | 13 |
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 @@ #include <asm/push-switch.h> #define DRV_NAME "push-switch" -#define DRV_VERSION "0.1.0" +#define DRV_VERSION "0.1.1" static ssize_t switch_show(struct device *dev, struct device_attribute *attr, @@ -32,10 +32,10 @@ static void switch_timer(unsigned long data) schedule_work(&psw->work); } -static void switch_work_handler(void *data) +static void switch_work_handler(struct work_struct *work) { - struct platform_device *pdev = data; - struct push_switch *psw = platform_get_drvdata(pdev); + struct push_switch *psw = container_of(work, struct push_switch, work); + struct platform_device *pdev = psw->pdev; psw->state = 0; @@ -76,12 +76,15 @@ static int switch_drv_probe(struct platform_device *pdev) } } - INIT_WORK(&psw->work, switch_work_handler, pdev); + INIT_WORK(&psw->work, switch_work_handler); init_timer(&psw->debounce); psw->debounce.function = switch_timer; psw->debounce.data = (unsigned long)psw; + /* Workqueue API brain-damage */ + psw->pdev = pdev; + platform_set_drvdata(pdev, psw); return 0; |