Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=fce3a24e7087ba1f56eea5ec14fec592e677e672
Commit:     fce3a24e7087ba1f56eea5ec14fec592e677e672
Parent:     b482ad5daef786962279ae03090970b0ee8b8d1c
Author:     Paul Mundt <[EMAIL PROTECTED]>
AuthorDate: Thu Dec 7 13:20:58 2006 +0900
Committer:  Paul Mundt <[EMAIL PROTECTED]>
CommitDate: Tue Dec 12 08:42:07 2006 +0900

    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 <[EMAIL PROTECTED]>
---
 arch/sh/drivers/push-switch.c |   13 ++++++++-----
 include/asm-sh/push-switch.h  |    3 +++
 2 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/arch/sh/drivers/push-switch.c b/arch/sh/drivers/push-switch.c
index f2b9157..b3d20c0 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;
diff --git a/include/asm-sh/push-switch.h b/include/asm-sh/push-switch.h
index dfc6bad..4903f9e 100644
--- a/include/asm-sh/push-switch.h
+++ b/include/asm-sh/push-switch.h
@@ -4,6 +4,7 @@
 #include <linux/timer.h>
 #include <linux/interrupt.h>
 #include <linux/workqueue.h>
+#include <linux/platform_device.h>
 
 struct push_switch {
        /* switch state */
@@ -12,6 +13,8 @@ struct push_switch {
        struct timer_list       debounce;
        /* workqueue */
        struct work_struct      work;
+       /* platform device, for workqueue handler */
+       struct platform_device  *pdev;
 };
 
 struct push_switch_platform_info {
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to