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

[media] dvb_usb_v2: remove adapter_nums parameter from dvb_usbv2_device_init()

Pass that parameter via configuration structure.
Signed-off-by: default avatarAntti Palosaari <crope@iki.fi>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 654e62dc
......@@ -265,6 +265,7 @@ enum dvb_usb_mode {
#define MAX_NO_OF_ADAPTER_PER_DEVICE 2
struct dvb_usb_device_properties {
struct module *owner;
short *adapter_nr;
#define DVB_USB_IS_AN_I2C_ADAPTER 0x01
int caps;
......@@ -460,8 +461,7 @@ struct dvb_usb_device {
};
extern int dvb_usbv2_device_init(struct usb_interface *,
const struct usb_device_id *,
short *adapter_nums);
const struct usb_device_id *);
extern void dvb_usbv2_device_exit(struct usb_interface *);
/* the generic read/write method for device control */
......
......@@ -40,8 +40,7 @@ extern int dvb_usb_adapter_stream_exit(struct dvb_usb_adapter *adap);
extern int dvb_usb_i2c_init(struct dvb_usb_device *);
extern int dvb_usb_i2c_exit(struct dvb_usb_device *);
extern int dvb_usb_adapter_dvb_init(struct dvb_usb_adapter *adap,
short *adapter_nums);
extern int dvb_usb_adapter_dvb_init(struct dvb_usb_adapter *adap);
extern int dvb_usb_adapter_dvb_exit(struct dvb_usb_adapter *adap);
extern int dvb_usb_adapter_frontend_init(struct dvb_usb_adapter *adap);
extern int dvb_usb_adapter_frontend_exit(struct dvb_usb_adapter *adap);
......
......@@ -94,14 +94,13 @@ static int dvb_usb_stop_feed(struct dvb_demux_feed *dvbdmxfeed)
return dvb_usb_ctrl_feed(dvbdmxfeed,0);
}
int dvb_usb_adapter_dvb_init(struct dvb_usb_adapter *adap, short *adapter_nums)
int dvb_usb_adapter_dvb_init(struct dvb_usb_adapter *adap)
{
int i;
int ret = dvb_register_adapter(&adap->dvb_adap, adap->dev->desc->name,
adap->dev->props.owner,
&adap->dev->udev->dev,
adapter_nums);
adap->dev->props.adapter_nr);
if (ret < 0) {
deb_info("dvb_register_adapter failed: error %d", ret);
goto err;
......
......@@ -26,7 +26,7 @@ static int dvb_usb_force_pid_filter_usage;
module_param_named(force_pid_filter_usage, dvb_usb_force_pid_filter_usage, int, 0444);
MODULE_PARM_DESC(force_pid_filter_usage, "force all dvb-usb-devices to use a PID filter, if any (default: 0).");
static int dvb_usb_adapter_init(struct dvb_usb_device *d, short *adapter_nrs)
static int dvb_usb_adapter_init(struct dvb_usb_device *d)
{
struct dvb_usb_adapter *adap;
int ret, n, o;
......@@ -83,7 +83,7 @@ static int dvb_usb_adapter_init(struct dvb_usb_device *d, short *adapter_nrs)
}
if ((ret = dvb_usb_adapter_stream_init(adap)) ||
(ret = dvb_usb_adapter_dvb_init(adap, adapter_nrs)) ||
(ret = dvb_usb_adapter_dvb_init(adap)) ||
(ret = dvb_usb_adapter_frontend_init(adap))) {
return ret;
}
......@@ -138,7 +138,7 @@ static int dvb_usb_exit(struct dvb_usb_device *d)
return 0;
}
static int dvb_usb_init(struct dvb_usb_device *d, short *adapter_nums)
static int dvb_usb_init(struct dvb_usb_device *d)
{
int ret = 0;
......@@ -158,8 +158,7 @@ static int dvb_usb_init(struct dvb_usb_device *d, short *adapter_nums)
/* check the capabilities and set appropriate variables */
dvb_usb_device_power_ctrl(d, 1);
if ((ret = dvb_usb_i2c_init(d)) ||
(ret = dvb_usb_adapter_init(d, adapter_nums))) {
if ((ret = dvb_usb_i2c_init(d)) || (ret = dvb_usb_adapter_init(d))) {
dvb_usb_exit(d);
return ret;
}
......@@ -234,8 +233,7 @@ int dvb_usb_device_power_ctrl(struct dvb_usb_device *d, int onoff)
* USB
*/
int dvb_usbv2_device_init(struct usb_interface *intf,
const struct usb_device_id *id,
short *adapter_nums)
const struct usb_device_id *id)
{
struct usb_device *udev = interface_to_usbdev(intf);
struct dvb_usb_device *d = NULL;
......@@ -270,7 +268,7 @@ int dvb_usbv2_device_init(struct usb_interface *intf,
usb_set_intfdata(intf, d);
ret = dvb_usb_init(d, adapter_nums);
ret = dvb_usb_init(d);
if (ret == 0)
info("%s successfully initialized and connected.", desc->name);
......
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