ARM: OMAP: H3 workqueue fixes
authorDirk Behme <dirk.behme@gmail.com>
Fri, 26 Jan 2007 00:26:46 +0000 (16:26 -0800)
committerTony Lindgren <tony@atomide.com>
Wed, 22 Aug 2007 07:42:51 +0000 (00:42 -0700)
Signed-off-by: Dirk Behme <dirk.behme@gmail.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
arch/arm/mach-omap1/board-h3.c
include/asm-arm/arch-omap/irda.h

index 7b260b7c537bb3040968b46e8284d87bf34ca129..79d4ef4c54d4818918b216db9da312d24e14b0bf 100644 (file)
@@ -294,9 +294,11 @@ static int h3_select_irda(struct device *dev, int state)
        return err;
 }
 
-static void set_trans_mode(void *data)
+static void set_trans_mode(struct work_struct *work)
 {
-       int *mode = data;
+       struct omap_irda_config *irda_config =
+               container_of(work, struct omap_irda_config, gpio_expa.work);
+       int mode = irda_config->mode;
        unsigned char expa;
        int err = 0;
 
@@ -306,7 +308,7 @@ static void set_trans_mode(void *data)
 
        expa &= ~0x03;
 
-       if (*mode & IR_SIRMODE) {
+       if (mode & IR_SIRMODE) {
                expa |= 0x01;
        } else { /* MIR/FIR */
                expa |= 0x03;
@@ -321,9 +323,9 @@ static int h3_transceiver_mode(struct device *dev, int mode)
 {
        struct omap_irda_config *irda_config = dev->platform_data;
 
+       irda_config->mode = mode;
        cancel_delayed_work(&irda_config->gpio_expa);
-       PREPARE_WORK(&irda_config->gpio_expa, set_trans_mode, &mode);
-#error this is not permitted - mode is an argument variable
+       PREPARE_DELAYED_WORK(&irda_config->gpio_expa, set_trans_mode);
        schedule_delayed_work(&irda_config->gpio_expa, 0);
 
        return 0;
index 345a649ec8389fbaf303bfab8297ddfa6a1676ac..96bb12fab4383582fbd11d5c979d0112fbd85180 100644 (file)
@@ -31,6 +31,7 @@ struct omap_irda_config {
        unsigned long src_start;
        int tx_trigger;
        int rx_trigger;
+       int mode;
 };
 
 #endif