]> 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 1c9426fd5205665ff0ac45ba9ef35321489d2680..1f131ff1f69ebbd36aea284987388176b357b961 100644 (file)
@@ -270,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 */
@@ -322,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");