[media] em28xx: ensure "closing" messages terminate with a newline
[firefly-linux-kernel-4.4.55.git] / drivers / media / usb / em28xx / em28xx-input.c
index 23f8f6afa2e061a783ee9fa5c0d244c9c6018dcf..aea22deadc0a60b33f4f1dff35653920ba0e28f6 100644 (file)
@@ -459,7 +459,7 @@ static int em28xx_ir_change_protocol(struct rc_dev *rc_dev, u64 *rc_type)
                return em2874_ir_change_protocol(rc_dev, rc_type);
        default:
                printk("Unrecognized em28xx chip id 0x%02x: IR not supported\n",
-                       dev->chip_id);
+                      dev->chip_id);
                return -EINVAL;
        }
 }
@@ -505,7 +505,7 @@ static void em28xx_query_buttons(struct work_struct *work)
                /* Check states of the buttons and act */
                j = 0;
                while (dev->board.buttons[j].role >= 0 &&
-                        dev->board.buttons[j].role < EM28XX_NUM_BUTTON_ROLES) {
+                      dev->board.buttons[j].role < EM28XX_NUM_BUTTON_ROLES) {
                        struct em28xx_button *button = &dev->board.buttons[j];
                        /* Check if button uses the current address */
                        if (button->reg_r != dev->button_polling_addresses[i]) {
@@ -607,7 +607,7 @@ static void em28xx_init_buttons(struct em28xx *dev)
 
        dev->button_polling_interval = EM28XX_BUTTONS_DEBOUNCED_QUERY_INTERVAL;
        while (dev->board.buttons[i].role >= 0 &&
-                        dev->board.buttons[i].role < EM28XX_NUM_BUTTON_ROLES) {
+              dev->board.buttons[i].role < EM28XX_NUM_BUTTON_ROLES) {
                struct em28xx_button *button = &dev->board.buttons[i];
                /* Check if polling address is already on the list */
                addr_new = true;
@@ -653,11 +653,9 @@ next_button:
        /* Start polling */
        if (dev->num_button_polling_addresses) {
                memset(dev->button_polling_last_values, 0,
-                                              EM28XX_NUM_BUTTON_ADDRESSES_MAX);
-               INIT_DELAYED_WORK(&dev->buttons_query_work,
-                                                         em28xx_query_buttons);
+                      EM28XX_NUM_BUTTON_ADDRESSES_MAX);
                schedule_delayed_work(&dev->buttons_query_work,
-                              msecs_to_jiffies(dev->button_polling_interval));
+                                     msecs_to_jiffies(dev->button_polling_interval));
        }
 }
 
@@ -689,6 +687,7 @@ static int em28xx_ir_init(struct em28xx *dev)
        }
 
        kref_get(&dev->ref);
+       INIT_DELAYED_WORK(&dev->buttons_query_work, em28xx_query_buttons);
 
        if (dev->board.buttons)
                em28xx_init_buttons(dev);
@@ -833,7 +832,7 @@ static int em28xx_ir_fini(struct em28xx *dev)
                return 0;
        }
 
-       em28xx_info("Closing input extension");
+       em28xx_info("Closing input extension\n");
 
        em28xx_shutdown_buttons(dev);
 
@@ -841,8 +840,7 @@ static int em28xx_ir_fini(struct em28xx *dev)
        if (!ir)
                goto ref_put;
 
-       if (ir->rc)
-               rc_unregister_device(ir->rc);
+       rc_unregister_device(ir->rc);
 
        kfree(ir->i2c_client);
 
@@ -887,7 +885,7 @@ static int em28xx_ir_resume(struct em28xx *dev)
                schedule_delayed_work(&ir->work, msecs_to_jiffies(ir->polling));
        if (dev->num_button_polling_addresses)
                schedule_delayed_work(&dev->buttons_query_work,
-                              msecs_to_jiffies(dev->button_polling_interval));
+                                     msecs_to_jiffies(dev->button_polling_interval));
        return 0;
 }