From 55b1f7040484f6bebaa3407bb0b27e87bbc33e70 Mon Sep 17 00:00:00 2001 From: Antti Palosaari Date: Wed, 23 May 2012 16:23:44 -0300 Subject: [PATCH] [media] dvb_usb_v2: remove adapter_nums parameter from dvb_usbv2_device_init() Pass that parameter via configuration structure. Signed-off-by: Antti Palosaari Signed-off-by: Mauro Carvalho Chehab --- drivers/media/dvb/dvb-usb/dvb_usb.h | 4 ++-- drivers/media/dvb/dvb-usb/dvb_usb_common.h | 3 +-- drivers/media/dvb/dvb-usb/dvb_usb_dvb.c | 5 ++--- drivers/media/dvb/dvb-usb/dvb_usb_init.c | 14 ++++++-------- 4 files changed, 11 insertions(+), 15 deletions(-) diff --git a/drivers/media/dvb/dvb-usb/dvb_usb.h b/drivers/media/dvb/dvb-usb/dvb_usb.h index db9a7dd..101191e 100644 --- a/drivers/media/dvb/dvb-usb/dvb_usb.h +++ b/drivers/media/dvb/dvb-usb/dvb_usb.h @@ -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 */ diff --git a/drivers/media/dvb/dvb-usb/dvb_usb_common.h b/drivers/media/dvb/dvb-usb/dvb_usb_common.h index 29df539..24341bd 100644 --- a/drivers/media/dvb/dvb-usb/dvb_usb_common.h +++ b/drivers/media/dvb/dvb-usb/dvb_usb_common.h @@ -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); diff --git a/drivers/media/dvb/dvb-usb/dvb_usb_dvb.c b/drivers/media/dvb/dvb-usb/dvb_usb_dvb.c index 0795c243..41e3194b 100644 --- a/drivers/media/dvb/dvb-usb/dvb_usb_dvb.c +++ b/drivers/media/dvb/dvb-usb/dvb_usb_dvb.c @@ -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; diff --git a/drivers/media/dvb/dvb-usb/dvb_usb_init.c b/drivers/media/dvb/dvb-usb/dvb_usb_init.c index 7334ce6..662c2584 100644 --- a/drivers/media/dvb/dvb-usb/dvb_usb_init.c +++ b/drivers/media/dvb/dvb-usb/dvb_usb_init.c @@ -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); -- 2.7.4