OSDN Git Service

[media] media: rc: constify usb_device_id
authorArvind Yadav <arvind.yadav.cs@gmail.com>
Sun, 13 Aug 2017 08:54:44 +0000 (05:54 -0300)
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>
Wed, 4 Oct 2017 18:06:09 +0000 (15:06 -0300)
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.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
drivers/media/rc/ati_remote.c
drivers/media/rc/igorplugusb.c
drivers/media/rc/imon.c
drivers/media/rc/mceusb.c
drivers/media/rc/redrat3.c
drivers/media/rc/streamzap.c

index d0871d6..8e82610 100644 (file)
@@ -198,7 +198,7 @@ static const struct ati_receiver_type type_firefly  = {
        .default_keymap = RC_MAP_SNAPSTREAM_FIREFLY
 };
 
-static struct usb_device_id ati_remote_table[] = {
+static const struct usb_device_id ati_remote_table[] = {
        {
                USB_DEVICE(ATI_REMOTE_VENDOR_ID, LOLA_REMOTE_PRODUCT_ID),
                .driver_info = (unsigned long)&type_ati
index a5ea86b..4b715eb 100644 (file)
@@ -245,7 +245,7 @@ static void igorplugusb_disconnect(struct usb_interface *intf)
        usb_free_urb(ir->urb);
 }
 
-static struct usb_device_id igorplugusb_table[] = {
+static const struct usb_device_id igorplugusb_table[] = {
        /* Igor Plug USB (Atmel's Manufact. ID) */
        { USB_DEVICE(0x03eb, 0x0002) },
        /* Fit PC2 Infrared Adapter */
index 7b3f31c..b93dc6e 100644 (file)
@@ -346,7 +346,7 @@ static const struct imon_usb_dev_descr imon_ir_raw = {
  * devices use the SoundGraph vendor ID (0x15c2). This driver only supports
  * the ffdc and later devices, which do onboard decoding.
  */
-static struct usb_device_id imon_usb_id_table[] = {
+static const struct usb_device_id imon_usb_id_table[] = {
        /*
         * Several devices with this same device ID, all use iMON_PAD.inf
         * SoundGraph iMON PAD (IR & VFD)
index bf7aaff..67c1ff0 100644 (file)
@@ -249,7 +249,7 @@ static const struct mceusb_model mceusb_model[] = {
        },
 };
 
-static struct usb_device_id mceusb_dev_table[] = {
+static const struct usb_device_id mceusb_dev_table[] = {
        /* Original Microsoft MCE IR Transceiver (often HP-branded) */
        { USB_DEVICE(VENDOR_MICROSOFT, 0x006d),
          .driver_info = MCE_GEN1 },
index 6784cb9..6bfc248 100644 (file)
@@ -186,7 +186,7 @@ struct redrat3_error {
 } __packed;
 
 /* table of devices that work with this driver */
-static struct usb_device_id redrat3_dev_table[] = {
+static const struct usb_device_id redrat3_dev_table[] = {
        /* Original version of the RedRat3 */
        {USB_DEVICE(USB_RR3USB_VENDOR_ID, USB_RR3USB_PRODUCT_ID)},
        /* Second Version/release of the RedRat3 - RetRat3-II */
index f03a174..4eebfcf 100644 (file)
@@ -43,7 +43,7 @@
 #define USB_STREAMZAP_PRODUCT_ID       0x0000
 
 /* table of devices that work with this driver */
-static struct usb_device_id streamzap_table[] = {
+static const struct usb_device_id streamzap_table[] = {
        /* Streamzap Remote Control */
        { USB_DEVICE(USB_STREAMZAP_VENDOR_ID, USB_STREAMZAP_PRODUCT_ID) },
        /* Terminating entry */