summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArvind Yadav <arvind.yadav.cs@gmail.com>2017-08-13 04:54:43 -0400
committerMauro Carvalho Chehab <mchehab@s-opensource.com>2017-08-20 08:04:51 -0400
commit7fb2e072d41b1da5ddf29a1ba62f0e380d94a855 (patch)
tree9d1796e292fbcde8a61bd5f1df02bfc76ccaf703
parenta3b215ea6000c108133784702e24d0b79d4d7a01 (diff)
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: Arvind Yadav <arvind.yadav.cs@gmail.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
-rw-r--r--drivers/media/usb/airspy/airspy.c2
-rw-r--r--drivers/media/usb/as102/as102_usb_drv.c2
-rw-r--r--drivers/media/usb/b2c2/flexcop-usb.c2
-rw-r--r--drivers/media/usb/cpia2/cpia2_usb.c2
-rw-r--r--drivers/media/usb/dvb-usb-v2/az6007.c2
-rw-r--r--drivers/media/usb/hackrf/hackrf.c2
-rw-r--r--drivers/media/usb/hdpvr/hdpvr-core.c2
-rw-r--r--drivers/media/usb/msi2500/msi2500.c2
-rw-r--r--drivers/media/usb/s2255/s2255drv.c2
-rw-r--r--drivers/media/usb/stk1160/stk1160-core.c2
-rw-r--r--drivers/media/usb/stkwebcam/stk-webcam.c2
-rw-r--r--drivers/media/usb/tm6000/tm6000-cards.c2
-rw-r--r--drivers/media/usb/ttusb-budget/dvb-ttusb-budget.c2
-rw-r--r--drivers/media/usb/ttusb-dec/ttusb_dec.c2
-rw-r--r--drivers/media/usb/usbtv/usbtv-core.c2
-rw-r--r--drivers/media/usb/uvc/uvc_driver.c2
-rw-r--r--drivers/media/usb/zr364xx/zr364xx.c2
17 files changed, 17 insertions, 17 deletions
diff --git a/drivers/media/usb/airspy/airspy.c b/drivers/media/usb/airspy/airspy.c
index 8251942bcd12..07f3f4e7144a 100644
--- a/drivers/media/usb/airspy/airspy.c
+++ b/drivers/media/usb/airspy/airspy.c
@@ -1087,7 +1087,7 @@ err_free_mem:
1087} 1087}
1088 1088
1089/* USB device ID list */ 1089/* USB device ID list */
1090static struct usb_device_id airspy_id_table[] = { 1090static const struct usb_device_id airspy_id_table[] = {
1091 { USB_DEVICE(0x1d50, 0x60a1) }, /* AirSpy */ 1091 { USB_DEVICE(0x1d50, 0x60a1) }, /* AirSpy */
1092 { } 1092 { }
1093}; 1093};
diff --git a/drivers/media/usb/as102/as102_usb_drv.c b/drivers/media/usb/as102/as102_usb_drv.c
index 68c3a80ce349..ea57859aee77 100644
--- a/drivers/media/usb/as102/as102_usb_drv.c
+++ b/drivers/media/usb/as102/as102_usb_drv.c
@@ -33,7 +33,7 @@ static void as102_usb_stop_stream(struct as102_dev_t *dev);
33static int as102_open(struct inode *inode, struct file *file); 33static int as102_open(struct inode *inode, struct file *file);
34static int as102_release(struct inode *inode, struct file *file); 34static int as102_release(struct inode *inode, struct file *file);
35 35
36static struct usb_device_id as102_usb_id_table[] = { 36static const struct usb_device_id as102_usb_id_table[] = {
37 { USB_DEVICE(AS102_USB_DEVICE_VENDOR_ID, AS102_USB_DEVICE_PID_0001) }, 37 { USB_DEVICE(AS102_USB_DEVICE_VENDOR_ID, AS102_USB_DEVICE_PID_0001) },
38 { USB_DEVICE(PCTV_74E_USB_VID, PCTV_74E_USB_PID) }, 38 { USB_DEVICE(PCTV_74E_USB_VID, PCTV_74E_USB_PID) },
39 { USB_DEVICE(ELGATO_EYETV_DTT_USB_VID, ELGATO_EYETV_DTT_USB_PID) }, 39 { USB_DEVICE(ELGATO_EYETV_DTT_USB_VID, ELGATO_EYETV_DTT_USB_PID) },
diff --git a/drivers/media/usb/b2c2/flexcop-usb.c b/drivers/media/usb/b2c2/flexcop-usb.c
index 788c73803138..a8f3169e30b3 100644
--- a/drivers/media/usb/b2c2/flexcop-usb.c
+++ b/drivers/media/usb/b2c2/flexcop-usb.c
@@ -596,7 +596,7 @@ static void flexcop_usb_disconnect(struct usb_interface *intf)
596 info("%s successfully deinitialized and disconnected.", DRIVER_NAME); 596 info("%s successfully deinitialized and disconnected.", DRIVER_NAME);
597} 597}
598 598
599static struct usb_device_id flexcop_usb_table [] = { 599static const struct usb_device_id flexcop_usb_table[] = {
600 { USB_DEVICE(0x0af7, 0x0101) }, 600 { USB_DEVICE(0x0af7, 0x0101) },
601 { } 601 { }
602}; 602};
diff --git a/drivers/media/usb/cpia2/cpia2_usb.c b/drivers/media/usb/cpia2/cpia2_usb.c
index 1c7e16e5d88b..6089036049d9 100644
--- a/drivers/media/usb/cpia2/cpia2_usb.c
+++ b/drivers/media/usb/cpia2/cpia2_usb.c
@@ -60,7 +60,7 @@ static int submit_urbs(struct camera_data *cam);
60static int set_alternate(struct camera_data *cam, unsigned int alt); 60static int set_alternate(struct camera_data *cam, unsigned int alt);
61static int configure_transfer_mode(struct camera_data *cam, unsigned int alt); 61static int configure_transfer_mode(struct camera_data *cam, unsigned int alt);
62 62
63static struct usb_device_id cpia2_id_table[] = { 63static const struct usb_device_id cpia2_id_table[] = {
64 {USB_DEVICE(0x0553, 0x0100)}, 64 {USB_DEVICE(0x0553, 0x0100)},
65 {USB_DEVICE(0x0553, 0x0140)}, 65 {USB_DEVICE(0x0553, 0x0140)},
66 {USB_DEVICE(0x0553, 0x0151)}, /* STV0676 */ 66 {USB_DEVICE(0x0553, 0x0151)}, /* STV0676 */
diff --git a/drivers/media/usb/dvb-usb-v2/az6007.c b/drivers/media/usb/dvb-usb-v2/az6007.c
index 50c07fe7dacb..72f26300c236 100644
--- a/drivers/media/usb/dvb-usb-v2/az6007.c
+++ b/drivers/media/usb/dvb-usb-v2/az6007.c
@@ -933,7 +933,7 @@ static struct dvb_usb_device_properties az6007_cablestar_hdci_props = {
933 } 933 }
934}; 934};
935 935
936static struct usb_device_id az6007_usb_table[] = { 936static const struct usb_device_id az6007_usb_table[] = {
937 {DVB_USB_DEVICE(USB_VID_AZUREWAVE, USB_PID_AZUREWAVE_6007, 937 {DVB_USB_DEVICE(USB_VID_AZUREWAVE, USB_PID_AZUREWAVE_6007,
938 &az6007_props, "Azurewave 6007", RC_MAP_EMPTY)}, 938 &az6007_props, "Azurewave 6007", RC_MAP_EMPTY)},
939 {DVB_USB_DEVICE(USB_VID_TERRATEC, USB_PID_TERRATEC_H7, 939 {DVB_USB_DEVICE(USB_VID_TERRATEC, USB_PID_TERRATEC_H7,
diff --git a/drivers/media/usb/hackrf/hackrf.c b/drivers/media/usb/hackrf/hackrf.c
index d9a525260511..a41b305c55d4 100644
--- a/drivers/media/usb/hackrf/hackrf.c
+++ b/drivers/media/usb/hackrf/hackrf.c
@@ -1545,7 +1545,7 @@ err:
1545} 1545}
1546 1546
1547/* USB device ID list */ 1547/* USB device ID list */
1548static struct usb_device_id hackrf_id_table[] = { 1548static const struct usb_device_id hackrf_id_table[] = {
1549 { USB_DEVICE(0x1d50, 0x6089) }, /* HackRF One */ 1549 { USB_DEVICE(0x1d50, 0x6089) }, /* HackRF One */
1550 { } 1550 { }
1551}; 1551};
diff --git a/drivers/media/usb/hdpvr/hdpvr-core.c b/drivers/media/usb/hdpvr/hdpvr-core.c
index 15f016ad5b89..dbe29c6c4d8b 100644
--- a/drivers/media/usb/hdpvr/hdpvr-core.c
+++ b/drivers/media/usb/hdpvr/hdpvr-core.c
@@ -53,7 +53,7 @@ MODULE_PARM_DESC(boost_audio, "boost the audio signal");
53 53
54 54
55/* table of devices that work with this driver */ 55/* table of devices that work with this driver */
56static struct usb_device_id hdpvr_table[] = { 56static const struct usb_device_id hdpvr_table[] = {
57 { USB_DEVICE(HD_PVR_VENDOR_ID, HD_PVR_PRODUCT_ID) }, 57 { USB_DEVICE(HD_PVR_VENDOR_ID, HD_PVR_PRODUCT_ID) },
58 { USB_DEVICE(HD_PVR_VENDOR_ID, HD_PVR_PRODUCT_ID1) }, 58 { USB_DEVICE(HD_PVR_VENDOR_ID, HD_PVR_PRODUCT_ID1) },
59 { USB_DEVICE(HD_PVR_VENDOR_ID, HD_PVR_PRODUCT_ID2) }, 59 { USB_DEVICE(HD_PVR_VENDOR_ID, HD_PVR_PRODUCT_ID2) },
diff --git a/drivers/media/usb/msi2500/msi2500.c b/drivers/media/usb/msi2500/msi2500.c
index bb3d31e2a0b5..79bfd2dbe649 100644
--- a/drivers/media/usb/msi2500/msi2500.c
+++ b/drivers/media/usb/msi2500/msi2500.c
@@ -1308,7 +1308,7 @@ err:
1308} 1308}
1309 1309
1310/* USB device ID list */ 1310/* USB device ID list */
1311static struct usb_device_id msi2500_id_table[] = { 1311static const struct usb_device_id msi2500_id_table[] = {
1312 {USB_DEVICE(0x1df7, 0x2500)}, /* Mirics MSi3101 SDR Dongle */ 1312 {USB_DEVICE(0x1df7, 0x2500)}, /* Mirics MSi3101 SDR Dongle */
1313 {USB_DEVICE(0x2040, 0xd300)}, /* Hauppauge WinTV 133559 LF */ 1313 {USB_DEVICE(0x2040, 0xd300)}, /* Hauppauge WinTV 133559 LF */
1314 {} 1314 {}
diff --git a/drivers/media/usb/s2255/s2255drv.c b/drivers/media/usb/s2255/s2255drv.c
index 6a88b1dbb3a0..23f606e7cd73 100644
--- a/drivers/media/usb/s2255/s2255drv.c
+++ b/drivers/media/usb/s2255/s2255drv.c
@@ -381,7 +381,7 @@ MODULE_PARM_DESC(jpeg_enable, "Jpeg enable(1-on 0-off) default 1");
381 381
382/* USB device table */ 382/* USB device table */
383#define USB_SENSORAY_VID 0x1943 383#define USB_SENSORAY_VID 0x1943
384static struct usb_device_id s2255_table[] = { 384static const struct usb_device_id s2255_table[] = {
385 {USB_DEVICE(USB_SENSORAY_VID, 0x2255)}, 385 {USB_DEVICE(USB_SENSORAY_VID, 0x2255)},
386 {USB_DEVICE(USB_SENSORAY_VID, 0x2257)}, /*same family as 2255*/ 386 {USB_DEVICE(USB_SENSORAY_VID, 0x2257)}, /*same family as 2255*/
387 { } /* Terminating entry */ 387 { } /* Terminating entry */
diff --git a/drivers/media/usb/stk1160/stk1160-core.c b/drivers/media/usb/stk1160/stk1160-core.c
index c86eb6164713..bea8bbbb84fb 100644
--- a/drivers/media/usb/stk1160/stk1160-core.c
+++ b/drivers/media/usb/stk1160/stk1160-core.c
@@ -47,7 +47,7 @@ MODULE_AUTHOR("Ezequiel Garcia");
47MODULE_DESCRIPTION("STK1160 driver"); 47MODULE_DESCRIPTION("STK1160 driver");
48 48
49/* Devices supported by this driver */ 49/* Devices supported by this driver */
50static struct usb_device_id stk1160_id_table[] = { 50static const struct usb_device_id stk1160_id_table[] = {
51 { USB_DEVICE(0x05e1, 0x0408) }, 51 { USB_DEVICE(0x05e1, 0x0408) },
52 { } 52 { }
53}; 53};
diff --git a/drivers/media/usb/stkwebcam/stk-webcam.c b/drivers/media/usb/stkwebcam/stk-webcam.c
index 93330be8cc54..39abb58c65dd 100644
--- a/drivers/media/usb/stkwebcam/stk-webcam.c
+++ b/drivers/media/usb/stkwebcam/stk-webcam.c
@@ -55,7 +55,7 @@ MODULE_AUTHOR("Jaime Velasco Juan <jsagarribay@gmail.com> and Nicolas VIVIEN");
55MODULE_DESCRIPTION("Syntek DC1125 webcam driver"); 55MODULE_DESCRIPTION("Syntek DC1125 webcam driver");
56 56
57/* Some cameras have audio interfaces, we aren't interested in those */ 57/* Some cameras have audio interfaces, we aren't interested in those */
58static struct usb_device_id stkwebcam_table[] = { 58static const struct usb_device_id stkwebcam_table[] = {
59 { USB_DEVICE_AND_INTERFACE_INFO(0x174f, 0xa311, 0xff, 0xff, 0xff) }, 59 { USB_DEVICE_AND_INTERFACE_INFO(0x174f, 0xa311, 0xff, 0xff, 0xff) },
60 { USB_DEVICE_AND_INTERFACE_INFO(0x05e1, 0x0501, 0xff, 0xff, 0xff) }, 60 { USB_DEVICE_AND_INTERFACE_INFO(0x05e1, 0x0501, 0xff, 0xff, 0xff) },
61 { } 61 { }
diff --git a/drivers/media/usb/tm6000/tm6000-cards.c b/drivers/media/usb/tm6000/tm6000-cards.c
index b293dea6554f..2537643a1808 100644
--- a/drivers/media/usb/tm6000/tm6000-cards.c
+++ b/drivers/media/usb/tm6000/tm6000-cards.c
@@ -613,7 +613,7 @@ static struct tm6000_board tm6000_boards[] = {
613}; 613};
614 614
615/* table of devices that work with this driver */ 615/* table of devices that work with this driver */
616static struct usb_device_id tm6000_id_table[] = { 616static const struct usb_device_id tm6000_id_table[] = {
617 { USB_DEVICE(0x6000, 0x0001), .driver_info = TM5600_BOARD_GENERIC }, 617 { USB_DEVICE(0x6000, 0x0001), .driver_info = TM5600_BOARD_GENERIC },
618 { USB_DEVICE(0x6000, 0x0002), .driver_info = TM6010_BOARD_GENERIC }, 618 { USB_DEVICE(0x6000, 0x0002), .driver_info = TM6010_BOARD_GENERIC },
619 { USB_DEVICE(0x06e1, 0xf332), .driver_info = TM6000_BOARD_ADSTECH_DUAL_TV }, 619 { USB_DEVICE(0x06e1, 0xf332), .driver_info = TM6000_BOARD_ADSTECH_DUAL_TV },
diff --git a/drivers/media/usb/ttusb-budget/dvb-ttusb-budget.c b/drivers/media/usb/ttusb-budget/dvb-ttusb-budget.c
index 22a488d3749d..b842f367249f 100644
--- a/drivers/media/usb/ttusb-budget/dvb-ttusb-budget.c
+++ b/drivers/media/usb/ttusb-budget/dvb-ttusb-budget.c
@@ -1795,7 +1795,7 @@ static void ttusb_disconnect(struct usb_interface *intf)
1795 dprintk("%s: TTUSB DVB disconnected\n", __func__); 1795 dprintk("%s: TTUSB DVB disconnected\n", __func__);
1796} 1796}
1797 1797
1798static struct usb_device_id ttusb_table[] = { 1798static const struct usb_device_id ttusb_table[] = {
1799 {USB_DEVICE(0xb48, 0x1003)}, 1799 {USB_DEVICE(0xb48, 0x1003)},
1800 {USB_DEVICE(0xb48, 0x1004)}, 1800 {USB_DEVICE(0xb48, 0x1004)},
1801 {USB_DEVICE(0xb48, 0x1005)}, 1801 {USB_DEVICE(0xb48, 0x1005)},
diff --git a/drivers/media/usb/ttusb-dec/ttusb_dec.c b/drivers/media/usb/ttusb-dec/ttusb_dec.c
index 01c7e6d4481c..cdefb5dfbbdc 100644
--- a/drivers/media/usb/ttusb-dec/ttusb_dec.c
+++ b/drivers/media/usb/ttusb-dec/ttusb_dec.c
@@ -1791,7 +1791,7 @@ static void ttusb_dec_set_model(struct ttusb_dec *dec,
1791 } 1791 }
1792} 1792}
1793 1793
1794static struct usb_device_id ttusb_dec_table[] = { 1794static const struct usb_device_id ttusb_dec_table[] = {
1795 {USB_DEVICE(0x0b48, 0x1006)}, /* DEC3000-s */ 1795 {USB_DEVICE(0x0b48, 0x1006)}, /* DEC3000-s */
1796 /*{USB_DEVICE(0x0b48, 0x1007)}, Unconfirmed */ 1796 /*{USB_DEVICE(0x0b48, 0x1007)}, Unconfirmed */
1797 {USB_DEVICE(0x0b48, 0x1008)}, /* DEC2000-t */ 1797 {USB_DEVICE(0x0b48, 0x1008)}, /* DEC2000-t */
diff --git a/drivers/media/usb/usbtv/usbtv-core.c b/drivers/media/usb/usbtv/usbtv-core.c
index ceb953be0770..f06f09a0876e 100644
--- a/drivers/media/usb/usbtv/usbtv-core.c
+++ b/drivers/media/usb/usbtv/usbtv-core.c
@@ -142,7 +142,7 @@ static void usbtv_disconnect(struct usb_interface *intf)
142 v4l2_device_put(&usbtv->v4l2_dev); 142 v4l2_device_put(&usbtv->v4l2_dev);
143} 143}
144 144
145static struct usb_device_id usbtv_id_table[] = { 145static const struct usb_device_id usbtv_id_table[] = {
146 { USB_DEVICE(0x1b71, 0x3002) }, 146 { USB_DEVICE(0x1b71, 0x3002) },
147 {} 147 {}
148}; 148};
diff --git a/drivers/media/usb/uvc/uvc_driver.c b/drivers/media/usb/uvc/uvc_driver.c
index 4f463bf2b877..c6feda8e55d3 100644
--- a/drivers/media/usb/uvc/uvc_driver.c
+++ b/drivers/media/usb/uvc/uvc_driver.c
@@ -2283,7 +2283,7 @@ MODULE_PARM_DESC(timeout, "Streaming control requests timeout");
2283 * VENDOR_SPEC because they don't announce themselves as UVC devices, even 2283 * VENDOR_SPEC because they don't announce themselves as UVC devices, even
2284 * though they are compliant. 2284 * though they are compliant.
2285 */ 2285 */
2286static struct usb_device_id uvc_ids[] = { 2286static const struct usb_device_id uvc_ids[] = {
2287 /* LogiLink Wireless Webcam */ 2287 /* LogiLink Wireless Webcam */
2288 { .match_flags = USB_DEVICE_ID_MATCH_DEVICE 2288 { .match_flags = USB_DEVICE_ID_MATCH_DEVICE
2289 | USB_DEVICE_ID_MATCH_INT_INFO, 2289 | USB_DEVICE_ID_MATCH_INT_INFO,
diff --git a/drivers/media/usb/zr364xx/zr364xx.c b/drivers/media/usb/zr364xx/zr364xx.c
index efdcd5bd6a4c..25fa81c631c6 100644
--- a/drivers/media/usb/zr364xx/zr364xx.c
+++ b/drivers/media/usb/zr364xx/zr364xx.c
@@ -93,7 +93,7 @@ MODULE_PARM_DESC(mode, "0 = 320x240, 1 = 160x120, 2 = 640x480");
93 93
94/* Devices supported by this driver 94/* Devices supported by this driver
95 * .driver_info contains the init method used by the camera */ 95 * .driver_info contains the init method used by the camera */
96static struct usb_device_id device_table[] = { 96static const struct usb_device_id device_table[] = {
97 {USB_DEVICE(0x08ca, 0x0109), .driver_info = METHOD0 }, 97 {USB_DEVICE(0x08ca, 0x0109), .driver_info = METHOD0 },
98 {USB_DEVICE(0x041e, 0x4024), .driver_info = METHOD0 }, 98 {USB_DEVICE(0x041e, 0x4024), .driver_info = METHOD0 },
99 {USB_DEVICE(0x0d64, 0x0108), .driver_info = METHOD0 }, 99 {USB_DEVICE(0x0d64, 0x0108), .driver_info = METHOD0 },