diff options
Diffstat (limited to 'drivers/media/usb/em28xx/em28xx-camera.c')
-rw-r--r-- | drivers/media/usb/em28xx/em28xx-camera.c | 53 |
1 files changed, 26 insertions, 27 deletions
diff --git a/drivers/media/usb/em28xx/em28xx-camera.c b/drivers/media/usb/em28xx/em28xx-camera.c index 72f3f4d50253..a24695474212 100644 --- a/drivers/media/usb/em28xx/em28xx-camera.c +++ b/drivers/media/usb/em28xx/em28xx-camera.c @@ -19,14 +19,14 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +#include "em28xx.h" + #include <linux/i2c.h> #include <media/soc_camera.h> #include <media/i2c/mt9v011.h> #include <media/v4l2-clk.h> #include <media/v4l2-common.h> -#include "em28xx.h" - /* Possible i2c addresses of Micron sensors */ static unsigned short micron_sensor_addrs[] = { 0xb8 >> 1, /* MT9V111, MT9V403 */ @@ -120,14 +120,14 @@ static int em28xx_probe_sensor_micron(struct em28xx *dev) ret = i2c_master_send(&client, ®, 1); if (ret < 0) { if (ret != -ENXIO) - em28xx_errdev("couldn't read from i2c device 0x%02x: error %i\n", - client.addr << 1, ret); + pr_err("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) { - em28xx_errdev("couldn't read from i2c device 0x%02x: error %i\n", - client.addr << 1, ret); + pr_err("couldn't read from i2c device 0x%02x: error %i\n", + client.addr << 1, ret); continue; } id = be16_to_cpu(id_be); @@ -135,14 +135,14 @@ static int em28xx_probe_sensor_micron(struct em28xx *dev) reg = 0xff; ret = i2c_master_send(&client, ®, 1); if (ret < 0) { - em28xx_errdev("couldn't read from i2c device 0x%02x: error %i\n", - client.addr << 1, ret); + pr_err("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) { - em28xx_errdev("couldn't read from i2c device 0x%02x: error %i\n", - client.addr << 1, ret); + pr_err("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,15 +180,14 @@ static int em28xx_probe_sensor_micron(struct em28xx *dev) dev->em28xx_sensor = EM28XX_MT9M001; break; default: - em28xx_info("unknown Micron sensor detected: 0x%04x\n", - id); + pr_info("unknown Micron sensor detected: 0x%04x\n", id); return 0; } if (dev->em28xx_sensor == EM28XX_NOSENSOR) - em28xx_info("unsupported sensor detected: %s\n", name); + pr_info("unsupported sensor detected: %s\n", name); else - em28xx_info("sensor %s detected\n", name); + pr_info("sensor %s detected\n", name); dev->i2c_client[dev->def_i2c_bus].addr = client.addr; return 0; @@ -218,16 +217,16 @@ static int em28xx_probe_sensor_omnivision(struct em28xx *dev) ret = i2c_smbus_read_byte_data(&client, reg); if (ret < 0) { if (ret != -ENXIO) - em28xx_errdev("couldn't read from i2c device 0x%02x: error %i\n", - client.addr << 1, ret); + pr_err("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) { - em28xx_errdev("couldn't read from i2c device 0x%02x: error %i\n", - client.addr << 1, ret); + pr_err("couldn't read from i2c device 0x%02x: error %i\n", + client.addr << 1, ret); continue; } id += ret; @@ -238,16 +237,16 @@ static int em28xx_probe_sensor_omnivision(struct em28xx *dev) reg = 0x0a; ret = i2c_smbus_read_byte_data(&client, reg); if (ret < 0) { - em28xx_errdev("couldn't read from i2c device 0x%02x: error %i\n", - client.addr << 1, ret); + pr_err("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) { - em28xx_errdev("couldn't read from i2c device 0x%02x: error %i\n", - client.addr << 1, ret); + pr_err("couldn't read from i2c device 0x%02x: error %i\n", + client.addr << 1, ret); continue; } id += ret; @@ -285,15 +284,15 @@ static int em28xx_probe_sensor_omnivision(struct em28xx *dev) name = "OV9655"; break; default: - em28xx_info("unknown OmniVision sensor detected: 0x%04x\n", - id); + pr_info("unknown OmniVision sensor detected: 0x%04x\n", + id); return 0; } if (dev->em28xx_sensor == EM28XX_NOSENSOR) - em28xx_info("unsupported sensor detected: %s\n", name); + pr_info("unsupported sensor detected: %s\n", name); else - em28xx_info("sensor %s detected\n", name); + pr_info("sensor %s detected\n", name); dev->i2c_client[dev->def_i2c_bus].addr = client.addr; return 0; @@ -317,7 +316,7 @@ int em28xx_detect_sensor(struct em28xx *dev) */ if (dev->em28xx_sensor == EM28XX_NOSENSOR && ret < 0) { - em28xx_info("No sensor detected\n"); + pr_info("No sensor detected\n"); return -ENODEV; } |