Commit 7fb2e072 authored by Arvind Yadav's avatar Arvind Yadav Committed by Mauro Carvalho Chehab

media: usb: constify usb_device_id

usb_device_id are not supposed to change at runtime. All functions
working with usb_device_id provided by <linux/usb.h> work with
const usb_device_id. So mark the non-const structs as const.

'drivers/media/usb/b2c2/flexcop-usb.c' Fix checkpatch.pl error:
ERROR: space prohibited before open square bracket '['.
Signed-off-by: default avatarArvind Yadav <arvind.yadav.cs@gmail.com>
Reviewed-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
parent a3b215ea
...@@ -1087,7 +1087,7 @@ static int airspy_probe(struct usb_interface *intf, ...@@ -1087,7 +1087,7 @@ static int airspy_probe(struct usb_interface *intf,
} }
/* USB device ID list */ /* USB device ID list */
static struct usb_device_id airspy_id_table[] = { static const struct usb_device_id airspy_id_table[] = {
{ USB_DEVICE(0x1d50, 0x60a1) }, /* AirSpy */ { USB_DEVICE(0x1d50, 0x60a1) }, /* AirSpy */
{ } { }
}; };
......
...@@ -33,7 +33,7 @@ static void as102_usb_stop_stream(struct as102_dev_t *dev); ...@@ -33,7 +33,7 @@ static void as102_usb_stop_stream(struct as102_dev_t *dev);
static int as102_open(struct inode *inode, struct file *file); static int as102_open(struct inode *inode, struct file *file);
static int as102_release(struct inode *inode, struct file *file); static int as102_release(struct inode *inode, struct file *file);
static struct usb_device_id as102_usb_id_table[] = { static const struct usb_device_id as102_usb_id_table[] = {
{ USB_DEVICE(AS102_USB_DEVICE_VENDOR_ID, AS102_USB_DEVICE_PID_0001) }, { USB_DEVICE(AS102_USB_DEVICE_VENDOR_ID, AS102_USB_DEVICE_PID_0001) },
{ USB_DEVICE(PCTV_74E_USB_VID, PCTV_74E_USB_PID) }, { USB_DEVICE(PCTV_74E_USB_VID, PCTV_74E_USB_PID) },
{ USB_DEVICE(ELGATO_EYETV_DTT_USB_VID, ELGATO_EYETV_DTT_USB_PID) }, { USB_DEVICE(ELGATO_EYETV_DTT_USB_VID, ELGATO_EYETV_DTT_USB_PID) },
......
...@@ -596,7 +596,7 @@ static void flexcop_usb_disconnect(struct usb_interface *intf) ...@@ -596,7 +596,7 @@ static void flexcop_usb_disconnect(struct usb_interface *intf)
info("%s successfully deinitialized and disconnected.", DRIVER_NAME); info("%s successfully deinitialized and disconnected.", DRIVER_NAME);
} }
static struct usb_device_id flexcop_usb_table [] = { static const struct usb_device_id flexcop_usb_table[] = {
{ USB_DEVICE(0x0af7, 0x0101) }, { USB_DEVICE(0x0af7, 0x0101) },
{ } { }
}; };
......
...@@ -60,7 +60,7 @@ static int submit_urbs(struct camera_data *cam); ...@@ -60,7 +60,7 @@ static int submit_urbs(struct camera_data *cam);
static int set_alternate(struct camera_data *cam, unsigned int alt); static int set_alternate(struct camera_data *cam, unsigned int alt);
static int configure_transfer_mode(struct camera_data *cam, unsigned int alt); static int configure_transfer_mode(struct camera_data *cam, unsigned int alt);
static struct usb_device_id cpia2_id_table[] = { static const struct usb_device_id cpia2_id_table[] = {
{USB_DEVICE(0x0553, 0x0100)}, {USB_DEVICE(0x0553, 0x0100)},
{USB_DEVICE(0x0553, 0x0140)}, {USB_DEVICE(0x0553, 0x0140)},
{USB_DEVICE(0x0553, 0x0151)}, /* STV0676 */ {USB_DEVICE(0x0553, 0x0151)}, /* STV0676 */
......
...@@ -933,7 +933,7 @@ static struct dvb_usb_device_properties az6007_cablestar_hdci_props = { ...@@ -933,7 +933,7 @@ static struct dvb_usb_device_properties az6007_cablestar_hdci_props = {
} }
}; };
static struct usb_device_id az6007_usb_table[] = { static const struct usb_device_id az6007_usb_table[] = {
{DVB_USB_DEVICE(USB_VID_AZUREWAVE, USB_PID_AZUREWAVE_6007, {DVB_USB_DEVICE(USB_VID_AZUREWAVE, USB_PID_AZUREWAVE_6007,
&az6007_props, "Azurewave 6007", RC_MAP_EMPTY)}, &az6007_props, "Azurewave 6007", RC_MAP_EMPTY)},
{DVB_USB_DEVICE(USB_VID_TERRATEC, USB_PID_TERRATEC_H7, {DVB_USB_DEVICE(USB_VID_TERRATEC, USB_PID_TERRATEC_H7,
......
...@@ -1545,7 +1545,7 @@ static int hackrf_probe(struct usb_interface *intf, ...@@ -1545,7 +1545,7 @@ static int hackrf_probe(struct usb_interface *intf,
} }
/* USB device ID list */ /* USB device ID list */
static struct usb_device_id hackrf_id_table[] = { static const struct usb_device_id hackrf_id_table[] = {
{ USB_DEVICE(0x1d50, 0x6089) }, /* HackRF One */ { USB_DEVICE(0x1d50, 0x6089) }, /* HackRF One */
{ } { }
}; };
......
...@@ -53,7 +53,7 @@ MODULE_PARM_DESC(boost_audio, "boost the audio signal"); ...@@ -53,7 +53,7 @@ MODULE_PARM_DESC(boost_audio, "boost the audio signal");
/* table of devices that work with this driver */ /* table of devices that work with this driver */
static struct usb_device_id hdpvr_table[] = { static const struct usb_device_id hdpvr_table[] = {
{ USB_DEVICE(HD_PVR_VENDOR_ID, HD_PVR_PRODUCT_ID) }, { USB_DEVICE(HD_PVR_VENDOR_ID, HD_PVR_PRODUCT_ID) },
{ USB_DEVICE(HD_PVR_VENDOR_ID, HD_PVR_PRODUCT_ID1) }, { USB_DEVICE(HD_PVR_VENDOR_ID, HD_PVR_PRODUCT_ID1) },
{ USB_DEVICE(HD_PVR_VENDOR_ID, HD_PVR_PRODUCT_ID2) }, { USB_DEVICE(HD_PVR_VENDOR_ID, HD_PVR_PRODUCT_ID2) },
......
...@@ -1308,7 +1308,7 @@ static int msi2500_probe(struct usb_interface *intf, ...@@ -1308,7 +1308,7 @@ static int msi2500_probe(struct usb_interface *intf,
} }
/* USB device ID list */ /* USB device ID list */
static struct usb_device_id msi2500_id_table[] = { static const struct usb_device_id msi2500_id_table[] = {
{USB_DEVICE(0x1df7, 0x2500)}, /* Mirics MSi3101 SDR Dongle */ {USB_DEVICE(0x1df7, 0x2500)}, /* Mirics MSi3101 SDR Dongle */
{USB_DEVICE(0x2040, 0xd300)}, /* Hauppauge WinTV 133559 LF */ {USB_DEVICE(0x2040, 0xd300)}, /* Hauppauge WinTV 133559 LF */
{} {}
......
...@@ -381,7 +381,7 @@ MODULE_PARM_DESC(jpeg_enable, "Jpeg enable(1-on 0-off) default 1"); ...@@ -381,7 +381,7 @@ MODULE_PARM_DESC(jpeg_enable, "Jpeg enable(1-on 0-off) default 1");
/* USB device table */ /* USB device table */
#define USB_SENSORAY_VID 0x1943 #define USB_SENSORAY_VID 0x1943
static struct usb_device_id s2255_table[] = { static const struct usb_device_id s2255_table[] = {
{USB_DEVICE(USB_SENSORAY_VID, 0x2255)}, {USB_DEVICE(USB_SENSORAY_VID, 0x2255)},
{USB_DEVICE(USB_SENSORAY_VID, 0x2257)}, /*same family as 2255*/ {USB_DEVICE(USB_SENSORAY_VID, 0x2257)}, /*same family as 2255*/
{ } /* Terminating entry */ { } /* Terminating entry */
......
...@@ -47,7 +47,7 @@ MODULE_AUTHOR("Ezequiel Garcia"); ...@@ -47,7 +47,7 @@ MODULE_AUTHOR("Ezequiel Garcia");
MODULE_DESCRIPTION("STK1160 driver"); MODULE_DESCRIPTION("STK1160 driver");
/* Devices supported by this driver */ /* Devices supported by this driver */
static struct usb_device_id stk1160_id_table[] = { static const struct usb_device_id stk1160_id_table[] = {
{ USB_DEVICE(0x05e1, 0x0408) }, { USB_DEVICE(0x05e1, 0x0408) },
{ } { }
}; };
......
...@@ -55,7 +55,7 @@ MODULE_AUTHOR("Jaime Velasco Juan <jsagarribay@gmail.com> and Nicolas VIVIEN"); ...@@ -55,7 +55,7 @@ MODULE_AUTHOR("Jaime Velasco Juan <jsagarribay@gmail.com> and Nicolas VIVIEN");
MODULE_DESCRIPTION("Syntek DC1125 webcam driver"); MODULE_DESCRIPTION("Syntek DC1125 webcam driver");
/* Some cameras have audio interfaces, we aren't interested in those */ /* Some cameras have audio interfaces, we aren't interested in those */
static struct usb_device_id stkwebcam_table[] = { static const struct usb_device_id stkwebcam_table[] = {
{ USB_DEVICE_AND_INTERFACE_INFO(0x174f, 0xa311, 0xff, 0xff, 0xff) }, { USB_DEVICE_AND_INTERFACE_INFO(0x174f, 0xa311, 0xff, 0xff, 0xff) },
{ USB_DEVICE_AND_INTERFACE_INFO(0x05e1, 0x0501, 0xff, 0xff, 0xff) }, { USB_DEVICE_AND_INTERFACE_INFO(0x05e1, 0x0501, 0xff, 0xff, 0xff) },
{ } { }
......
...@@ -613,7 +613,7 @@ static struct tm6000_board tm6000_boards[] = { ...@@ -613,7 +613,7 @@ static struct tm6000_board tm6000_boards[] = {
}; };
/* table of devices that work with this driver */ /* table of devices that work with this driver */
static struct usb_device_id tm6000_id_table[] = { static const struct usb_device_id tm6000_id_table[] = {
{ USB_DEVICE(0x6000, 0x0001), .driver_info = TM5600_BOARD_GENERIC }, { USB_DEVICE(0x6000, 0x0001), .driver_info = TM5600_BOARD_GENERIC },
{ USB_DEVICE(0x6000, 0x0002), .driver_info = TM6010_BOARD_GENERIC }, { USB_DEVICE(0x6000, 0x0002), .driver_info = TM6010_BOARD_GENERIC },
{ USB_DEVICE(0x06e1, 0xf332), .driver_info = TM6000_BOARD_ADSTECH_DUAL_TV }, { USB_DEVICE(0x06e1, 0xf332), .driver_info = TM6000_BOARD_ADSTECH_DUAL_TV },
......
...@@ -1795,7 +1795,7 @@ static void ttusb_disconnect(struct usb_interface *intf) ...@@ -1795,7 +1795,7 @@ static void ttusb_disconnect(struct usb_interface *intf)
dprintk("%s: TTUSB DVB disconnected\n", __func__); dprintk("%s: TTUSB DVB disconnected\n", __func__);
} }
static struct usb_device_id ttusb_table[] = { static const struct usb_device_id ttusb_table[] = {
{USB_DEVICE(0xb48, 0x1003)}, {USB_DEVICE(0xb48, 0x1003)},
{USB_DEVICE(0xb48, 0x1004)}, {USB_DEVICE(0xb48, 0x1004)},
{USB_DEVICE(0xb48, 0x1005)}, {USB_DEVICE(0xb48, 0x1005)},
......
...@@ -1791,7 +1791,7 @@ static void ttusb_dec_set_model(struct ttusb_dec *dec, ...@@ -1791,7 +1791,7 @@ static void ttusb_dec_set_model(struct ttusb_dec *dec,
} }
} }
static struct usb_device_id ttusb_dec_table[] = { static const struct usb_device_id ttusb_dec_table[] = {
{USB_DEVICE(0x0b48, 0x1006)}, /* DEC3000-s */ {USB_DEVICE(0x0b48, 0x1006)}, /* DEC3000-s */
/*{USB_DEVICE(0x0b48, 0x1007)}, Unconfirmed */ /*{USB_DEVICE(0x0b48, 0x1007)}, Unconfirmed */
{USB_DEVICE(0x0b48, 0x1008)}, /* DEC2000-t */ {USB_DEVICE(0x0b48, 0x1008)}, /* DEC2000-t */
......
...@@ -142,7 +142,7 @@ static void usbtv_disconnect(struct usb_interface *intf) ...@@ -142,7 +142,7 @@ static void usbtv_disconnect(struct usb_interface *intf)
v4l2_device_put(&usbtv->v4l2_dev); v4l2_device_put(&usbtv->v4l2_dev);
} }
static struct usb_device_id usbtv_id_table[] = { static const struct usb_device_id usbtv_id_table[] = {
{ USB_DEVICE(0x1b71, 0x3002) }, { USB_DEVICE(0x1b71, 0x3002) },
{} {}
}; };
......
...@@ -2283,7 +2283,7 @@ MODULE_PARM_DESC(timeout, "Streaming control requests timeout"); ...@@ -2283,7 +2283,7 @@ MODULE_PARM_DESC(timeout, "Streaming control requests timeout");
* VENDOR_SPEC because they don't announce themselves as UVC devices, even * VENDOR_SPEC because they don't announce themselves as UVC devices, even
* though they are compliant. * though they are compliant.
*/ */
static struct usb_device_id uvc_ids[] = { static const struct usb_device_id uvc_ids[] = {
/* LogiLink Wireless Webcam */ /* LogiLink Wireless Webcam */
{ .match_flags = USB_DEVICE_ID_MATCH_DEVICE { .match_flags = USB_DEVICE_ID_MATCH_DEVICE
| USB_DEVICE_ID_MATCH_INT_INFO, | USB_DEVICE_ID_MATCH_INT_INFO,
......
...@@ -93,7 +93,7 @@ MODULE_PARM_DESC(mode, "0 = 320x240, 1 = 160x120, 2 = 640x480"); ...@@ -93,7 +93,7 @@ MODULE_PARM_DESC(mode, "0 = 320x240, 1 = 160x120, 2 = 640x480");
/* Devices supported by this driver /* Devices supported by this driver
* .driver_info contains the init method used by the camera */ * .driver_info contains the init method used by the camera */
static struct usb_device_id device_table[] = { static const struct usb_device_id device_table[] = {
{USB_DEVICE(0x08ca, 0x0109), .driver_info = METHOD0 }, {USB_DEVICE(0x08ca, 0x0109), .driver_info = METHOD0 },
{USB_DEVICE(0x041e, 0x4024), .driver_info = METHOD0 }, {USB_DEVICE(0x041e, 0x4024), .driver_info = METHOD0 },
{USB_DEVICE(0x0d64, 0x0108), .driver_info = METHOD0 }, {USB_DEVICE(0x0d64, 0x0108), .driver_info = METHOD0 },
......
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