Merge branch 'timers-cleanup-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
[pandora-kernel.git] / drivers / misc / ti-st / st_kim.c
index b4488c8..38fd2f0 100644 (file)
@@ -30,6 +30,7 @@
 #include <linux/debugfs.h>
 #include <linux/seq_file.h>
 #include <linux/sched.h>
+#include <linux/sysfs.h>
 #include <linux/tty.h>
 
 #include <linux/skbuff.h>
@@ -244,9 +245,9 @@ void skip_change_remote_baud(unsigned char **ptr, long *len)
                pr_err("invalid action after change remote baud command");
        } else {
                *ptr = *ptr + sizeof(struct bts_action) +
-                       ((struct bts_action *)nxt_action)->size;
+                       ((struct bts_action *)cur_action)->size;
                *len = *len - (sizeof(struct bts_action) +
-                               ((struct bts_action *)nxt_action)->size);
+                               ((struct bts_action *)cur_action)->size);
                /* warn user on not commenting these in firmware */
                pr_warn("skipping the wait event of change remote baud");
        }
@@ -603,6 +604,10 @@ void st_kim_ref(struct st_data_s **core_data, int id)
        struct kim_data_s       *kim_gdata;
        /* get kim_gdata reference from platform device */
        pdev = st_get_plat_device(id);
+       if (!pdev) {
+               *core_data = NULL;
+               return;
+       }
        kim_gdata = dev_get_drvdata(&pdev->dev);
        *core_data = kim_gdata->core_data;
 }