diff options
author | Mauro Carvalho Chehab <mchehab@s-opensource.com> | 2016-10-20 12:42:03 +0200 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@s-opensource.com> | 2016-11-18 13:08:15 +0100 |
commit | ce8591ff023ef8e04750c2cc2882523619a80b58 (patch) | |
tree | a513137f48890cd4ef0e51966666b4398d2bb747 /drivers/media/usb/em28xx/em28xx-camera.c | |
parent | [media] msp3400: convert it to use dev_foo() macros (diff) | |
download | linux-ce8591ff023ef8e04750c2cc2882523619a80b58.tar.xz linux-ce8591ff023ef8e04750c2cc2882523619a80b58.zip |
[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-camera.c')
-rw-r--r-- | drivers/media/usb/em28xx/em28xx-camera.c | 60 |
1 files changed, 38 insertions, 22 deletions
diff --git a/drivers/media/usb/em28xx/em28xx-camera.c b/drivers/media/usb/em28xx/em28xx-camera.c index a24695474212..2e24b65901ec 100644 --- a/drivers/media/usb/em28xx/em28xx-camera.c +++ b/drivers/media/usb/em28xx/em28xx-camera.c @@ -22,6 +22,7 @@ #include "em28xx.h" #include <linux/i2c.h> +#include <linux/usb.h> #include <media/soc_camera.h> #include <media/i2c/mt9v011.h> #include <media/v4l2-clk.h> @@ -120,14 +121,16 @@ static int em28xx_probe_sensor_micron(struct em28xx *dev) ret = i2c_master_send(&client, ®, 1); if (ret < 0) { if (ret != -ENXIO) - pr_err("couldn't read from i2c device 0x%02x: error %i\n", + dev_err(&dev->udev->dev, + "couldn't read from i2c device 0x%02x: error %i\n", client.addr << 1, ret); continue; } ret = i2c_master_recv(&client, (u8 *)&id_be, 2); if (ret < 0) { - pr_err("couldn't read from i2c device 0x%02x: error %i\n", - client.addr << 1, ret); + dev_err(&dev->udev->dev, + "couldn't read from i2c device 0x%02x: error %i\n", + client.addr << 1, ret); continue; } id = be16_to_cpu(id_be); @@ -135,14 +138,16 @@ static int em28xx_probe_sensor_micron(struct em28xx *dev) reg = 0xff; ret = i2c_master_send(&client, ®, 1); if (ret < 0) { - pr_err("couldn't read from i2c device 0x%02x: error %i\n", - client.addr << 1, ret); + dev_err(&dev->udev->dev, + "couldn't read from i2c device 0x%02x: error %i\n", + client.addr << 1, ret); continue; } ret = i2c_master_recv(&client, (u8 *)&id_be, 2); if (ret < 0) { - pr_err("couldn't read from i2c device 0x%02x: error %i\n", - client.addr << 1, ret); + dev_err(&dev->udev->dev, + "couldn't read from i2c device 0x%02x: error %i\n", + client.addr << 1, ret); continue; } /* Validate chip ID to be sure we have a Micron device */ @@ -180,14 +185,17 @@ static int em28xx_probe_sensor_micron(struct em28xx *dev) dev->em28xx_sensor = EM28XX_MT9M001; break; default: - pr_info("unknown Micron sensor detected: 0x%04x\n", id); + dev_info(&dev->udev->dev, + "unknown Micron sensor detected: 0x%04x\n", id); return 0; } if (dev->em28xx_sensor == EM28XX_NOSENSOR) - pr_info("unsupported sensor detected: %s\n", name); + dev_info(&dev->udev->dev, + "unsupported sensor detected: %s\n", name); else - pr_info("sensor %s detected\n", name); + dev_info(&dev->udev->dev, + "sensor %s detected\n", name); dev->i2c_client[dev->def_i2c_bus].addr = client.addr; return 0; @@ -217,16 +225,18 @@ static int em28xx_probe_sensor_omnivision(struct em28xx *dev) ret = i2c_smbus_read_byte_data(&client, reg); if (ret < 0) { if (ret != -ENXIO) - pr_err("couldn't read from i2c device 0x%02x: error %i\n", - client.addr << 1, ret); + dev_err(&dev->udev->dev, + "couldn't read from i2c device 0x%02x: error %i\n", + client.addr << 1, ret); continue; } id = ret << 8; reg = 0x1d; ret = i2c_smbus_read_byte_data(&client, reg); if (ret < 0) { - pr_err("couldn't read from i2c device 0x%02x: error %i\n", - client.addr << 1, ret); + dev_err(&dev->udev->dev, + "couldn't read from i2c device 0x%02x: error %i\n", + client.addr << 1, ret); continue; } id += ret; @@ -237,16 +247,18 @@ static int em28xx_probe_sensor_omnivision(struct em28xx *dev) reg = 0x0a; ret = i2c_smbus_read_byte_data(&client, reg); if (ret < 0) { - pr_err("couldn't read from i2c device 0x%02x: error %i\n", - client.addr << 1, ret); + dev_err(&dev->udev->dev, + "couldn't read from i2c device 0x%02x: error %i\n", + client.addr << 1, ret); continue; } id = ret << 8; reg = 0x0b; ret = i2c_smbus_read_byte_data(&client, reg); if (ret < 0) { - pr_err("couldn't read from i2c device 0x%02x: error %i\n", - client.addr << 1, ret); + dev_err(&dev->udev->dev, + "couldn't read from i2c device 0x%02x: error %i\n", + client.addr << 1, ret); continue; } id += ret; @@ -284,15 +296,18 @@ static int em28xx_probe_sensor_omnivision(struct em28xx *dev) name = "OV9655"; break; default: - pr_info("unknown OmniVision sensor detected: 0x%04x\n", + dev_info(&dev->udev->dev, + "unknown OmniVision sensor detected: 0x%04x\n", id); return 0; } if (dev->em28xx_sensor == EM28XX_NOSENSOR) - pr_info("unsupported sensor detected: %s\n", name); + dev_info(&dev->udev->dev, + "unsupported sensor detected: %s\n", name); else - pr_info("sensor %s detected\n", name); + dev_info(&dev->udev->dev, + "sensor %s detected\n", name); dev->i2c_client[dev->def_i2c_bus].addr = client.addr; return 0; @@ -316,7 +331,8 @@ int em28xx_detect_sensor(struct em28xx *dev) */ if (dev->em28xx_sensor == EM28XX_NOSENSOR && ret < 0) { - pr_info("No sensor detected\n"); + dev_info(&dev->udev->dev, + "No sensor detected\n"); return -ENODEV; } |