]> git.karo-electronics.de Git - linux-beck.git/blobdiff - drivers/input/serio/hp_sdc_mlc.c
Input: HIL - various fixes for HIL drivers
[linux-beck.git] / drivers / input / serio / hp_sdc_mlc.c
index e3c44ffae67420d75200ac6a807e0e1e3fe6aecb..1f131ff1f69ebbd36aea284987388176b357b961 100644 (file)
@@ -40,6 +40,7 @@
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/string.h>
+#include <asm/semaphore.h>
 
 #define PREFIX "HP SDC MLC: "
 
@@ -269,9 +270,10 @@ static void hp_sdc_mlc_out (hil_mlc *mlc) {
 
  do_control:
        priv->emtestmode = mlc->opacket & HIL_CTRL_TEST;
-       if ((mlc->opacket & (HIL_CTRL_APE | HIL_CTRL_IPF)) == HIL_CTRL_APE) {
-               BUG(); /* we cannot emulate this, it should not be used. */
-       }
+       
+       /* we cannot emulate this, it should not be used. */
+       BUG_ON((mlc->opacket & (HIL_CTRL_APE | HIL_CTRL_IPF)) == HIL_CTRL_APE);
+       
        if ((mlc->opacket & HIL_CTRL_ONLY) == HIL_CTRL_ONLY) goto control_only;
        if (mlc->opacket & HIL_CTRL_APE) { 
                BUG(); /* Should not send command/data after engaging APE */
@@ -321,11 +323,12 @@ static int __init hp_sdc_mlc_init(void)
        mlc->in                 = &hp_sdc_mlc_in;
        mlc->out                = &hp_sdc_mlc_out;
 
+       mlc->priv               = &hp_sdc_mlc_priv;
+
        if (hil_mlc_register(mlc)) {
                printk(KERN_WARNING PREFIX "Failed to register MLC structure with hil_mlc\n");
                goto err0;
        }
-       mlc->priv               = &hp_sdc_mlc_priv;
 
        if (hp_sdc_request_hil_irq(&hp_sdc_mlc_isr)) {
                printk(KERN_WARNING PREFIX "Request for raw HIL ISR hook denied\n");