summaryrefslogtreecommitdiff
path: root/drivers/media/usb/em28xx/em28xx-input.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@s-opensource.com>2016-10-20 13:42:03 +0300
committerMauro Carvalho Chehab <mchehab@s-opensource.com>2016-11-18 15:08:15 +0300
commitce8591ff023ef8e04750c2cc2882523619a80b58 (patch)
treea513137f48890cd4ef0e51966666b4398d2bb747 /drivers/media/usb/em28xx/em28xx-input.c
parent39ad799a85e2afb2eeb0295cabe81e183b011b95 (diff)
downloadlinux-ce8591ff023ef8e04750c2cc2882523619a80b58.tar.xz
[media] em28xx: convert it from pr_foo() to dev_foo()
Instead of using pr_foo(), use dev_foo(), with provides a better output. As this device is a multi-interface one, we'll set the device name to show the chipset and the driver used. While here, get rid of printk continuation messages. Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'drivers/media/usb/em28xx/em28xx-input.c')
-rw-r--r--drivers/media/usb/em28xx/em28xx-input.c42
1 files changed, 24 insertions, 18 deletions
diff --git a/drivers/media/usb/em28xx/em28xx-input.c b/drivers/media/usb/em28xx/em28xx-input.c
index 0e23e65eff15..a1904e2230ea 100644
--- a/drivers/media/usb/em28xx/em28xx-input.c
+++ b/drivers/media/usb/em28xx/em28xx-input.c
@@ -41,10 +41,11 @@ MODULE_PARM_DESC(ir_debug, "enable debug messages [IR]");
#define MODULE_NAME "em28xx"
-#define dprintk(fmt, arg...) \
- if (ir_debug) { \
- printk(KERN_DEBUG "%s/ir: " fmt, ir->name , ## arg); \
- }
+#define dprintk( fmt, arg...) do { \
+ if (ir_debug) \
+ dev_printk(KERN_DEBUG, &ir->dev->udev->dev, \
+ "input: %s: " fmt, __func__, ## arg); \
+} while (0)
/**********************************************************
Polling structure used by em28xx IR's
@@ -458,8 +459,9 @@ static int em28xx_ir_change_protocol(struct rc_dev *rc_dev, u64 *rc_type)
case CHIP_ID_EM28178:
return em2874_ir_change_protocol(rc_dev, rc_type);
default:
- pr_err("Unrecognized em28xx chip id 0x%02x: IR not supported\n",
- dev->chip_id);
+ dev_err(&ir->dev->udev->dev,
+ "Unrecognized em28xx chip id 0x%02x: IR not supported\n",
+ dev->chip_id);
return -EINVAL;
}
}
@@ -567,7 +569,7 @@ static int em28xx_register_snapshot_button(struct em28xx *dev)
struct input_dev *input_dev;
int err;
- pr_info("Registering snapshot button...\n");
+ dev_info(&dev->udev->dev, "Registering snapshot button...\n");
input_dev = input_allocate_device();
if (!input_dev)
return -ENOMEM;
@@ -591,7 +593,7 @@ static int em28xx_register_snapshot_button(struct em28xx *dev)
err = input_register_device(input_dev);
if (err) {
- pr_err("input_register_device failed\n");
+ dev_err(&dev->udev->dev, "input_register_device failed\n");
input_free_device(input_dev);
return err;
}
@@ -631,7 +633,8 @@ static void em28xx_init_buttons(struct em28xx *dev)
} else if (button->role == EM28XX_BUTTON_ILLUMINATION) {
/* Check sanity */
if (!em28xx_find_led(dev, EM28XX_LED_ILLUMINATION)) {
- pr_err("BUG: illumination button defined, but no illumination LED.\n");
+ dev_err(&dev->udev->dev,
+ "BUG: illumination button defined, but no illumination LED.\n");
goto next_button;
}
}
@@ -667,7 +670,7 @@ static void em28xx_shutdown_buttons(struct em28xx *dev)
dev->num_button_polling_addresses = 0;
/* Deregister input devices */
if (dev->sbutton_input_dev != NULL) {
- pr_info("Deregistering snapshot button\n");
+ dev_info(&dev->udev->dev, "Deregistering snapshot button\n");
input_unregister_device(dev->sbutton_input_dev);
dev->sbutton_input_dev = NULL;
}
@@ -696,18 +699,20 @@ static int em28xx_ir_init(struct em28xx *dev)
i2c_rc_dev_addr = em28xx_probe_i2c_ir(dev);
if (!i2c_rc_dev_addr) {
dev->board.has_ir_i2c = 0;
- pr_warn("No i2c IR remote control device found.\n");
+ dev_warn(&dev->udev->dev,
+ "No i2c IR remote control device found.\n");
return -ENODEV;
}
}
if (dev->board.ir_codes == NULL && !dev->board.has_ir_i2c) {
/* No remote control support */
- pr_warn("Remote control support is not available for this card.\n");
+ dev_warn(&dev->udev->dev,
+ "Remote control support is not available for this card.\n");
return 0;
}
- pr_info("Registering input extension\n");
+ dev_info(&dev->udev->dev, "Registering input extension\n");
ir = kzalloc(sizeof(*ir), GFP_KERNEL);
if (!ir)
@@ -791,7 +796,8 @@ static int em28xx_ir_init(struct em28xx *dev)
ir->polling = 100; /* ms */
/* init input device */
- snprintf(ir->name, sizeof(ir->name), "em28xx IR (%s)", dev->name);
+ snprintf(ir->name, sizeof(ir->name), "%s IR",
+ dev_name(&dev->udev->dev));
usb_make_path(dev->udev, ir->phys, sizeof(ir->phys));
strlcat(ir->phys, "/input0", sizeof(ir->phys));
@@ -810,7 +816,7 @@ static int em28xx_ir_init(struct em28xx *dev)
if (err)
goto error;
- pr_info("Input extension successfully initalized\n");
+ dev_info(&dev->udev->dev, "Input extension successfully initalized\n");
return 0;
@@ -831,7 +837,7 @@ static int em28xx_ir_fini(struct em28xx *dev)
return 0;
}
- pr_info("Closing input extension\n");
+ dev_info(&dev->udev->dev, "Closing input extension\n");
em28xx_shutdown_buttons(dev);
@@ -860,7 +866,7 @@ static int em28xx_ir_suspend(struct em28xx *dev)
if (dev->is_audio_only)
return 0;
- pr_info("Suspending input extension\n");
+ dev_info(&dev->udev->dev, "Suspending input extension\n");
if (ir)
cancel_delayed_work_sync(&ir->work);
cancel_delayed_work_sync(&dev->buttons_query_work);
@@ -877,7 +883,7 @@ static int em28xx_ir_resume(struct em28xx *dev)
if (dev->is_audio_only)
return 0;
- pr_info("Resuming input extension\n");
+ dev_info(&dev->udev->dev, "Resuming input extension\n");
/* if suspend calls ir_raw_event_unregister(), the should call
ir_raw_event_register() */
if (ir)