{
int ret;
const struct firmware *fw;
- pr_debug("%s:\n", __func__);
+ dev_dbg(&d->udev->dev, "%s:\n", __func__);
if (!d->props->download_firmware) {
ret = -EINVAL;
ret = request_firmware(&fw, name, &d->udev->dev);
if (ret < 0) {
- pr_err("%s: Did not find the firmware file '%s'. " \
- "Please see linux/Documentation/dvb/ for " \
- "more details on firmware-problems. Status " \
- "%d\n", KBUILD_MODNAME, name, ret);
+ dev_err(&d->udev->dev, "%s: Did not find the firmware file "\
+ "'%s'. Please see linux/Documentation/dvb/ " \
+ "for more details on firmware-problems. " \
+ "Status %d\n", KBUILD_MODNAME, name, ret);
goto err;
}
- pr_info("%s: downloading firmware from file '%s'\n", KBUILD_MODNAME,
- name);
+ dev_info(&d->udev->dev, "%s: downloading firmware from file '%s'\n",
+ KBUILD_MODNAME, name);
ret = d->props->download_firmware(d, fw);
release_firmware(fw);
return ret;
err:
- pr_debug("%s: failed=%d\n", __func__, ret);
+ dev_dbg(&d->udev->dev, "%s: failed=%d\n", __func__, ret);
return ret;
}
static int dvb_usbv2_i2c_init(struct dvb_usb_device *d)
{
int ret;
- pr_debug("%s:\n", __func__);
+ dev_dbg(&d->udev->dev, "%s:\n", __func__);
if (!d->props->i2c_algo)
return 0;
ret = i2c_add_adapter(&d->i2c_adap);
if (ret < 0) {
d->i2c_adap.algo = NULL;
- pr_err("%s: i2c_add_adapter() failed=%d\n", KBUILD_MODNAME,
- ret);
+ dev_err(&d->udev->dev, "%s: i2c_add_adapter() failed=%d\n",
+ KBUILD_MODNAME, ret);
goto err;
}
return 0;
err:
- pr_debug("%s: failed=%d\n", __func__, ret);
+ dev_dbg(&d->udev->dev, "%s: failed=%d\n", __func__, ret);
return ret;
}
static int dvb_usbv2_i2c_exit(struct dvb_usb_device *d)
{
- pr_debug("%s:\n", __func__);
+ dev_dbg(&d->udev->dev, "%s:\n", __func__);
if (d->i2c_adap.algo)
i2c_del_adapter(&d->i2c_adap);
ret = d->rc.query(d);
if (ret < 0) {
- pr_err("%s: rc.query() failed=%d\n", KBUILD_MODNAME, ret);
+ dev_err(&d->udev->dev, "%s: rc.query() failed=%d\n",
+ KBUILD_MODNAME, ret);
return; /* stop polling */
}
{
int ret;
struct rc_dev *dev;
- pr_debug("%s:\n", __func__);
+ dev_dbg(&d->udev->dev, "%s:\n", __func__);
if (dvb_usbv2_disable_rc_polling || !d->props->get_rc_config)
return 0;
/* initialize a work queue for handling polling */
INIT_DELAYED_WORK(&d->rc_query_work,
dvb_usb_read_remote_control);
- pr_info("%s: schedule remote query interval to %d msecs\n",
- KBUILD_MODNAME, d->rc.interval);
+ dev_info(&d->udev->dev, "%s: schedule remote query interval " \
+ "to %d msecs\n", KBUILD_MODNAME,
+ d->rc.interval);
schedule_delayed_work(&d->rc_query_work,
msecs_to_jiffies(d->rc.interval));
}
return 0;
err:
- pr_debug("%s: failed=%d\n", __func__, ret);
+ dev_dbg(&d->udev->dev, "%s: failed=%d\n", __func__, ret);
return ret;
}
static int dvb_usbv2_remote_exit(struct dvb_usb_device *d)
{
- pr_debug("%s:\n", __func__);
+ dev_dbg(&d->udev->dev, "%s:\n", __func__);
if (d->rc_dev) {
cancel_delayed_work_sync(&d->rc_query_work);
int dvb_usbv2_adapter_stream_init(struct dvb_usb_adapter *adap)
{
- pr_debug("%s: adap=%d\n", __func__, adap->id);
+ dev_dbg(&adap_to_d(adap)->udev->dev, "%s: adap=%d\n", __func__,
+ adap->id);
adap->stream.udev = adap_to_d(adap)->udev;
adap->stream.user_priv = adap;
int dvb_usbv2_adapter_stream_exit(struct dvb_usb_adapter *adap)
{
- pr_debug("%s: adap=%d\n", __func__, adap->id);
+ dev_dbg(&adap_to_d(adap)->udev->dev, "%s: adap=%d\n", __func__,
+ adap->id);
return usb_urb_exitv2(&adap->stream);
}
struct dvb_usb_adapter *adap = dvbdmxfeed->demux->priv;
struct dvb_usb_device *d = adap_to_d(adap);
int ret;
- pr_debug("%s: adap=%d active_fe=%d feed_type=%d setting pid [%s]: " \
- "%04x (%04d) at index %d '%s'\n", __func__, adap->id,
- adap->active_fe, dvbdmxfeed->type,
+ dev_dbg(&d->udev->dev, "%s: adap=%d active_fe=%d feed_type=%d " \
+ "setting pid [%s]: %04x (%04d) at index %d '%s'\n",
+ __func__, adap->id, adap->active_fe, dvbdmxfeed->type,
adap->pid_filtering ? "yes" : "no", dvbdmxfeed->pid,
dvbdmxfeed->pid, dvbdmxfeed->index,
(count == 1) ? "on" : "off");
/* stop feeding if it is last pid */
if (adap->feed_count == 0) {
- pr_debug("%s: stop feeding\n", __func__);
+ dev_dbg(&d->udev->dev, "%s: stop feeding\n", __func__);
usb_urb_killv2(&adap->stream);
if (d->props->streaming_ctrl) {
ret = d->props->streaming_ctrl(
adap->fe[adap->active_fe], 0);
if (ret < 0) {
- pr_err("%s: streaming_ctrl() failed=%d\n",
- KBUILD_MODNAME, ret);
+ dev_err(&d->udev->dev, "%s: streaming_ctrl() " \
+ "failed=%d\n", KBUILD_MODNAME,
+ ret);
goto err_mutex_unlock;
}
}
ret = adap->props->pid_filter(adap, dvbdmxfeed->index,
dvbdmxfeed->pid, (count == 1) ? 1 : 0);
if (ret < 0)
- pr_err("%s: pid_filter() failed=%d\n",
- KBUILD_MODNAME, ret);
+ dev_err(&d->udev->dev, "%s: pid_filter() " \
+ "failed=%d\n", KBUILD_MODNAME,
+ ret);
/* start feeding if it is first pid */
if (adap->feed_count == 1 && count == 1) {
struct usb_data_stream_properties stream_props;
mutex_lock(&adap->sync_mutex);
- pr_debug("%s: start feeding\n", __func__);
+ dev_dbg(&d->udev->dev, "%s: start feeding\n", __func__);
/* resolve input and output streaming paramters */
if (d->props->get_stream_config) {
ret = adap->props->pid_filter_ctrl(adap,
adap->pid_filtering);
if (ret < 0) {
- pr_err("%s: pid_filter_ctrl() failed=%d\n",
+ dev_err(&d->udev->dev, "%s: " \
+ "pid_filter_ctrl() failed=%d\n",
KBUILD_MODNAME, ret);
goto err_mutex_unlock;
}
ret = d->props->streaming_ctrl(
adap->fe[adap->active_fe], 1);
if (ret < 0) {
- pr_err("%s: streaming_ctrl() failed=%d\n",
- KBUILD_MODNAME, ret);
+ dev_err(&d->udev->dev, "%s: streaming_ctrl() " \
+ "failed=%d\n", KBUILD_MODNAME,
+ ret);
goto err_mutex_unlock;
}
}
return 0;
err_mutex_unlock:
mutex_unlock(&adap->sync_mutex);
- pr_debug("%s: failed=%d\n", __func__, ret);
+ dev_dbg(&d->udev->dev, "%s: failed=%d\n", __func__, ret);
return ret;
}
{
int ret;
struct dvb_usb_device *d = adap_to_d(adap);
- pr_debug("%s: adap=%d\n", __func__, adap->id);
+ dev_dbg(&d->udev->dev, "%s: adap=%d\n", __func__, adap->id);
ret = dvb_register_adapter(&adap->dvb_adap, d->name, d->props->owner,
&d->udev->dev, d->props->adapter_nr);
if (ret < 0) {
- pr_debug("%s: dvb_register_adapter() failed=%d\n", __func__,
- ret);
+ dev_dbg(&d->udev->dev, "%s: dvb_register_adapter() failed=%d\n",
+ __func__, ret);
goto err_dvb_register_adapter;
}
if (ret < 0)
goto err_dvb_dmx_init;
- pr_info("%s: MAC address: %pM\n", KBUILD_MODNAME,
- adap->dvb_adap.proposed_mac);
+ dev_info(&d->udev->dev, "%s: MAC address: %pM\n",
+ KBUILD_MODNAME, adap->dvb_adap.proposed_mac);
}
adap->demux.dmx.capabilities = DMX_TS_FILTERING | DMX_SECTION_FILTERING;
adap->demux.write_to_decoder = NULL;
ret = dvb_dmx_init(&adap->demux);
if (ret < 0) {
- pr_err("%s: dvb_dmx_init() failed=%d\n", KBUILD_MODNAME, ret);
+ dev_err(&d->udev->dev, "%s: dvb_dmx_init() failed=%d\n",
+ KBUILD_MODNAME, ret);
goto err_dvb_dmx_init;
}
adap->dmxdev.capabilities = 0;
ret = dvb_dmxdev_init(&adap->dmxdev, &adap->dvb_adap);
if (ret < 0) {
- pr_err("%s: dvb_dmxdev_init() failed=%d\n", KBUILD_MODNAME,
- ret);
+ dev_err(&d->udev->dev, "%s: dvb_dmxdev_init() failed=%d\n",
+ KBUILD_MODNAME, ret);
goto err_dvb_dmxdev_init;
}
ret = dvb_net_init(&adap->dvb_adap, &adap->dvb_net, &adap->demux.dmx);
if (ret < 0) {
- pr_err("%s: dvb_net_init() failed=%d\n", KBUILD_MODNAME, ret);
+ dev_err(&d->udev->dev, "%s: dvb_net_init() failed=%d\n",
+ KBUILD_MODNAME, ret);
goto err_dvb_net_init;
}
int dvb_usbv2_adapter_dvb_exit(struct dvb_usb_adapter *adap)
{
- pr_debug("%s: adap=%d\n", __func__, adap->id);
+ dev_dbg(&adap_to_d(adap)->udev->dev, "%s: adap=%d\n", __func__,
+ adap->id);
if (adap->dvb_adap.priv) {
dvb_net_release(&adap->dvb_net);
if (d->powered == 0 || (onoff && d->powered == 1)) {
/* when switching from 1 to 0 or from 0 to 1 */
- pr_debug("%s: power control=%d\n", __func__, onoff);
+ dev_dbg(&d->udev->dev, "%s: power=%d\n", __func__, onoff);
if (d->props->power_ctrl) {
ret = d->props->power_ctrl(d, onoff);
if (ret < 0)
return 0;
err:
- pr_debug("%s: failed=%d\n", __func__, ret);
+ dev_dbg(&d->udev->dev, "%s: failed=%d\n", __func__, ret);
return ret;
}
struct dvb_usb_adapter *adap = fe->dvb->priv;
struct dvb_usb_device *d = adap_to_d(adap);
mutex_lock(&adap->sync_mutex);
- pr_debug("%s: adap=%d fe=%d\n", __func__, adap->id, fe->id);
+ dev_dbg(&d->udev->dev, "%s: adap=%d fe=%d\n", __func__, adap->id,
+ fe->id);
ret = dvb_usbv2_device_power_ctrl(d, 1);
if (ret < 0)
return 0;
err:
mutex_unlock(&adap->sync_mutex);
- pr_debug("%s: failed=%d\n", __func__, ret);
+ dev_dbg(&d->udev->dev, "%s: failed=%d\n", __func__, ret);
return ret;
}
struct dvb_usb_adapter *adap = fe->dvb->priv;
struct dvb_usb_device *d = adap_to_d(adap);
mutex_lock(&adap->sync_mutex);
- pr_debug("%s: adap=%d fe=%d\n", __func__, adap->id, fe->id);
+ dev_dbg(&d->udev->dev, "%s: adap=%d fe=%d\n", __func__, adap->id,
+ fe->id);
if (adap->fe_sleep[fe->id]) {
ret = adap->fe_sleep[fe->id](fe);
return 0;
err:
mutex_unlock(&adap->sync_mutex);
- pr_debug("%s: failed=%d\n", __func__, ret);
+ dev_dbg(&d->udev->dev, "%s: failed=%d\n", __func__, ret);
return ret;
}
{
int ret, i, count_registered = 0;
struct dvb_usb_device *d = adap_to_d(adap);
- pr_debug("%s: adap=%d\n", __func__, adap->id);
+ dev_dbg(&d->udev->dev, "%s: adap=%d\n", __func__, adap->id);
memset(adap->fe, 0, sizeof(adap->fe));
adap->active_fe = -1;
if (d->props->frontend_attach) {
ret = d->props->frontend_attach(adap);
if (ret < 0) {
- pr_debug("%s: frontend_attach() failed=%d\n", __func__,
- ret);
+ dev_dbg(&d->udev->dev, "%s: frontend_attach() " \
+ "failed=%d\n", __func__, ret);
goto err_dvb_frontend_detach;
}
} else {
- pr_debug("%s: frontend_attach() do not exists\n", __func__);
+ dev_dbg(&d->udev->dev, "%s: frontend_attach() do not exists\n",
+ __func__);
ret = 0;
goto err;
}
ret = dvb_register_frontend(&adap->dvb_adap, adap->fe[i]);
if (ret < 0) {
- pr_err("%s: frontend%d registration failed\n",
- KBUILD_MODNAME, i);
+ dev_err(&d->udev->dev, "%s: frontend%d registration " \
+ "failed\n", KBUILD_MODNAME, i);
goto err_dvb_unregister_frontend;
}
if (d->props->tuner_attach) {
ret = d->props->tuner_attach(adap);
if (ret < 0) {
- pr_debug("%s: tuner_attach() failed=%d\n", __func__,
- ret);
+ dev_dbg(&d->udev->dev, "%s: tuner_attach() failed=%d\n",
+ __func__, ret);
goto err_dvb_unregister_frontend;
}
}
}
err:
- pr_debug("%s: failed=%d\n", __func__, ret);
+ dev_dbg(&d->udev->dev, "%s: failed=%d\n", __func__, ret);
return ret;
}
int dvb_usbv2_adapter_frontend_exit(struct dvb_usb_adapter *adap)
{
int i;
- pr_debug("%s: adap=%d\n", __func__, adap->id);
+ dev_dbg(&adap_to_d(adap)->udev->dev, "%s: adap=%d\n", __func__,
+ adap->id);
for (i = MAX_NO_OF_FE_PER_ADAP - 1; i >= 0; i--) {
if (adap->fe[i]) {
/* speed - when running at FULL speed we need a HW PID filter */
if (d->udev->speed == USB_SPEED_FULL &&
!(adap->props->caps & DVB_USB_ADAP_HAS_PID_FILTER)) {
- pr_err("%s: this USB2.0 device cannot be run on a " \
- "USB1.1 port (it lacks a hardware " \
- "PID filter)\n", KBUILD_MODNAME);
+ dev_err(&d->udev->dev, "%s: this USB2.0 device " \
+ "cannot be run on a USB1.1 port (it " \
+ "lacks a hardware PID filter)\n",
+ KBUILD_MODNAME);
ret = -ENODEV;
goto err;
} else if ((d->udev->speed == USB_SPEED_FULL &&
adap->props->caps & DVB_USB_ADAP_HAS_PID_FILTER) ||
(adap->props->caps & DVB_USB_ADAP_NEED_PID_FILTERING)) {
- pr_info("%s: will use the device's hardware PID " \
- "filter (table count: %d)\n",
- KBUILD_MODNAME,
+ dev_info(&d->udev->dev, "%s: will use the device's " \
+ "hardware PID filter " \
+ "(table count: %d)\n", KBUILD_MODNAME,
adap->props->pid_filter_count);
adap->pid_filtering = 1;
adap->max_feed_count = adap->props->pid_filter_count;
} else {
- pr_info("%s: will pass the complete MPEG2 transport " \
- "stream to the software demuxer\n",
- KBUILD_MODNAME);
+ dev_info(&d->udev->dev, "%s: will pass the complete " \
+ "MPEG2 transport stream to the " \
+ "software demuxer\n", KBUILD_MODNAME);
adap->pid_filtering = 0;
adap->max_feed_count = 255;
}
if (!adap->pid_filtering && dvb_usb_force_pid_filter_usage &&
adap->props->caps & DVB_USB_ADAP_HAS_PID_FILTER) {
- pr_info("%s: pid filter enabled by module option\n",
- KBUILD_MODNAME);
+ dev_info(&d->udev->dev, "%s: PID filter enabled by " \
+ "module option\n", KBUILD_MODNAME);
adap->pid_filtering = 1;
adap->max_feed_count = adap->props->pid_filter_count;
}
return 0;
err:
- pr_debug("%s: failed=%d\n", __func__, ret);
+ dev_dbg(&d->udev->dev, "%s: failed=%d\n", __func__, ret);
return ret;
}
static int dvb_usbv2_adapter_exit(struct dvb_usb_device *d)
{
int i;
- pr_debug("%s:\n", __func__);
+ dev_dbg(&d->udev->dev, "%s:\n", __func__);
for (i = MAX_NO_OF_ADAPTER_PER_DEVICE - 1; i >= 0; i--) {
dvb_usbv2_adapter_frontend_exit(&d->adapter[i]);
/* general initialization functions */
static int dvb_usbv2_exit(struct dvb_usb_device *d)
{
- pr_debug("%s:\n", __func__);
+ dev_dbg(&d->udev->dev, "%s:\n", __func__);
dvb_usbv2_remote_exit(d);
dvb_usbv2_adapter_exit(d);
static int dvb_usbv2_init(struct dvb_usb_device *d)
{
int ret;
- pr_debug("%s:\n", __func__);
+ dev_dbg(&d->udev->dev, "%s:\n", __func__);
dvb_usbv2_device_power_ctrl(d, 1);
return 0;
err:
dvb_usbv2_device_power_ctrl(d, 0);
- pr_debug("%s: failed=%d\n", __func__, ret);
+ dev_dbg(&d->udev->dev, "%s: failed=%d\n", __func__, ret);
return ret;
}
container_of(work, struct dvb_usb_device, probe_work);
d->work_pid = current->pid;
- pr_debug("%s: work_pid=%d\n", __func__, d->work_pid);
+ dev_dbg(&d->udev->dev, "%s: work_pid=%d\n", __func__, d->work_pid);
if (d->props->size_of_priv) {
d->priv = kzalloc(d->props->size_of_priv, GFP_KERNEL);
if (!d->priv) {
- pr_err("%s: kzalloc() failed\n", KBUILD_MODNAME);
+ dev_err(&d->udev->dev, "%s: kzalloc() failed\n",
+ KBUILD_MODNAME);
ret = -ENOMEM;
goto err_usb_driver_release_interface;
}
if (ret == 0) {
;
} else if (ret == COLD) {
- pr_info("%s: found a '%s' in cold state\n",
- KBUILD_MODNAME, d->name);
+ dev_info(&d->udev->dev, "%s: found a '%s' in cold " \
+ "state\n", KBUILD_MODNAME, d->name);
if (!name)
name = d->props->firmware;
}
}
- pr_info("%s: found a '%s' in warm state\n", KBUILD_MODNAME, d->name);
+ dev_info(&d->udev->dev, "%s: found a '%s' in warm state\n",
+ KBUILD_MODNAME, d->name);
ret = dvb_usbv2_init(d);
if (ret < 0)
goto err_usb_driver_release_interface;
- pr_info("%s: '%s' successfully initialized and connected\n",
- KBUILD_MODNAME, d->name);
+ dev_info(&d->udev->dev, "%s: '%s' successfully initialized and " \
+ "connected\n", KBUILD_MODNAME, d->name);
return;
err_usb_driver_release_interface:
- pr_info("%s: '%s' error while loading driver (%d)\n", KBUILD_MODNAME,
- d->name, ret);
+ dev_info(&d->udev->dev, "%s: '%s' error while loading driver (%d)\n",
+ KBUILD_MODNAME, d->name, ret);
usb_driver_release_interface(to_usb_driver(d->intf->dev.driver),
d->intf);
- pr_debug("%s: failed=%d\n", __func__, ret);
+ dev_dbg(&d->udev->dev, "%s: failed=%d\n", __func__, ret);
return;
}
{
int ret;
struct dvb_usb_device *d;
+ struct usb_device *udev = interface_to_usbdev(intf);
struct dvb_usb_driver_info *driver_info =
(struct dvb_usb_driver_info *) id->driver_info;
- pr_debug("%s: bInterfaceNumber=%d\n", __func__,
+ dev_dbg(&udev->dev, "%s: bInterfaceNumber=%d\n", __func__,
intf->cur_altsetting->desc.bInterfaceNumber);
if (!id->driver_info) {
- pr_err("%s: driver_info failed\n", KBUILD_MODNAME);
+ dev_err(&udev->dev, "%s: driver_info failed\n", KBUILD_MODNAME);
ret = -ENODEV;
goto err;
}
d = kzalloc(sizeof(struct dvb_usb_device), GFP_KERNEL);
if (!d) {
- pr_err("%s: kzalloc() failed\n", KBUILD_MODNAME);
+ dev_err(&udev->dev, "%s: kzalloc() failed\n", KBUILD_MODNAME);
ret = -ENOMEM;
goto err;
}
d->name = driver_info->name;
d->rc_map = driver_info->rc_map;
- d->udev = interface_to_usbdev(intf);
+ d->udev = udev;
d->intf = intf;
d->props = driver_info->props;
usb_set_intfdata(intf, d);
ret = schedule_work(&d->probe_work);
if (ret < 0) {
- pr_err("%s: schedule_work() failed\n", KBUILD_MODNAME);
+ dev_err(&d->udev->dev, "%s: schedule_work() failed\n",
+ KBUILD_MODNAME);
goto err_kfree;
}
err_kfree:
kfree(d);
err:
- pr_debug("%s: failed=%d\n", __func__, ret);
+ dev_dbg(&udev->dev, "%s: failed=%d\n", __func__, ret);
return ret;
}
EXPORT_SYMBOL(dvb_usbv2_probe);
{
struct dvb_usb_device *d = usb_get_intfdata(intf);
const char *name = d->name;
- pr_debug("%s: pid=%d work_pid=%d\n", __func__, current->pid,
- d->work_pid);
+ struct device dev = d->udev->dev;
+ dev_dbg(&d->udev->dev, "%s: pid=%d work_pid=%d\n", __func__,
+ current->pid, d->work_pid);
/* ensure initialization work is finished until release resources */
if (d->work_pid != current->pid)
dvb_usbv2_exit(d);
- pr_info("%s: '%s' successfully deinitialized and disconnected\n",
+ dev_info(&dev, "%s: '%s' successfully deinitialized and disconnected\n",
KBUILD_MODNAME, name);
}
EXPORT_SYMBOL(dvb_usbv2_disconnect);
{
struct dvb_usb_device *d = usb_get_intfdata(intf);
int i;
- pr_debug("%s:\n", __func__);
+ dev_dbg(&d->udev->dev, "%s:\n", __func__);
/* stop remote controller poll */
if (d->rc.query && !d->rc.bulk_mode)
{
struct dvb_usb_device *d = usb_get_intfdata(intf);
int i;
- pr_debug("%s:\n", __func__);
+ dev_dbg(&d->udev->dev, "%s:\n", __func__);
/* start streaming */
for (i = 0; i < MAX_NO_OF_ADAPTER_PER_DEVICE; i++) {
int i;
u8 *b;
- pr_debug("%s: %s urb completed status=%d length=%d/%d" \
- " pack_num=%d errors=%d\n", __func__,
+ dev_dbg(&stream->udev->dev, "%s: %s urb completed status=%d " \
+ "length=%d/%d pack_num=%d errors=%d\n", __func__,
ptype == PIPE_ISOCHRONOUS ? "isoc" : "bulk",
urb->status, urb->actual_length,
urb->transfer_buffer_length,
case -ESHUTDOWN:
return;
default: /* error */
- pr_debug("%s: urb completition failed=%d\n", __func__,
- urb->status);
+ dev_dbg(&stream->udev->dev, "%s: urb completition failed=%d\n",
+ __func__, urb->status);
break;
}
case PIPE_ISOCHRONOUS:
for (i = 0; i < urb->number_of_packets; i++) {
if (urb->iso_frame_desc[i].status != 0)
- pr_debug("%s: iso frame descriptor has an " \
- "error=%d\n", __func__,
+ dev_dbg(&stream->udev->dev, "%s: iso frame " \
+ "descriptor has an error=%d\n",
+ __func__,
urb->iso_frame_desc[i].status);
else if (urb->iso_frame_desc[i].actual_length > 0)
stream->complete(stream,
stream->complete(stream, b, urb->actual_length);
break;
default:
- pr_err("%s: unknown endpoint type in completition handler\n",
- KBUILD_MODNAME);
+ dev_err(&stream->udev->dev, "%s: unknown endpoint type in " \
+ "completition handler\n", KBUILD_MODNAME);
return;
}
usb_submit_urb(urb, GFP_ATOMIC);
{
int i;
for (i = 0; i < stream->urbs_submitted; i++) {
- pr_debug("%s: kill urb=%d\n", __func__, i);
+ dev_dbg(&stream->udev->dev, "%s: kill urb=%d\n", __func__, i);
/* stop the URB */
usb_kill_urb(stream->urb_list[i]);
}
}
for (i = 0; i < stream->urbs_initialized; i++) {
- pr_debug("%s: submit urb=%d\n", __func__, i);
+ dev_dbg(&stream->udev->dev, "%s: submit urb=%d\n", __func__, i);
ret = usb_submit_urb(stream->urb_list[i], GFP_ATOMIC);
if (ret) {
- pr_err("%s: could not submit urb no. %d - get them " \
- "all back\n", KBUILD_MODNAME, i);
+ dev_err(&stream->udev->dev, "%s: could not submit " \
+ "urb no. %d - get them all back\n",
+ KBUILD_MODNAME, i);
usb_urb_killv2(stream);
return ret;
}
for (i = stream->urbs_initialized - 1; i >= 0; i--) {
if (stream->urb_list[i]) {
- pr_debug("%s: free urb=%d\n", __func__, i);
+ dev_dbg(&stream->udev->dev, "%s: free urb=%d\n",
+ __func__, i);
/* free the URBs */
usb_free_urb(stream->urb_list[i]);
}
/* allocate the URBs */
for (i = 0; i < stream->props.count; i++) {
- pr_debug("%s: alloc urb=%d\n", __func__, i);
+ dev_dbg(&stream->udev->dev, "%s: alloc urb=%d\n", __func__, i);
stream->urb_list[i] = usb_alloc_urb(0, GFP_ATOMIC);
if (!stream->urb_list[i]) {
- pr_debug("%s: failed\n", __func__);
+ dev_dbg(&stream->udev->dev, "%s: failed\n", __func__);
for (j = 0; j < i; j++)
usb_free_urb(stream->urb_list[j]);
return -ENOMEM;
for (i = 0; i < stream->props.count; i++) {
struct urb *urb;
int frame_offset = 0;
- pr_debug("%s: alloc urb=%d\n", __func__, i);
+ dev_dbg(&stream->udev->dev, "%s: alloc urb=%d\n", __func__, i);
stream->urb_list[i] = usb_alloc_urb(
stream->props.u.isoc.framesperurb, GFP_ATOMIC);
if (!stream->urb_list[i]) {
- pr_debug("%s: failed\n", __func__);
+ dev_dbg(&stream->udev->dev, "%s: failed\n", __func__);
for (j = 0; j < i; j++)
usb_free_urb(stream->urb_list[j]);
return -ENOMEM;
if (stream->state & USB_STATE_URB_BUF) {
while (stream->buf_num) {
stream->buf_num--;
- pr_debug("%s: free buf=%d\n", __func__,
- stream->buf_num);
+ dev_dbg(&stream->udev->dev, "%s: free buf=%d\n",
+ __func__, stream->buf_num);
usb_free_coherent(stream->udev, stream->buf_size,
stream->buf_list[stream->buf_num],
stream->dma_addr[stream->buf_num]);
stream->buf_num = 0;
stream->buf_size = size;
- pr_debug("%s: all in all I will use %lu bytes for streaming\n",
- __func__, num * size);
+ dev_dbg(&stream->udev->dev, "%s: all in all I will use %lu bytes for " \
+ "streaming\n", __func__, num * size);
for (stream->buf_num = 0; stream->buf_num < num; stream->buf_num++) {
stream->buf_list[stream->buf_num] = usb_alloc_coherent(
stream->udev, size, GFP_ATOMIC,
&stream->dma_addr[stream->buf_num]);
if (!stream->buf_list[stream->buf_num]) {
- pr_debug("%s: alloc buf=%d failed\n", __func__,
- stream->buf_num);
+ dev_dbg(&stream->udev->dev, "%s: alloc buf=%d failed\n",
+ __func__, stream->buf_num);
usb_free_stream_buffers(stream);
return -ENOMEM;
}
- pr_debug("%s: alloc buf=%d %p (dma %llu)\n", __func__,
- stream->buf_num,
+ dev_dbg(&stream->udev->dev, "%s: alloc buf=%d %p (dma %llu)\n",
+ __func__, stream->buf_num,
stream->buf_list[stream->buf_num],
(long long)stream->dma_addr[stream->buf_num]);
memset(stream->buf_list[stream->buf_num], 0, size);
} else if (props->type == USB_ISOC) {
buf_size = props->u.isoc.framesize * props->u.isoc.framesperurb;
} else {
- pr_err("%s: invalid endpoint type=%d\n", KBUILD_MODNAME,
- props->type);
+ dev_err(&stream->udev->dev, "%s: invalid endpoint type=%d\n",
+ KBUILD_MODNAME, props->type);
return -EINVAL;
}
if (stream->buf_num < props->count || stream->buf_size < buf_size) {
- pr_err("%s: cannot reconfigure as allocated buffers are too " \
- "small\n", KBUILD_MODNAME);
+ dev_err(&stream->udev->dev, "%s: cannot reconfigure as " \
+ "allocated buffers are too small\n",
+ KBUILD_MODNAME);
return -EINVAL;
}
return 0;
}
- pr_debug("%s: re-alloc urbs\n", __func__);
+ dev_dbg(&stream->udev->dev, "%s: re-alloc urbs\n", __func__);
usb_urb_free_urbs(stream);
memcpy(&stream->props, props, sizeof(*props));
stream->props.endpoint));
if (!stream->complete) {
- pr_err("%s: there is no data callback - this doesn't make " \
- "sense\n", KBUILD_MODNAME);
+ dev_err(&stream->udev->dev, "%s: there is no data callback - " \
+ "this doesn't make sense\n", KBUILD_MODNAME);
return -EINVAL;
}
return usb_urb_alloc_isoc_urbs(stream);
default:
- pr_err("%s: unknown urb-type for data transfer\n",
- KBUILD_MODNAME);
+ dev_err(&stream->udev->dev, "%s: unknown urb-type for data " \
+ "transfer\n", KBUILD_MODNAME);
return -EINVAL;
}
}