Commit ce8591ff authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab

[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: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
parent 39ad799a
......@@ -55,9 +55,10 @@ MODULE_PARM_DESC(debug, "activates debug info");
#define EM28XX_MIN_AUDIO_PACKETS 64
#define dprintk(fmt, arg...) do { \
if (debug) \
printk(KERN_DEBUG pr_fmt("audio: %s: " fmt), \
__func__, ##arg); } while (0)
if (debug) \
dev_printk(KERN_DEBUG, &dev->udev->dev, \
"video: %s: " fmt, __func__, ## arg); \
} while (0)
static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX;
......@@ -91,7 +92,8 @@ static void em28xx_audio_isocirq(struct urb *urb)
struct snd_pcm_runtime *runtime;
if (dev->disconnected) {
dprintk("device disconnected while streaming. URB status=%d.\n", urb->status);
dprintk("device disconnected while streaming. URB status=%d.\n",
urb->status);
atomic_set(&dev->adev.stream_started, 0);
return;
}
......@@ -164,8 +166,9 @@ static void em28xx_audio_isocirq(struct urb *urb)
status = usb_submit_urb(urb, GFP_ATOMIC);
if (status < 0)
pr_err("resubmit of audio urb failed (error=%i)\n",
status);
dev_err(&dev->udev->dev,
"resubmit of audio urb failed (error=%i)\n",
status);
return;
}
......@@ -182,8 +185,9 @@ static int em28xx_init_audio_isoc(struct em28xx *dev)
errCode = usb_submit_urb(dev->adev.urb[i], GFP_ATOMIC);
if (errCode) {
pr_err("submit of audio urb failed (error=%i)\n",
errCode);
dev_err(&dev->udev->dev,
"submit of audio urb failed (error=%i)\n",
errCode);
em28xx_deinit_isoc_audio(dev);
atomic_set(&dev->adev.stream_started, 0);
return errCode;
......@@ -197,6 +201,7 @@ static int em28xx_init_audio_isoc(struct em28xx *dev)
static int snd_pcm_alloc_vmalloc_buffer(struct snd_pcm_substream *subs,
size_t size)
{
struct em28xx *dev = snd_pcm_substream_chip(subs);
struct snd_pcm_runtime *runtime = subs->runtime;
dprintk("Allocating vbuffer\n");
......@@ -254,7 +259,8 @@ static int snd_em28xx_capture_open(struct snd_pcm_substream *substream)
int nonblock, ret = 0;
if (!dev) {
pr_err("BUG: em28xx can't find device struct. Can't proceed with open\n");
dev_err(&dev->udev->dev,
"BUG: em28xx can't find device struct. Can't proceed with open\n");
return -ENODEV;
}
......@@ -317,7 +323,8 @@ static int snd_em28xx_capture_open(struct snd_pcm_substream *substream)
err:
mutex_unlock(&dev->lock);
pr_err("Error while configuring em28xx mixer\n");
dev_err(&dev->udev->dev,
"Error while configuring em28xx mixer\n");
return ret;
}
......@@ -755,7 +762,7 @@ static int em28xx_audio_urb_init(struct em28xx *dev)
intf = usb_ifnum_to_if(dev->udev, dev->ifnum);
if (intf->num_altsetting <= alt) {
pr_err("alt %d doesn't exist on interface %d\n",
dev_err(&dev->udev->dev, "alt %d doesn't exist on interface %d\n",
dev->ifnum, alt);
return -ENODEV;
}
......@@ -771,18 +778,17 @@ static int em28xx_audio_urb_init(struct em28xx *dev)
}
if (!ep) {
pr_err("Couldn't find an audio endpoint");
dev_err(&dev->udev->dev, "Couldn't find an audio endpoint");
return -ENODEV;
}
ep_size = em28xx_audio_ep_packet_size(dev->udev, ep);
interval = 1 << (ep->bInterval - 1);
pr_info("Endpoint 0x%02x %s on intf %d alt %d interval = %d, size %d\n",
EM28XX_EP_AUDIO, usb_speed_string(dev->udev->speed),
dev->ifnum, alt,
interval,
ep_size);
dev_info(&dev->udev->dev,
"Endpoint 0x%02x %s on intf %d alt %d interval = %d, size %d\n",
EM28XX_EP_AUDIO, usb_speed_string(dev->udev->speed),
dev->ifnum, alt, interval, ep_size);
/* Calculate the number and size of URBs to better fit the audio samples */
......@@ -819,8 +825,9 @@ static int em28xx_audio_urb_init(struct em28xx *dev)
if (urb_size > ep_size * npackets)
npackets = DIV_ROUND_UP(urb_size, ep_size);
pr_info("Number of URBs: %d, with %d packets and %d size\n",
num_urb, npackets, urb_size);
dev_info(&dev->udev->dev,
"Number of URBs: %d, with %d packets and %d size\n",
num_urb, npackets, urb_size);
/* Estimate the bytes per period */
dev->adev.period = urb_size * npackets;
......@@ -857,7 +864,8 @@ static int em28xx_audio_urb_init(struct em28xx *dev)
buf = usb_alloc_coherent(dev->udev, npackets * ep_size, GFP_ATOMIC,
&urb->transfer_dma);
if (!buf) {
pr_err("usb_alloc_coherent failed!\n");
dev_err(&dev->udev->dev,
"usb_alloc_coherent failed!\n");
em28xx_audio_free_urb(dev);
return -ENOMEM;
}
......@@ -897,12 +905,14 @@ static int em28xx_audio_init(struct em28xx *dev)
return 0;
}
pr_info("Binding audio extension\n");
dev_info(&dev->udev->dev, "Binding audio extension\n");
kref_get(&dev->ref);
pr_info("em28xx-audio.c: Copyright (C) 2006 Markus Rechberger\n");
pr_info("em28xx-audio.c: Copyright (C) 2007-2016 Mauro Carvalho Chehab\n");
dev_info(&dev->udev->dev,
"em28xx-audio.c: Copyright (C) 2006 Markus Rechberger\n");
dev_info(&dev->udev->dev,
"em28xx-audio.c: Copyright (C) 2007-2016 Mauro Carvalho Chehab\n");
err = snd_card_new(&dev->udev->dev, index[devnr], "Em28xx Audio",
THIS_MODULE, 0, &card);
......@@ -952,7 +962,7 @@ static int em28xx_audio_init(struct em28xx *dev)
if (err < 0)
goto urb_free;
pr_info("Audio extension successfully initialized\n");
dev_info(&dev->udev->dev, "Audio extension successfully initialized\n");
return 0;
urb_free:
......@@ -977,7 +987,7 @@ static int em28xx_audio_fini(struct em28xx *dev)
return 0;
}
pr_info("Closing audio extension\n");
dev_info(&dev->udev->dev, "Closing audio extension\n");
if (dev->adev.sndcard) {
snd_card_disconnect(dev->adev.sndcard);
......@@ -1001,7 +1011,7 @@ static int em28xx_audio_suspend(struct em28xx *dev)
if (dev->usb_audio_type != EM28XX_USB_AUDIO_VENDOR)
return 0;
pr_info("Suspending audio extension\n");
dev_info(&dev->udev->dev, "Suspending audio extension\n");
em28xx_deinit_isoc_audio(dev);
atomic_set(&dev->adev.stream_started, 0);
return 0;
......@@ -1015,7 +1025,7 @@ static int em28xx_audio_resume(struct em28xx *dev)
if (dev->usb_audio_type != EM28XX_USB_AUDIO_VENDOR)
return 0;
pr_info("Resuming audio extension\n");
dev_info(&dev->udev->dev, "Resuming audio extension\n");
/* Nothing to do other than schedule_work() ?? */
schedule_work(&dev->adev.wq_trigger);
return 0;
......
......@@ -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, &reg, 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, &reg, 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;
}
......
This diff is collapsed.
This diff is collapsed.
......@@ -73,9 +73,10 @@ MODULE_PARM_DESC(debug, "enable debug messages [dvb]");
DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
#define dprintk(level, fmt, arg...) do { \
if (debug >= level) \
printk(KERN_DEBUG "%s/2-dvb: " fmt, dev->name, ## arg); \
#define dprintk(level, fmt, arg...) do { \
if (debug >= level) \
dev_printk(KERN_DEBUG, &dev->udev->dev, \
"dvb: " fmt, ## arg); \
} while (0)
struct em28xx_dvb {
......@@ -735,7 +736,7 @@ static int em28xx_pctv_290e_set_lna(struct dvb_frontend *fe)
ret = gpio_request_one(dvb->lna_gpio, flags, NULL);
if (ret)
pr_err("gpio request failed %d\n", ret);
dev_err(&dev->udev->dev, "gpio request failed %d\n", ret);
else
gpio_free(dvb->lna_gpio);
......@@ -935,19 +936,20 @@ static int em28xx_attach_xc3028(u8 addr, struct em28xx *dev)
cfg.ctrl = &ctl;
if (!dev->dvb->fe[0]) {
pr_err("dvb frontend not attached. Can't attach xc3028\n");
dev_err(&dev->udev->dev,
"dvb frontend not attached. Can't attach xc3028\n");
return -EINVAL;
}
fe = dvb_attach(xc2028_attach, dev->dvb->fe[0], &cfg);
if (!fe) {
pr_err("xc3028 attach failed\n");
dev_err(&dev->udev->dev, "xc3028 attach failed\n");
dvb_frontend_detach(dev->dvb->fe[0]);
dev->dvb->fe[0] = NULL;
return -EINVAL;
}
pr_info("xc3028 attached\n");
dev_info(&dev->udev->dev, "xc3028 attached\n");
return 0;
}
......@@ -963,11 +965,13 @@ static int em28xx_register_dvb(struct em28xx_dvb *dvb, struct module *module,
mutex_init(&dvb->lock);
/* register adapter */
result = dvb_register_adapter(&dvb->adapter, dev->name, module, device,
adapter_nr);
result = dvb_register_adapter(&dvb->adapter,
dev_name(&dev->udev->dev), module,
device, adapter_nr);
if (result < 0) {
pr_warn("dvb_register_adapter failed (errno = %d)\n",
result);
dev_warn(&dev->udev->dev,
"dvb_register_adapter failed (errno = %d)\n",
result);
goto fail_adapter;
}
#ifdef CONFIG_MEDIA_CONTROLLER_DVB
......@@ -984,8 +988,9 @@ static int em28xx_register_dvb(struct em28xx_dvb *dvb, struct module *module,
/* register frontend */
result = dvb_register_frontend(&dvb->adapter, dvb->fe[0]);
if (result < 0) {
pr_warn("dvb_register_frontend failed (errno = %d)\n",
result);
dev_warn(&dev->udev->dev,
"dvb_register_frontend failed (errno = %d)\n",
result);
goto fail_frontend0;
}
......@@ -993,8 +998,9 @@ static int em28xx_register_dvb(struct em28xx_dvb *dvb, struct module *module,
if (dvb->fe[1]) {
result = dvb_register_frontend(&dvb->adapter, dvb->fe[1]);
if (result < 0) {
pr_warn("2nd dvb_register_frontend failed (errno = %d)\n",
result);
dev_warn(&dev->udev->dev,
"2nd dvb_register_frontend failed (errno = %d)\n",
result);
goto fail_frontend1;
}
}
......@@ -1011,7 +1017,9 @@ static int em28xx_register_dvb(struct em28xx_dvb *dvb, struct module *module,
result = dvb_dmx_init(&dvb->demux);
if (result < 0) {
pr_warn("dvb_dmx_init failed (errno = %d)\n", result);
dev_warn(&dev->udev->dev,
"dvb_dmx_init failed (errno = %d)\n",
result);
goto fail_dmx;
}
......@@ -1020,29 +1028,35 @@ static int em28xx_register_dvb(struct em28xx_dvb *dvb, struct module *module,
dvb->dmxdev.capabilities = 0;
result = dvb_dmxdev_init(&dvb->dmxdev, &dvb->adapter);
if (result < 0) {
pr_warn("dvb_dmxdev_init failed (errno = %d)\n", result);
dev_warn(&dev->udev->dev,
"dvb_dmxdev_init failed (errno = %d)\n",
result);
goto fail_dmxdev;
}
dvb->fe_hw.source = DMX_FRONTEND_0;
result = dvb->demux.dmx.add_frontend(&dvb->demux.dmx, &dvb->fe_hw);
if (result < 0) {
pr_warn("add_frontend failed (DMX_FRONTEND_0, errno = %d)\n",
result);
dev_warn(&dev->udev->dev,
"add_frontend failed (DMX_FRONTEND_0, errno = %d)\n",
result);
goto fail_fe_hw;
}
dvb->fe_mem.source = DMX_MEMORY_FE;
result = dvb->demux.dmx.add_frontend(&dvb->demux.dmx, &dvb->fe_mem);
if (result < 0) {
pr_warn("add_frontend failed (DMX_MEMORY_FE, errno = %d)\n",
result);
dev_warn(&dev->udev->dev,
"add_frontend failed (DMX_MEMORY_FE, errno = %d)\n",
result);
goto fail_fe_mem;
}
result = dvb->demux.dmx.connect_frontend(&dvb->demux.dmx, &dvb->fe_hw);
if (result < 0) {
pr_warn("connect_frontend failed (errno = %d)\n", result);
dev_warn(&dev->udev->dev,
"connect_frontend failed (errno = %d)\n",
result);
goto fail_fe_conn;
}
......@@ -1114,7 +1128,7 @@ static int em28xx_dvb_init(struct em28xx *dev)
return 0;
}
pr_info("Binding DVB extension\n");
dev_info(&dev->udev->dev, "Binding DVB extension\n");
dvb = kzalloc(sizeof(struct em28xx_dvb), GFP_KERNEL);
if (!dvb)
......@@ -1138,7 +1152,8 @@ static int em28xx_dvb_init(struct em28xx *dev)
EM28XX_DVB_NUM_ISOC_PACKETS);
}
if (result) {
pr_err("em28xx_dvb: failed to pre-allocate USB transfer buffers for DVB.\n");
dev_err(&dev->udev->dev,
"failed to pre-allocate USB transfer buffers for DVB.\n");
kfree(dvb);
dev->dvb = NULL;
return result;
......@@ -1317,8 +1332,9 @@ static int em28xx_dvb_init(struct em28xx *dev)
result = gpio_request_one(dvb->lna_gpio,
GPIOF_OUT_INIT_LOW, NULL);
if (result)
pr_err("gpio request failed %d\n",
result);
dev_err(&dev->udev->dev,
"gpio request failed %d\n",
result);
else
gpio_free(dvb->lna_gpio);
......@@ -1933,11 +1949,12 @@ static int em28xx_dvb_init(struct em28xx *dev)
}
break;
default:
pr_err("The frontend of your DVB/ATSC card isn't supported yet\n");
dev_err(&dev->udev->dev,
"The frontend of your DVB/ATSC card isn't supported yet\n");
break;
}
if (NULL == dvb->fe[0]) {
pr_err("frontend initialization failed\n");
dev_err(&dev->udev->dev, "frontend initialization failed\n");
result = -EINVAL;
goto out_free;
}
......@@ -1952,7 +1969,7 @@ static int em28xx_dvb_init(struct em28xx *dev)
if (result < 0)
goto out_free;
pr_info("DVB extension successfully initialized\n");
dev_info(&dev->udev->dev, "DVB extension successfully initialized\n");
kref_get(&dev->ref);
......@@ -1992,7 +2009,7 @@ static int em28xx_dvb_fini(struct em28xx *dev)
if (!dev->dvb)
return 0;
pr_info("Closing DVB extension\n");
dev_info(&dev->udev->dev, "Closing DVB extension\n");
dvb = dev->dvb;
......@@ -2050,17 +2067,17 @@ static int em28xx_dvb_suspend(struct em28xx *dev)
if (!dev->board.has_dvb)
return 0;
pr_info("Suspending DVB extension\n");
dev_info(&dev->udev->dev, "Suspending DVB extension\n");
if (dev->dvb) {
struct em28xx_dvb *dvb = dev->dvb;
if (dvb->fe[0]) {
ret = dvb_frontend_suspend(dvb->fe[0]);
pr_info("fe0 suspend %d\n", ret);
dev_info(&dev->udev->dev, "fe0 suspend %d\n", ret);
}
if (dvb->fe[1]) {
dvb_frontend_suspend(dvb->fe[1]);
pr_info("fe1 suspend %d\n", ret);
dev_info(&dev->udev->dev, "fe1 suspend %d\n", ret);
}
}
......@@ -2077,18 +2094,18 @@ static int em28xx_dvb_resume(struct em28xx *dev)
if (!dev->board.has_dvb)
return 0;
pr_info("Resuming DVB extension\n");
dev_info(&dev->udev->dev, "Resuming DVB extension\n");
if (dev->dvb) {
struct em28xx_dvb *dvb = dev->dvb;
if (dvb->fe[0]) {
ret = dvb_frontend_resume(dvb->fe[0]);
pr_info("fe0 resume %d\n", ret);
dev_info(&dev->udev->dev, "fe0 resume %d\n", ret);
}
if (dvb->fe[1]) {
ret = dvb_frontend_resume(dvb->fe[1]);
pr_info("fe1 resume %d\n", ret);
dev_info(&dev->udev->dev, "fe1 resume %d\n", ret);
}
}
......
This diff is collapsed.
......@@ -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)
......
......@@ -27,6 +27,7 @@
#include <linux/module.h>
#include <linux/hardirq.h>
#include <linux/init.h>
#include <linux/usb.h>
#include "em28xx-v4l.h"
......@@ -64,8 +65,9 @@ static int vbi_buffer_prepare(struct vb2_buffer *vb)
size = v4l2->vbi_width * v4l2->vbi_height * 2;
if (vb2_plane_size(vb, 0) < size) {
pr_info("%s data will not fit into plane (%lu < %lu)\n",
__func__, vb2_plane_size(vb, 0), size);
dev_info(&dev->udev->dev,
"%s data will not fit into plane (%lu < %lu)\n",
__func__, vb2_plane_size(vb, 0), size);
return -EINVAL;
}
vb2_set_plane_payload(vb, 0, size);
......
This diff is collapsed.
......@@ -29,8 +29,6 @@
#define EM28XX_VERSION "0.2.2"
#define DRIVER_DESC "Empia em28xx device driver"
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/workqueue.h>
#include <linux/i2c.h>
#include <linux/mutex.h>
......@@ -612,7 +610,6 @@ struct em28xx {
struct em28xx_IR *ir;
/* generic device properties */
char name[30]; /* name (including minor) of the device */
int model; /* index in the device_data struct */
int devno; /* marks the number of this device */
enum em28xx_chip_id chip_id;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment