Commit d27958df authored by Sean Young's avatar Sean Young Committed by Mauro Carvalho Chehab

media: dvb-usb: make dvb_usb_device_properties const

This makes it possible to declare dvb_usb_device_properties const.
Signed-off-by: default avatarSean Young <sean@mess.org>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
parent 96f3a939
...@@ -27,8 +27,10 @@ static int a800_power_ctrl(struct dvb_usb_device *d, int onoff) ...@@ -27,8 +27,10 @@ static int a800_power_ctrl(struct dvb_usb_device *d, int onoff)
} }
/* assure to put cold to 0 for iManufacturer == 1 */ /* assure to put cold to 0 for iManufacturer == 1 */
static int a800_identify_state(struct usb_device *udev, struct dvb_usb_device_properties *props, static int a800_identify_state(struct usb_device *udev,
struct dvb_usb_device_description **desc, int *cold) const struct dvb_usb_device_properties *props,
const struct dvb_usb_device_description **desc,
int *cold)
{ {
*cold = udev->descriptor.iManufacturer != 1; *cold = udev->descriptor.iManufacturer != 1;
return 0; return 0;
......
...@@ -955,8 +955,8 @@ static int af9005_pid_filter(struct dvb_usb_adapter *adap, int index, ...@@ -955,8 +955,8 @@ static int af9005_pid_filter(struct dvb_usb_adapter *adap, int index,
} }
static int af9005_identify_state(struct usb_device *udev, static int af9005_identify_state(struct usb_device *udev,
struct dvb_usb_device_properties *props, const struct dvb_usb_device_properties *props,
struct dvb_usb_device_description **desc, const struct dvb_usb_device_description **desc,
int *cold) int *cold)
{ {
int ret; int ret;
......
...@@ -1051,8 +1051,8 @@ static struct i2c_algorithm az6027_i2c_algo = { ...@@ -1051,8 +1051,8 @@ static struct i2c_algorithm az6027_i2c_algo = {
}; };
static int az6027_identify_state(struct usb_device *udev, static int az6027_identify_state(struct usb_device *udev,
struct dvb_usb_device_properties *props, const struct dvb_usb_device_properties *props,
struct dvb_usb_device_description **desc, const struct dvb_usb_device_description **desc,
int *cold) int *cold)
{ {
u8 *b; u8 *b;
......
...@@ -1358,8 +1358,8 @@ static int cxusb_mygica_d689_frontend_attach(struct dvb_usb_adapter *adap) ...@@ -1358,8 +1358,8 @@ static int cxusb_mygica_d689_frontend_attach(struct dvb_usb_adapter *adap)
* not, and forget a match if it turns out we selected the wrong device. * not, and forget a match if it turns out we selected the wrong device.
*/ */
static int bluebird_fx2_identify_state(struct usb_device *udev, static int bluebird_fx2_identify_state(struct usb_device *udev,
struct dvb_usb_device_properties *props, const struct dvb_usb_device_properties *props,
struct dvb_usb_device_description **desc, const struct dvb_usb_device_description **desc,
int *cold) int *cold)
{ {
int wascold = *cold; int wascold = *cold;
......
...@@ -52,20 +52,25 @@ struct dib0700_state { ...@@ -52,20 +52,25 @@ struct dib0700_state {
struct i2c_client *i2c_client_tuner; struct i2c_client *i2c_client_tuner;
}; };
extern int dib0700_get_version(struct dvb_usb_device *d, u32 *hwversion, int dib0700_get_version(struct dvb_usb_device *d, u32 *hwversion,
u32 *romversion, u32 *ramversion, u32 *fwtype); u32 *romversion, u32 *ramversion, u32 *fwtype);
extern int dib0700_set_gpio(struct dvb_usb_device *, enum dib07x0_gpios gpio, u8 gpio_dir, u8 gpio_val); int dib0700_set_gpio(struct dvb_usb_device *d, enum dib07x0_gpios gpio,
extern int dib0700_ctrl_clock(struct dvb_usb_device *d, u32 clk_MHz, u8 clock_out_gp3); u8 gpio_dir, u8 gpio_val);
extern int dib0700_ctrl_rd(struct dvb_usb_device *d, u8 *tx, u8 txlen, u8 *rx, u8 rxlen); int dib0700_ctrl_clock(struct dvb_usb_device *d, u32 clk_MHz, u8 clock_out_gp3);
extern int dib0700_download_firmware(struct usb_device *udev, const struct firmware *fw); int dib0700_ctrl_rd(struct dvb_usb_device *d, u8 *tx, u8 txlen, u8 *rx,
extern int dib0700_rc_setup(struct dvb_usb_device *d, struct usb_interface *intf); u8 rxlen);
extern int dib0700_streaming_ctrl(struct dvb_usb_adapter *adap, int onoff); int dib0700_download_firmware(struct usb_device *d,
extern struct i2c_algorithm dib0700_i2c_algo; const struct firmware *fw);
extern int dib0700_identify_state(struct usb_device *udev, struct dvb_usb_device_properties *props, int dib0700_rc_setup(struct dvb_usb_device *d, struct usb_interface *intf);
struct dvb_usb_device_description **desc, int *cold); int dib0700_streaming_ctrl(struct dvb_usb_adapter *adap, int onoff);
extern int dib0700_change_protocol(struct rc_dev *dev, u64 *rc_proto); int dib0700_identify_state(struct usb_device *d,
extern int dib0700_set_i2c_speed(struct dvb_usb_device *d, u16 scl_kHz); const struct dvb_usb_device_properties *props,
const struct dvb_usb_device_description **desc,
int *cold);
int dib0700_change_protocol(struct rc_dev *dev, u64 *rc_proto);
int dib0700_set_i2c_speed(struct dvb_usb_device *d, u16 scl_kHz);
extern struct i2c_algorithm dib0700_i2c_algo;
extern int dib0700_device_count; extern int dib0700_device_count;
extern int dvb_usb_dib0700_ir_proto; extern int dvb_usb_dib0700_ir_proto;
extern struct dvb_usb_device_properties dib0700_devices[]; extern struct dvb_usb_device_properties dib0700_devices[];
......
...@@ -372,8 +372,10 @@ struct i2c_algorithm dib0700_i2c_algo = { ...@@ -372,8 +372,10 @@ struct i2c_algorithm dib0700_i2c_algo = {
.functionality = dib0700_i2c_func, .functionality = dib0700_i2c_func,
}; };
int dib0700_identify_state(struct usb_device *udev, struct dvb_usb_device_properties *props, int dib0700_identify_state(struct usb_device *udev,
struct dvb_usb_device_description **desc, int *cold) const struct dvb_usb_device_properties *props,
const struct dvb_usb_device_description **desc,
int *cold)
{ {
s16 ret; s16 ret;
u8 *b; u8 *b;
......
...@@ -90,9 +90,10 @@ static struct i2c_algorithm digitv_i2c_algo = { ...@@ -90,9 +90,10 @@ static struct i2c_algorithm digitv_i2c_algo = {
}; };
/* Callbacks for DVB USB */ /* Callbacks for DVB USB */
static int digitv_identify_state (struct usb_device *udev, struct static int digitv_identify_state(struct usb_device *udev,
dvb_usb_device_properties *props, struct dvb_usb_device_description **desc, const struct dvb_usb_device_properties *props,
int *cold) const struct dvb_usb_device_description **desc,
int *cold)
{ {
*cold = udev->descriptor.iManufacturer == 0 && udev->descriptor.iProduct == 0; *cold = udev->descriptor.iManufacturer == 0 && udev->descriptor.iProduct == 0;
return 0; return 0;
......
...@@ -26,7 +26,8 @@ extern int dvb_usb_disable_rc_polling; ...@@ -26,7 +26,8 @@ extern int dvb_usb_disable_rc_polling;
#define deb_uxfer(args...) dprintk(dvb_usb_debug,0x100,args) #define deb_uxfer(args...) dprintk(dvb_usb_debug,0x100,args)
/* commonly used methods */ /* commonly used methods */
extern int dvb_usb_download_firmware(struct usb_device *, struct dvb_usb_device_properties *); int dvb_usb_download_firmware(struct usb_device *udev,
const struct dvb_usb_device_properties *props);
extern int dvb_usb_device_power_ctrl(struct dvb_usb_device *d, int onoff); extern int dvb_usb_device_power_ctrl(struct dvb_usb_device *d, int onoff);
......
...@@ -84,7 +84,8 @@ int usb_cypress_load_firmware(struct usb_device *udev, const struct firmware *fw ...@@ -84,7 +84,8 @@ int usb_cypress_load_firmware(struct usb_device *udev, const struct firmware *fw
} }
EXPORT_SYMBOL(usb_cypress_load_firmware); EXPORT_SYMBOL(usb_cypress_load_firmware);
int dvb_usb_download_firmware(struct usb_device *udev, struct dvb_usb_device_properties *props) int dvb_usb_download_firmware(struct usb_device *udev,
const struct dvb_usb_device_properties *props)
{ {
int ret; int ret;
const struct firmware *fw = NULL; const struct firmware *fw = NULL;
......
...@@ -184,10 +184,10 @@ static int dvb_usb_init(struct dvb_usb_device *d, short *adapter_nums) ...@@ -184,10 +184,10 @@ static int dvb_usb_init(struct dvb_usb_device *d, short *adapter_nums)
} }
/* determine the name and the state of the just found USB device */ /* determine the name and the state of the just found USB device */
static struct dvb_usb_device_description *dvb_usb_find_device(struct usb_device *udev, struct dvb_usb_device_properties *props, int *cold) static const struct dvb_usb_device_description *dvb_usb_find_device(struct usb_device *udev, const struct dvb_usb_device_properties *props, int *cold)
{ {
int i, j; int i, j;
struct dvb_usb_device_description *desc = NULL; const struct dvb_usb_device_description *desc = NULL;
*cold = -1; *cold = -1;
...@@ -242,13 +242,13 @@ int dvb_usb_device_power_ctrl(struct dvb_usb_device *d, int onoff) ...@@ -242,13 +242,13 @@ int dvb_usb_device_power_ctrl(struct dvb_usb_device *d, int onoff)
* USB * USB
*/ */
int dvb_usb_device_init(struct usb_interface *intf, int dvb_usb_device_init(struct usb_interface *intf,
struct dvb_usb_device_properties *props, const struct dvb_usb_device_properties *props,
struct module *owner, struct dvb_usb_device **du, struct module *owner, struct dvb_usb_device **du,
short *adapter_nums) short *adapter_nums)
{ {
struct usb_device *udev = interface_to_usbdev(intf); struct usb_device *udev = interface_to_usbdev(intf);
struct dvb_usb_device *d = NULL; struct dvb_usb_device *d = NULL;
struct dvb_usb_device_description *desc = NULL; const struct dvb_usb_device_description *desc = NULL;
int ret = -ENOMEM, cold = 0; int ret = -ENOMEM, cold = 0;
......
...@@ -291,8 +291,10 @@ struct dvb_usb_device_properties { ...@@ -291,8 +291,10 @@ struct dvb_usb_device_properties {
int (*power_ctrl) (struct dvb_usb_device *, int); int (*power_ctrl) (struct dvb_usb_device *, int);
int (*read_mac_address) (struct dvb_usb_device *, u8 []); int (*read_mac_address) (struct dvb_usb_device *, u8 []);
int (*identify_state) (struct usb_device *, struct dvb_usb_device_properties *, int (*identify_state)(struct usb_device *udev,
struct dvb_usb_device_description **, int *); const struct dvb_usb_device_properties *props,
const struct dvb_usb_device_description **desc,
int *cold);
struct { struct {
enum dvb_usb_mode mode; /* Drivers shouldn't touch on it */ enum dvb_usb_mode mode; /* Drivers shouldn't touch on it */
...@@ -436,7 +438,7 @@ struct dvb_usb_adapter { ...@@ -436,7 +438,7 @@ struct dvb_usb_adapter {
*/ */
struct dvb_usb_device { struct dvb_usb_device {
struct dvb_usb_device_properties props; struct dvb_usb_device_properties props;
struct dvb_usb_device_description *desc; const struct dvb_usb_device_description *desc;
struct usb_device *udev; struct usb_device *udev;
...@@ -473,7 +475,7 @@ struct dvb_usb_device { ...@@ -473,7 +475,7 @@ struct dvb_usb_device {
}; };
extern int dvb_usb_device_init(struct usb_interface *, extern int dvb_usb_device_init(struct usb_interface *,
struct dvb_usb_device_properties *, const struct dvb_usb_device_properties *,
struct module *, struct dvb_usb_device **, struct module *, struct dvb_usb_device **,
short *adapter_nums); short *adapter_nums);
extern void dvb_usb_device_exit(struct usb_interface *); extern void dvb_usb_device_exit(struct usb_interface *);
......
...@@ -955,8 +955,8 @@ static int su3000_read_mac_address(struct dvb_usb_device *d, u8 mac[6]) ...@@ -955,8 +955,8 @@ static int su3000_read_mac_address(struct dvb_usb_device *d, u8 mac[6])
} }
static int su3000_identify_state(struct usb_device *udev, static int su3000_identify_state(struct usb_device *udev,
struct dvb_usb_device_properties *props, const struct dvb_usb_device_properties *props,
struct dvb_usb_device_description **desc, const struct dvb_usb_device_description **desc,
int *cold) int *cold)
{ {
info("%s", __func__); info("%s", __func__);
......
...@@ -459,8 +459,8 @@ static int m920x_firmware_download(struct usb_device *udev, const struct firmwar ...@@ -459,8 +459,8 @@ static int m920x_firmware_download(struct usb_device *udev, const struct firmwar
/* Callbacks for DVB USB */ /* Callbacks for DVB USB */
static int m920x_identify_state(struct usb_device *udev, static int m920x_identify_state(struct usb_device *udev,
struct dvb_usb_device_properties *props, const struct dvb_usb_device_properties *props,
struct dvb_usb_device_description **desc, const struct dvb_usb_device_description **desc,
int *cold) int *cold)
{ {
struct usb_host_interface *alt; struct usb_host_interface *alt;
......
...@@ -330,8 +330,8 @@ static void technisat_usb2_green_led_control(struct work_struct *work) ...@@ -330,8 +330,8 @@ static void technisat_usb2_green_led_control(struct work_struct *work)
/* method to find out whether the firmware has to be downloaded or not */ /* method to find out whether the firmware has to be downloaded or not */
static int technisat_usb2_identify_state(struct usb_device *udev, static int technisat_usb2_identify_state(struct usb_device *udev,
struct dvb_usb_device_properties *props, const struct dvb_usb_device_properties *props,
struct dvb_usb_device_description **desc, int *cold) const struct dvb_usb_device_description **desc, int *cold)
{ {
int ret; int ret;
u8 *version; u8 *version;
......
...@@ -467,9 +467,10 @@ static int tt3650_rc_query(struct dvb_usb_device *d) ...@@ -467,9 +467,10 @@ static int tt3650_rc_query(struct dvb_usb_device *d)
/* Callbacks for DVB USB */ /* Callbacks for DVB USB */
static int ttusb2_identify_state (struct usb_device *udev, struct static int ttusb2_identify_state(struct usb_device *udev,
dvb_usb_device_properties *props, struct dvb_usb_device_description **desc, const struct dvb_usb_device_properties *props,
int *cold) const struct dvb_usb_device_description **desc,
int *cold)
{ {
*cold = udev->descriptor.iManufacturer == 0 && udev->descriptor.iProduct == 0; *cold = udev->descriptor.iManufacturer == 0 && udev->descriptor.iProduct == 0;
return 0; return 0;
......
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