V4L/DVB (11843): ir-kbd-i2c: Don't use i2c_client.name for our own needs
authorJean Delvare <khali@linux-fr.org>
Wed, 13 May 2009 19:48:07 +0000 (16:48 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Tue, 16 Jun 2009 21:21:11 +0000 (18:21 -0300)
In the standard device driver binding model, the name field of
struct i2c_client is used to match devices to their drivers, so we
must stop using it for internal purposes. Define a separate field
in struct IR_i2c as a replacement, and use it.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/video/cx231xx/cx231xx-input.c
drivers/media/video/em28xx/em28xx-cards.c
drivers/media/video/em28xx/em28xx-input.c
drivers/media/video/ir-kbd-i2c.c
drivers/media/video/saa7134/saa7134-input.c
include/media/ir-kbd-i2c.h

index 97e304c3c799ba81106d5836e6c5c1c234348244..48f22fa38e6cc7a527256227442ab331b4466319 100644 (file)
@@ -36,7 +36,7 @@ MODULE_PARM_DESC(ir_debug, "enable debug messages [IR]");
 
 #define i2cdprintk(fmt, arg...) \
        if (ir_debug) { \
-               printk(KERN_DEBUG "%s/ir: " fmt, ir->c.name , ## arg); \
+               printk(KERN_DEBUG "%s/ir: " fmt, ir->name , ## arg); \
        }
 
 #define dprintk(fmt, arg...) \
index 3958f168fc57a62a29bf45aa9916b7e39adf7383..b2aed29e2d745e062971c66b53031ba9feb2b4c7 100644 (file)
@@ -1384,13 +1384,13 @@ struct em28xx_board em28xx_boards[] = {
                        .type     = EM28XX_VMUX_COMPOSITE1,
                        .vmux     = TVP5150_COMPOSITE1,
                        .amux     = EM28XX_AUDIO_SRC_LINE,
-                        .gpio     = terratec_av350_unmute_gpio,
+                       .gpio     = terratec_av350_unmute_gpio,
 
                }, {
                        .type     = EM28XX_VMUX_SVIDEO,
                        .vmux     = TVP5150_SVIDEO,
                        .amux     = EM28XX_AUDIO_SRC_LINE,
-                        .gpio     = terratec_av350_unmute_gpio,
+                       .gpio     = terratec_av350_unmute_gpio,
                } },
        },
 };
@@ -1929,19 +1929,19 @@ void em28xx_set_ir(struct em28xx *dev, struct IR_i2c *ir)
        case (EM2820_BOARD_TERRATEC_CINERGY_250):
                ir->ir_codes = ir_codes_em_terratec;
                ir->get_key = em28xx_get_key_terratec;
