Commit f093c388 authored by Antti Palosaari's avatar Antti Palosaari Committed by Mauro Carvalho Chehab

[media] dvb_usb_v2: use pointers to properties

Use pointers to properties as device and adapter properties are
constant. No need to embed and copy those structures.
Signed-off-by: default avatarAntti Palosaari <crope@iki.fi>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 53dc194f
...@@ -270,7 +270,7 @@ struct dvb_usb_adapter { ...@@ -270,7 +270,7 @@ struct dvb_usb_adapter {
#define DVB_USB_ADAP_STATE_DVB 0x001 #define DVB_USB_ADAP_STATE_DVB 0x001
int state; int state;
struct dvb_usb_device *dev; struct dvb_usb_device *dev;
struct dvb_usb_adapter_properties props; const struct dvb_usb_adapter_properties *props;
struct usb_data_stream stream; struct usb_data_stream stream;
u8 id; u8 id;
...@@ -316,7 +316,7 @@ struct dvb_usb_adapter { ...@@ -316,7 +316,7 @@ struct dvb_usb_adapter {
* in size_of_priv of dvb_usb_properties). * in size_of_priv of dvb_usb_properties).
*/ */
struct dvb_usb_device { struct dvb_usb_device {
struct dvb_usb_device_properties props; const struct dvb_usb_device_properties *props;
const char *name; const char *name;
const char *rc_map; const char *rc_map;
struct dvb_usb_rc rc; struct dvb_usb_rc rc;
......
...@@ -41,13 +41,13 @@ int dvb_usbv2_adapter_stream_init(struct dvb_usb_adapter *adap) ...@@ -41,13 +41,13 @@ int dvb_usbv2_adapter_stream_init(struct dvb_usb_adapter *adap)
adap->stream.user_priv = adap; adap->stream.user_priv = adap;
/* resolve USB stream configuration for buffer alloc */ /* resolve USB stream configuration for buffer alloc */
if (adap->dev->props.get_usb_stream_config) { if (adap->dev->props->get_usb_stream_config) {
ret = adap->dev->props.get_usb_stream_config(NULL, ret = adap->dev->props->get_usb_stream_config(NULL,
&stream_props); &stream_props);
if (ret < 0) if (ret < 0)
return ret; return ret;
} else { } else {
stream_props = adap->props.stream; stream_props = adap->props->stream;
} }
/* FIXME: can be removed as set later in anyway */ /* FIXME: can be removed as set later in anyway */
...@@ -80,8 +80,8 @@ static int dvb_usb_ctrl_feed(struct dvb_demux_feed *dvbdmxfeed, int onoff) ...@@ -80,8 +80,8 @@ static int dvb_usb_ctrl_feed(struct dvb_demux_feed *dvbdmxfeed, int onoff)
pr_debug("%s: stop feeding\n", __func__); pr_debug("%s: stop feeding\n", __func__);
usb_urb_killv2(&adap->stream); usb_urb_killv2(&adap->stream);
if (adap->dev->props.streaming_ctrl != NULL) { if (adap->dev->props->streaming_ctrl != NULL) {
ret = adap->dev->props.streaming_ctrl(adap, 0); ret = adap->dev->props->streaming_ctrl(adap, 0);
if (ret < 0) { if (ret < 0) {
pr_err("%s: error while stopping stream\n", pr_err("%s: error while stopping stream\n",
KBUILD_MODNAME); KBUILD_MODNAME);
...@@ -97,10 +97,10 @@ static int dvb_usb_ctrl_feed(struct dvb_demux_feed *dvbdmxfeed, int onoff) ...@@ -97,10 +97,10 @@ static int dvb_usb_ctrl_feed(struct dvb_demux_feed *dvbdmxfeed, int onoff)
adap->pid_filtering ? "yes" : "no", dvbdmxfeed->pid, adap->pid_filtering ? "yes" : "no", dvbdmxfeed->pid,
dvbdmxfeed->pid, dvbdmxfeed->index, dvbdmxfeed->pid, dvbdmxfeed->index,
onoff ? "on" : "off"); onoff ? "on" : "off");
if (adap->props.caps & DVB_USB_ADAP_HAS_PID_FILTER && if (adap->props->caps & DVB_USB_ADAP_HAS_PID_FILTER &&
adap->pid_filtering && adap->pid_filtering &&
adap->props.pid_filter != NULL) adap->props->pid_filter != NULL)
adap->props.pid_filter(adap, dvbdmxfeed->index, adap->props->pid_filter(adap, dvbdmxfeed->index,
dvbdmxfeed->pid, onoff); dvbdmxfeed->pid, onoff);
/* start the feed if this was the first feed and there is still a feed /* start the feed if this was the first feed and there is still a feed
...@@ -111,8 +111,8 @@ static int dvb_usb_ctrl_feed(struct dvb_demux_feed *dvbdmxfeed, int onoff) ...@@ -111,8 +111,8 @@ static int dvb_usb_ctrl_feed(struct dvb_demux_feed *dvbdmxfeed, int onoff)
unsigned int ts_props; unsigned int ts_props;
/* resolve TS configuration */ /* resolve TS configuration */
if (adap->dev->props.get_ts_config) { if (adap->dev->props->get_ts_config) {
ret = adap->dev->props.get_ts_config( ret = adap->dev->props->get_ts_config(
adap->fe[adap->active_fe], adap->fe[adap->active_fe],
&ts_props); &ts_props);
if (ret < 0) if (ret < 0)
...@@ -129,14 +129,14 @@ static int dvb_usb_ctrl_feed(struct dvb_demux_feed *dvbdmxfeed, int onoff) ...@@ -129,14 +129,14 @@ static int dvb_usb_ctrl_feed(struct dvb_demux_feed *dvbdmxfeed, int onoff)
adap->stream.complete = dvb_usb_data_complete; adap->stream.complete = dvb_usb_data_complete;
/* resolve USB stream configuration */ /* resolve USB stream configuration */
if (adap->dev->props.get_usb_stream_config) { if (adap->dev->props->get_usb_stream_config) {
ret = adap->dev->props.get_usb_stream_config( ret = adap->dev->props->get_usb_stream_config(
adap->fe[adap->active_fe], adap->fe[adap->active_fe],
&stream_props); &stream_props);
if (ret < 0) if (ret < 0)
return ret; return ret;
} else { } else {
stream_props = adap->props.stream; stream_props = adap->props->stream;
} }
pr_debug("%s: submitting all URBs\n", __func__); pr_debug("%s: submitting all URBs\n", __func__);
...@@ -144,11 +144,11 @@ static int dvb_usb_ctrl_feed(struct dvb_demux_feed *dvbdmxfeed, int onoff) ...@@ -144,11 +144,11 @@ static int dvb_usb_ctrl_feed(struct dvb_demux_feed *dvbdmxfeed, int onoff)
usb_urb_submitv2(&adap->stream, &stream_props); usb_urb_submitv2(&adap->stream, &stream_props);
pr_debug("%s: controlling pid parser\n", __func__); pr_debug("%s: controlling pid parser\n", __func__);
if (adap->props.caps & DVB_USB_ADAP_HAS_PID_FILTER && if (adap->props->caps & DVB_USB_ADAP_HAS_PID_FILTER &&
adap->props.caps & adap->props->caps &
DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF && DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF &&
adap->props.pid_filter_ctrl != NULL) { adap->props->pid_filter_ctrl != NULL) {
ret = adap->props.pid_filter_ctrl(adap, ret = adap->props->pid_filter_ctrl(adap,
adap->pid_filtering); adap->pid_filtering);
if (ret < 0) { if (ret < 0) {
pr_err("%s: could not handle pid_parser\n", pr_err("%s: could not handle pid_parser\n",
...@@ -157,8 +157,8 @@ static int dvb_usb_ctrl_feed(struct dvb_demux_feed *dvbdmxfeed, int onoff) ...@@ -157,8 +157,8 @@ static int dvb_usb_ctrl_feed(struct dvb_demux_feed *dvbdmxfeed, int onoff)
} }
} }
pr_debug("%s: start feeding\n", __func__); pr_debug("%s: start feeding\n", __func__);
if (adap->dev->props.streaming_ctrl != NULL) { if (adap->dev->props->streaming_ctrl != NULL) {
ret = adap->dev->props.streaming_ctrl(adap, 1); ret = adap->dev->props->streaming_ctrl(adap, 1);
if (ret < 0) { if (ret < 0) {
pr_err("%s: error while enabling fifo\n", pr_err("%s: error while enabling fifo\n",
KBUILD_MODNAME); KBUILD_MODNAME);
...@@ -190,18 +190,18 @@ static int dvb_usb_stop_feed(struct dvb_demux_feed *dvbdmxfeed) ...@@ -190,18 +190,18 @@ static int dvb_usb_stop_feed(struct dvb_demux_feed *dvbdmxfeed)
int dvb_usbv2_adapter_dvb_init(struct dvb_usb_adapter *adap) int dvb_usbv2_adapter_dvb_init(struct dvb_usb_adapter *adap)
{ {
int ret = dvb_register_adapter(&adap->dvb_adap, adap->dev->name, int ret = dvb_register_adapter(&adap->dvb_adap, adap->dev->name,
adap->dev->props.owner, adap->dev->props->owner,
&adap->dev->udev->dev, &adap->dev->udev->dev,
adap->dev->props.adapter_nr); adap->dev->props->adapter_nr);
if (ret < 0) { if (ret < 0) {
pr_debug("%s: dvb_register_adapter failed=%d\n", __func__, ret); pr_debug("%s: dvb_register_adapter failed=%d\n", __func__, ret);
goto err; goto err;
} }
adap->dvb_adap.priv = adap; adap->dvb_adap.priv = adap;
adap->dvb_adap.fe_ioctl_override = adap->props.fe_ioctl_override; adap->dvb_adap.fe_ioctl_override = adap->props->fe_ioctl_override;
if (adap->dev->props.read_mac_address) { if (adap->dev->props->read_mac_address) {
if (adap->dev->props.read_mac_address(adap->dev, if (adap->dev->props->read_mac_address(adap->dev,
adap->dvb_adap.proposed_mac) == 0) adap->dvb_adap.proposed_mac) == 0)
pr_info("%s: MAC address: %pM\n", KBUILD_MODNAME, pr_info("%s: MAC address: %pM\n", KBUILD_MODNAME,
adap->dvb_adap.proposed_mac); adap->dvb_adap.proposed_mac);
...@@ -279,8 +279,8 @@ static int dvb_usb_fe_wakeup(struct dvb_frontend *fe) ...@@ -279,8 +279,8 @@ static int dvb_usb_fe_wakeup(struct dvb_frontend *fe)
if (ret < 0) if (ret < 0)
goto err; goto err;
if (adap->dev->props.frontend_ctrl) { if (adap->dev->props->frontend_ctrl) {
ret = adap->dev->props.frontend_ctrl(fe, 1); ret = adap->dev->props->frontend_ctrl(fe, 1);
if (ret < 0) if (ret < 0)
goto err; goto err;
} }
...@@ -310,8 +310,8 @@ static int dvb_usb_fe_sleep(struct dvb_frontend *fe) ...@@ -310,8 +310,8 @@ static int dvb_usb_fe_sleep(struct dvb_frontend *fe)
goto err; goto err;
} }
if (adap->dev->props.frontend_ctrl) { if (adap->dev->props->frontend_ctrl) {
ret = adap->dev->props.frontend_ctrl(fe, 0); ret = adap->dev->props->frontend_ctrl(fe, 0);
if (ret < 0) if (ret < 0)
goto err; goto err;
} }
...@@ -337,8 +337,8 @@ int dvb_usbv2_adapter_frontend_init(struct dvb_usb_adapter *adap) ...@@ -337,8 +337,8 @@ int dvb_usbv2_adapter_frontend_init(struct dvb_usb_adapter *adap)
memset(adap->fe, 0, sizeof(adap->fe)); memset(adap->fe, 0, sizeof(adap->fe));
adap->active_fe = -1; adap->active_fe = -1;
if (adap->dev->props.frontend_attach) { if (adap->dev->props->frontend_attach) {
ret = adap->dev->props.frontend_attach(adap); ret = adap->dev->props->frontend_attach(adap);
if (ret < 0) { if (ret < 0) {
pr_debug("%s: frontend_attach() failed=%d\n", __func__, pr_debug("%s: frontend_attach() failed=%d\n", __func__,
ret); ret);
...@@ -350,8 +350,8 @@ int dvb_usbv2_adapter_frontend_init(struct dvb_usb_adapter *adap) ...@@ -350,8 +350,8 @@ int dvb_usbv2_adapter_frontend_init(struct dvb_usb_adapter *adap)
goto err; goto err;
} }
if (adap->dev->props.tuner_attach) { if (adap->dev->props->tuner_attach) {
ret = adap->dev->props.tuner_attach(adap); ret = adap->dev->props->tuner_attach(adap);
if (ret < 0) { if (ret < 0) {
pr_debug("%s: tuner_attach() failed=%d\n", __func__, pr_debug("%s: tuner_attach() failed=%d\n", __func__,
ret); ret);
......
...@@ -30,14 +30,14 @@ static int dvb_usbv2_download_firmware(struct dvb_usb_device *d) ...@@ -30,14 +30,14 @@ static int dvb_usbv2_download_firmware(struct dvb_usb_device *d)
const char *name; const char *name;
/* resolve firmware name */ /* resolve firmware name */
name = d->props.firmware; name = d->props->firmware;
if (d->props.get_firmware_name) { if (d->props->get_firmware_name) {
ret = d->props.get_firmware_name(d, &name); ret = d->props->get_firmware_name(d, &name);
if (ret < 0) if (ret < 0)
goto err; goto err;
} }
if (!d->props.download_firmware) { if (!d->props->download_firmware) {
ret = -EINVAL; ret = -EINVAL;
goto err; goto err;
} }
...@@ -54,7 +54,7 @@ static int dvb_usbv2_download_firmware(struct dvb_usb_device *d) ...@@ -54,7 +54,7 @@ static int dvb_usbv2_download_firmware(struct dvb_usb_device *d)
pr_info("%s: downloading firmware from file '%s'\n", KBUILD_MODNAME, pr_info("%s: downloading firmware from file '%s'\n", KBUILD_MODNAME,
name); name);
ret = d->props.download_firmware(d, fw); ret = d->props->download_firmware(d, fw);
release_firmware(fw); release_firmware(fw);
...@@ -71,13 +71,13 @@ static int dvb_usbv2_i2c_init(struct dvb_usb_device *d) ...@@ -71,13 +71,13 @@ static int dvb_usbv2_i2c_init(struct dvb_usb_device *d)
{ {
int ret; int ret;
if (!d->props.i2c_algo) { if (!d->props->i2c_algo) {
ret = 0; ret = 0;
goto err; goto err;
} }
strlcpy(d->i2c_adap.name, d->name, sizeof(d->i2c_adap.name)); strlcpy(d->i2c_adap.name, d->name, sizeof(d->i2c_adap.name));
d->i2c_adap.algo = d->props.i2c_algo; d->i2c_adap.algo = d->props->i2c_algo;
d->i2c_adap.algo_data = NULL; d->i2c_adap.algo_data = NULL;
d->i2c_adap.dev.parent = &d->udev->dev; d->i2c_adap.dev.parent = &d->udev->dev;
...@@ -113,9 +113,9 @@ static int dvb_usbv2_adapter_init(struct dvb_usb_device *d) ...@@ -113,9 +113,9 @@ static int dvb_usbv2_adapter_init(struct dvb_usb_device *d)
int ret, i, adapter_count; int ret, i, adapter_count;
/* resolve adapter count */ /* resolve adapter count */
adapter_count = d->props.num_adapters; adapter_count = d->props->num_adapters;
if (d->props.get_adapter_count) { if (d->props->get_adapter_count) {
ret = d->props.get_adapter_count(d); ret = d->props->get_adapter_count(d);
if (ret < 0) if (ret < 0)
goto err; goto err;
...@@ -125,28 +125,26 @@ static int dvb_usbv2_adapter_init(struct dvb_usb_device *d) ...@@ -125,28 +125,26 @@ static int dvb_usbv2_adapter_init(struct dvb_usb_device *d)
for (i = 0; i < adapter_count; i++) { for (i = 0; i < adapter_count; i++) {
adap = &d->adapter[i]; adap = &d->adapter[i];
adap->dev = d; adap->dev = d;
adap->id = i; adap->id = i;
adap->props = &d->props->adapter[i];
memcpy(&adap->props, &d->props.adapter[i],
sizeof(struct dvb_usb_adapter_properties));
/* speed - when running at FULL speed we need a HW PID filter */ /* speed - when running at FULL speed we need a HW PID filter */
if (d->udev->speed == USB_SPEED_FULL && if (d->udev->speed == USB_SPEED_FULL &&
!(adap->props.caps & DVB_USB_ADAP_HAS_PID_FILTER)) { !(adap->props->caps & DVB_USB_ADAP_HAS_PID_FILTER)) {
pr_err("%s: this USB2.0 device cannot be run on a " \ pr_err("%s: this USB2.0 device cannot be run on a " \
"USB1.1 port (it lacks a hardware " \ "USB1.1 port (it lacks a hardware " \
"PID filter)\n", KBUILD_MODNAME); "PID filter)\n", KBUILD_MODNAME);
ret = -ENODEV; ret = -ENODEV;
goto err; goto err;
} else if ((d->udev->speed == USB_SPEED_FULL && } else if ((d->udev->speed == USB_SPEED_FULL &&
adap->props.caps & DVB_USB_ADAP_HAS_PID_FILTER) || adap->props->caps & DVB_USB_ADAP_HAS_PID_FILTER) ||
(adap->props.caps & DVB_USB_ADAP_NEED_PID_FILTERING)) { (adap->props->caps & DVB_USB_ADAP_NEED_PID_FILTERING)) {
pr_info("%s: will use the device's hardware PID " \ pr_info("%s: will use the device's hardware PID " \
"filter (table count: %d)\n", "filter (table count: %d)\n",
KBUILD_MODNAME, KBUILD_MODNAME,
adap->props.pid_filter_count); adap->props->pid_filter_count);
adap->pid_filtering = 1; adap->pid_filtering = 1;
adap->max_feed_count = adap->props.pid_filter_count; adap->max_feed_count = adap->props->pid_filter_count;
} else { } else {
pr_info("%s: will pass the complete MPEG2 transport " \ pr_info("%s: will pass the complete MPEG2 transport " \
"stream to the software demuxer\n", "stream to the software demuxer\n",
...@@ -156,11 +154,11 @@ static int dvb_usbv2_adapter_init(struct dvb_usb_device *d) ...@@ -156,11 +154,11 @@ static int dvb_usbv2_adapter_init(struct dvb_usb_device *d)
} }
if (!adap->pid_filtering && dvb_usb_force_pid_filter_usage && if (!adap->pid_filtering && dvb_usb_force_pid_filter_usage &&
adap->props.caps & DVB_USB_ADAP_HAS_PID_FILTER) { adap->props->caps & DVB_USB_ADAP_HAS_PID_FILTER) {
pr_info("%s: pid filter enabled by module option\n", pr_info("%s: pid filter enabled by module option\n",
KBUILD_MODNAME); KBUILD_MODNAME);
adap->pid_filtering = 1; adap->pid_filtering = 1;
adap->max_feed_count = adap->props.pid_filter_count; adap->max_feed_count = adap->props->pid_filter_count;
} }
ret = dvb_usbv2_adapter_stream_init(adap); ret = dvb_usbv2_adapter_stream_init(adap);
...@@ -229,8 +227,8 @@ static int dvb_usbv2_init(struct dvb_usb_device *d) ...@@ -229,8 +227,8 @@ static int dvb_usbv2_init(struct dvb_usb_device *d)
/* check the capabilities and set appropriate variables */ /* check the capabilities and set appropriate variables */
dvb_usbv2_device_power_ctrl(d, 1); dvb_usbv2_device_power_ctrl(d, 1);
if (d->props.read_config) { if (d->props->read_config) {
ret = d->props.read_config(d); ret = d->props->read_config(d);
if (ret < 0) if (ret < 0)
goto err; goto err;
} }
...@@ -243,8 +241,8 @@ static int dvb_usbv2_init(struct dvb_usb_device *d) ...@@ -243,8 +241,8 @@ static int dvb_usbv2_init(struct dvb_usb_device *d)
if (ret < 0) if (ret < 0)
goto err; goto err;
if (d->props.init) { if (d->props->init) {
ret = d->props.init(d); ret = d->props->init(d);
if (ret < 0) if (ret < 0)
goto err; goto err;
} }
...@@ -274,8 +272,8 @@ int dvb_usbv2_device_power_ctrl(struct dvb_usb_device *d, int onoff) ...@@ -274,8 +272,8 @@ int dvb_usbv2_device_power_ctrl(struct dvb_usb_device *d, int onoff)
if (d->powered == 0 || (onoff && d->powered == 1)) { if (d->powered == 0 || (onoff && d->powered == 1)) {
/* when switching from 1 to 0 or from 0 to 1 */ /* when switching from 1 to 0 or from 0 to 1 */
pr_debug("%s: power control=%d\n", __func__, onoff); pr_debug("%s: power control=%d\n", __func__, onoff);
if (d->props.power_ctrl) { if (d->props->power_ctrl) {
ret = d->props.power_ctrl(d, onoff); ret = d->props->power_ctrl(d, onoff);
goto err; goto err;
} }
} }
...@@ -304,8 +302,8 @@ static void dvb_usbv2_init_work(struct work_struct *work) ...@@ -304,8 +302,8 @@ static void dvb_usbv2_init_work(struct work_struct *work)
pr_debug("%s: work_pid=%d\n", __func__, d->work_pid); pr_debug("%s: work_pid=%d\n", __func__, d->work_pid);
if (d->props.size_of_priv) { if (d->props->size_of_priv) {
d->priv = kzalloc(d->props.size_of_priv, GFP_KERNEL); d->priv = kzalloc(d->props->size_of_priv, GFP_KERNEL);
if (!d->priv) { if (!d->priv) {
pr_err("%s: kzalloc() failed\n", KBUILD_MODNAME); pr_err("%s: kzalloc() failed\n", KBUILD_MODNAME);
ret = -ENOMEM; ret = -ENOMEM;
...@@ -313,8 +311,8 @@ static void dvb_usbv2_init_work(struct work_struct *work) ...@@ -313,8 +311,8 @@ static void dvb_usbv2_init_work(struct work_struct *work)
} }
} }
if (d->props.identify_state) { if (d->props->identify_state) {
ret = d->props.identify_state(d); ret = d->props->identify_state(d);
if (ret == 0) { if (ret == 0) {
; ;
} else if (ret == COLD) { } else if (ret == COLD) {
...@@ -388,11 +386,10 @@ int dvb_usbv2_probe(struct usb_interface *intf, ...@@ -388,11 +386,10 @@ int dvb_usbv2_probe(struct usb_interface *intf,
d->rc_map = driver_info->rc_map; d->rc_map = driver_info->rc_map;
d->udev = interface_to_usbdev(intf); d->udev = interface_to_usbdev(intf);
d->intf = intf; d->intf = intf;
memcpy(&d->props, driver_info->props, d->props = driver_info->props;
sizeof(struct dvb_usb_device_properties));
if (d->intf->cur_altsetting->desc.bInterfaceNumber != if (d->intf->cur_altsetting->desc.bInterfaceNumber !=
d->props.bInterfaceNumber) { d->props->bInterfaceNumber) {
ret = -ENODEV; ret = -ENODEV;
goto err_kfree; goto err_kfree;
} }
...@@ -428,8 +425,8 @@ void dvb_usbv2_disconnect(struct usb_interface *intf) ...@@ -428,8 +425,8 @@ void dvb_usbv2_disconnect(struct usb_interface *intf)
if (d->work_pid != current->pid) if (d->work_pid != current->pid)
cancel_work_sync(&d->probe_work); cancel_work_sync(&d->probe_work);
if (d->props.disconnect) if (d->props->disconnect)
d->props.disconnect(d); d->props->disconnect(d);
name = d->name; name = d->name;
dvb_usbv2_exit(d); dvb_usbv2_exit(d);
......
...@@ -43,10 +43,10 @@ int dvb_usbv2_remote_init(struct dvb_usb_device *d) ...@@ -43,10 +43,10 @@ int dvb_usbv2_remote_init(struct dvb_usb_device *d)
int ret; int ret;
struct rc_dev *dev; struct rc_dev *dev;
if (dvb_usbv2_disable_rc_polling || !d->props.get_rc_config) if (dvb_usbv2_disable_rc_polling || !d->props->get_rc_config)
return 0; return 0;
ret = d->props.get_rc_config(d, &d->rc); ret = d->props->get_rc_config(d, &d->rc);
if (ret < 0) if (ret < 0)
goto err; goto err;
...@@ -63,7 +63,7 @@ int dvb_usbv2_remote_init(struct dvb_usb_device *d) ...@@ -63,7 +63,7 @@ int dvb_usbv2_remote_init(struct dvb_usb_device *d)
dev->input_phys = d->rc_phys; dev->input_phys = d->rc_phys;
usb_to_input_id(d->udev, &dev->input_id); usb_to_input_id(d->udev, &dev->input_id);
/* TODO: likely RC-core should took const char * */ /* TODO: likely RC-core should took const char * */
dev->driver_name = (char *) d->props.driver_name; dev->driver_name = (char *) d->props->driver_name;
dev->driver_type = d->rc.driver_type; dev->driver_type = d->rc.driver_type;
dev->allowed_protos = d->rc.allowed_protos; dev->allowed_protos = d->rc.allowed_protos;
dev->change_protocol = d->rc.change_protocol; dev->change_protocol = d->rc.change_protocol;
......
...@@ -16,7 +16,7 @@ int dvb_usbv2_generic_rw(struct dvb_usb_device *d, u8 *wbuf, u16 wlen, u8 *rbuf, ...@@ -16,7 +16,7 @@ int dvb_usbv2_generic_rw(struct dvb_usb_device *d, u8 *wbuf, u16 wlen, u8 *rbuf,
if (!d || wbuf == NULL || wlen == 0) if (!d || wbuf == NULL || wlen == 0)
return -EINVAL; return -EINVAL;
if (d->props.generic_bulk_ctrl_endpoint == 0) { if (d->props->generic_bulk_ctrl_endpoint == 0) {
pr_err("%s: endpoint for generic control not specified\n", pr_err("%s: endpoint for generic control not specified\n",
KBUILD_MODNAME); KBUILD_MODNAME);
return -EINVAL; return -EINVAL;
...@@ -30,7 +30,7 @@ int dvb_usbv2_generic_rw(struct dvb_usb_device *d, u8 *wbuf, u16 wlen, u8 *rbuf, ...@@ -30,7 +30,7 @@ int dvb_usbv2_generic_rw(struct dvb_usb_device *d, u8 *wbuf, u16 wlen, u8 *rbuf,
32, 1, wbuf, wlen, 0); 32, 1, wbuf, wlen, 0);
ret = usb_bulk_msg(d->udev, usb_sndbulkpipe(d->udev, ret = usb_bulk_msg(d->udev, usb_sndbulkpipe(d->udev,
d->props.generic_bulk_ctrl_endpoint), wbuf, wlen, d->props->generic_bulk_ctrl_endpoint), wbuf, wlen,
&actlen, 2000); &actlen, 2000);
if (ret) if (ret)
...@@ -45,9 +45,9 @@ int dvb_usbv2_generic_rw(struct dvb_usb_device *d, u8 *wbuf, u16 wlen, u8 *rbuf, ...@@ -45,9 +45,9 @@ int dvb_usbv2_generic_rw(struct dvb_usb_device *d, u8 *wbuf, u16 wlen, u8 *rbuf,
msleep(delay_ms); msleep(delay_ms);
ret = usb_bulk_msg(d->udev, usb_rcvbulkpipe(d->udev, ret = usb_bulk_msg(d->udev, usb_rcvbulkpipe(d->udev,
d->props.generic_bulk_ctrl_endpoint_response ? d->props->generic_bulk_ctrl_endpoint_response ?
d->props.generic_bulk_ctrl_endpoint_response : d->props->generic_bulk_ctrl_endpoint_response :
d->props.generic_bulk_ctrl_endpoint), d->props->generic_bulk_ctrl_endpoint),
rbuf, rlen, &actlen, 2000); rbuf, rlen, &actlen, 2000);
if (ret) if (ret)
......
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