-               snprintf(ir->c.name, sizeof(ir->c.name),
+               snprintf(ir->name, sizeof(ir->name),
                         "i2c IR (EM28XX Terratec)");
                break;
        case (EM2820_BOARD_PINNACLE_USB_2):
                ir->ir_codes = ir_codes_pinnacle_grey;
                ir->get_key = em28xx_get_key_pinnacle_usb_grey;
-               snprintf(ir->c.name, sizeof(ir->c.name),
+               snprintf(ir->name, sizeof(ir->name),
                         "i2c IR (EM28XX Pinnacle PCTV)");
                break;
        case (EM2820_BOARD_HAUPPAUGE_WINTV_USB_2):
                ir->ir_codes = ir_codes_hauppauge_new;
                ir->get_key = em28xx_get_key_em_haup;
-               snprintf(ir->c.name, sizeof(ir->c.name),
+               snprintf(ir->name, sizeof(ir->name),
                         "i2c IR (EM2840 Hauppauge)");
                break;
        case (EM2820_BOARD_MSI_VOX_USB_2):
index a5abfd7a19f577d4e00bd4bbaf42f647641b9385..7450ba7dee83bbbb9708ee6e0e23df953ff20d48 100644 (file)
@@ -40,7 +40,7 @@ MODULE_PARM_DESC(ir_debug, "enable debug messages [IR]");
 
 #define i2cdprintk(fmt, arg...) \
        if (ir_debug) { \
-               printk(KERN_DEBUG "%s/ir: " fmt, ir->c.name , ## arg); \
+               printk(KERN_DEBUG "%s/ir: " fmt, ir->name , ## arg); \
        }
 
 #define dprintk(fmt, arg...) \
index 092c7da0f37a7a534351536cd2f57ee15b01a4ab..ba341e6fb2dae5153cf5fb96e79b74c2a8d035f8 100644 (file)
@@ -337,6 +337,7 @@ static int ir_attach(struct i2c_adapter *adap, int addr,
 
        ir->c.adapter = adap;
        ir->c.addr    = addr;
+       snprintf(ir->c.name, sizeof(ir->c.name), "ir-kbd");
 
        i2c_set_clientdata(&ir->c, ir);
 
@@ -410,7 +411,7 @@ static int ir_attach(struct i2c_adapter *adap, int addr,
        }
 
        /* Sets name */
-       snprintf(ir->c.name, sizeof(ir->c.name), "i2c IR (%s)", name);
+       snprintf(ir->name, sizeof(ir->name), "i2c IR (%s)", name);
        ir->ir_codes = ir_codes;
 
        /* register i2c device
@@ -435,7 +436,7 @@ static int ir_attach(struct i2c_adapter *adap, int addr,
        /* init + register input device */
        ir_input_init(input_dev, &ir->ir, ir_type, ir->ir_codes);
        input_dev->id.bustype = BUS_I2C;
-       input_dev->name       = ir->c.name;
+       input_dev->name       = ir->name;
        input_dev->phys       = ir->phys;
 
        err = input_register_device(ir->input);
index 4506375172655e029a28c9e964a9b5be7dad9ed6..6cd693d3b8ed5dd9dcab0afeee007f7b8b2a5697 100644 (file)
@@ -60,7 +60,7 @@ MODULE_PARM_DESC(disable_other_ir, "disable full codes of "
 #define dprintk(fmt, arg...)   if (ir_debug) \
        printk(KERN_DEBUG "%s/ir: " fmt, dev->name , ## arg)
 #define i2cdprintk(fmt, arg...)    if (ir_debug) \
-       printk(KERN_DEBUG "%s/ir: " fmt, ir->c.name , ## arg)
+       printk(KERN_DEBUG "%s/ir: " fmt, ir->name , ## arg)
 
 /* Helper functions for RC5 and NEC decoding at GPIO16 or GPIO18 */
 static int saa7134_rc5_irq(struct saa7134_dev *dev);
@@ -693,7 +693,7 @@ void saa7134_set_i2c_ir(struct saa7134_dev *dev, struct IR_i2c *ir)
        switch (dev->board) {
        case SAA7134_BOARD_PINNACLE_PCTV_110i:
        case SAA7134_BOARD_PINNACLE_PCTV_310i:
-               snprintf(ir->c.name, sizeof(ir->c.name), "Pinnacle PCTV");
+               snprintf(ir->name, sizeof(ir->name), "Pinnacle PCTV");
                if (pinnacle_remote == 0) {
                        ir->get_key   = get_key_pinnacle_color;
                        ir->ir_codes = ir_codes_pinnacle_color;
@@ -703,17 +703,17 @@ void saa7134_set_i2c_ir(struct saa7134_dev *dev, struct IR_i2c *ir)
                }
                break;
        case SAA7134_BOARD_UPMOST_PURPLE_TV:
-               snprintf(ir->c.name, sizeof(ir->c.name), "Purple TV");
+               snprintf(ir->name, sizeof(ir->name), "Purple TV");
                ir->get_key   = get_key_purpletv;
                ir->ir_codes  = ir_codes_purpletv;
                break;
        case SAA7134_BOARD_MSI_TVATANYWHERE_PLUS:
-               snprintf(ir->c.name, sizeof(ir->c.name), "MSI TV@nywhere Plus");
+               snprintf(ir->name, sizeof(ir->name), "MSI TV@nywhere Plus");
                ir->get_key  = get_key_msi_tvanywhere_plus;
                ir->ir_codes = ir_codes_msi_tvanywhere_plus;
                break;
        case SAA7134_BOARD_HAUPPAUGE_HVR1110:
-               snprintf(ir->c.name, sizeof(ir->c.name), "HVR 1110");
+               snprintf(ir->name, sizeof(ir->name), "HVR 1110");
                ir->get_key   = get_key_hvr1110;
                ir->ir_codes  = ir_codes_hauppauge_new;
                break;
@@ -729,7 +729,7 @@ void saa7134_set_i2c_ir(struct saa7134_dev *dev, struct IR_i2c *ir)
        case SAA7134_BOARD_BEHOLD_M63:
        case SAA7134_BOARD_BEHOLD_M6_EXTRA:
        case SAA7134_BOARD_BEHOLD_H6:
-               snprintf(ir->c.name, sizeof(ir->c.name), "BeholdTV");
+               snprintf(ir->name, sizeof(ir->name), "BeholdTV");
                ir->get_key   = get_key_beholdm6xx;
                ir->ir_codes  = ir_codes_behold;
                break;
index 07963d7054008be6490f79ee91a4f9740900e5d6..6a9719c8e903fbc333539ad4d1b9bf57e168439c 100644 (file)
@@ -15,6 +15,7 @@ struct IR_i2c {
        unsigned char          old;
 
        struct delayed_work    work;
+       char                   name[32];
        char                   phys[32];
        int                    (*get_key)(struct IR_i2c*, u32*, u32*);
 };