The patch number 13233 was added via Mauro Carvalho Chehab <mche...@redhat.com>
to http://linuxtv.org/hg/v4l-dvb master development tree.

Kernel patches in this development tree may be modified to be backward
compatible with older kernels. Compatibility modifications will be
removed before inclusion into the mainstream Kernel

If anyone has any objections, please let us know by sending a message to:
        Linux Media Mailing List <linux-me...@vger.kernel.org>

------

From: Jean Delvare  <kh...@linux-fr.org>
i2c_board_info can be local


Recent fixes to the em28xx and saa7134 drivers have been overzealous.
While the ir-kbd-i2c platform data indeed needs to be persistent, the
struct i2c_board_info doesn't, as it is only used by i2c_new_device().

So revert a part of the original fixes, to save some memory.

Signed-off-by: Jean Delvare <kh...@linux-fr.org>
Acked-by: Jarod Wilson <ja...@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mche...@redhat.com>


---

 linux/drivers/media/video/em28xx/em28xx-cards.c   |    9 +++---
 linux/drivers/media/video/em28xx/em28xx.h         |    1 
 linux/drivers/media/video/saa7134/saa7134-input.c |   21 +++++++-------
 linux/drivers/media/video/saa7134/saa7134.h       |    1 
 4 files changed, 16 insertions(+), 16 deletions(-)

diff -r fa7323f7801e -r 53166469153e 
linux/drivers/media/video/em28xx/em28xx-cards.c
--- a/linux/drivers/media/video/em28xx/em28xx-cards.c   Fri Sep 25 21:16:21 
2009 +0000
+++ b/linux/drivers/media/video/em28xx/em28xx-cards.c   Fri Oct 02 08:47:08 
2009 +0000
@@ -2309,6 +2309,7 @@
                return;
        }
 #else
+       struct i2c_board_info info;
        const unsigned short addr_list[] = {
                 0x30, 0x47, I2C_CLIENT_END
        };
@@ -2316,9 +2317,9 @@
        if (disable_ir)
                return;
 
-       memset(&dev->info, 0, sizeof(&dev->info));
+       memset(&info, 0, sizeof(struct i2c_board_info));
        memset(&dev->init_data, 0, sizeof(dev->init_data));
-       strlcpy(dev->info.type, "ir_video", I2C_NAME_SIZE);
+       strlcpy(info.type, "ir_video", I2C_NAME_SIZE);
 #endif
 
        /* detect & configure */
@@ -2364,8 +2365,8 @@
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 30)
 
        if (dev->init_data.name)
-               dev->info.platform_data = &dev->init_data;
-       i2c_new_probed_device(&dev->i2c_adap, &dev->info, addr_list);
+               info.platform_data = &dev->init_data;
+       i2c_new_probed_device(&dev->i2c_adap, &info, addr_list);
 #endif
 }
 
diff -r fa7323f7801e -r 53166469153e linux/drivers/media/video/em28xx/em28xx.h
--- a/linux/drivers/media/video/em28xx/em28xx.h Fri Sep 25 21:16:21 2009 +0000
+++ b/linux/drivers/media/video/em28xx/em28xx.h Fri Oct 02 08:47:08 2009 +0000
@@ -625,7 +625,6 @@
 
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 30)
        /* I2C keyboard data */
-       struct i2c_board_info info;
        struct IR_i2c_init_data init_data;
 #endif
 };
diff -r fa7323f7801e -r 53166469153e 
linux/drivers/media/video/saa7134/saa7134-input.c
--- a/linux/drivers/media/video/saa7134/saa7134-input.c Fri Sep 25 21:16:21 
2009 +0000
+++ b/linux/drivers/media/video/saa7134/saa7134-input.c Fri Oct 02 08:47:08 
2009 +0000
@@ -745,6 +745,7 @@
 #endif
 {
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 30)
+       struct i2c_board_info info;
        const unsigned short addr_list[] = {
                0x7a, 0x47, 0x71, 0x2d,
                I2C_CLIENT_END
@@ -771,9 +772,9 @@
        }
 
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 30)
-       memset(&dev->info, 0, sizeof(dev->info));
+       memset(&info, 0, sizeof(struct i2c_board_info));
        memset(&dev->init_data, 0, sizeof(dev->init_data));
-       strlcpy(dev->info.type, "ir_video", I2C_NAME_SIZE);
+       strlcpy(info.type, "ir_video", I2C_NAME_SIZE);
 
 #endif
        switch (dev->board) {
@@ -791,7 +792,7 @@
 #else
                        dev->init_data.get_key = get_key_pinnacle_color;
                        dev->init_data.ir_codes = 
&ir_codes_pinnacle_color_table;
-                       dev->info.addr = 0x47;
+                       info.addr = 0x47;
 #endif
                } else {
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 30)
@@ -800,7 +801,7 @@
 #else
                        dev->init_data.get_key = get_key_pinnacle_grey;
                        dev->init_data.ir_codes = &ir_codes_pinnacle_grey_table;
-                       dev->info.addr = 0x47;
+                       info.addr = 0x47;
 #endif
                }
                break;
@@ -824,7 +825,7 @@
                dev->init_data.name = "MSI t...@nywhere Plus";
                dev->init_data.get_key = get_key_msi_tvanywhere_plus;
                dev->init_data.ir_codes = &ir_codes_msi_tvanywhere_plus_table;
-               dev->info.addr = 0x30;
+               info.addr = 0x30;
                /* MSI t...@nywhere Plus controller doesn't seem to
                   respond to probes unless we read something from
                   an existing device. Weird...
@@ -875,22 +876,22 @@
 #else
        case SAA7134_BOARD_AVERMEDIA_CARDBUS_501:
        case SAA7134_BOARD_AVERMEDIA_CARDBUS_506:
-               dev->info.addr = 0x40;
+               info.addr = 0x40;
 #endif
                break;
        }
 
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 30)
        if (dev->init_data.name)
-               dev->info.platform_data = &dev->init_data;
+               info.platform_data = &dev->init_data;
        /* No need to probe if address is known */
-       if (dev->info.addr) {
-               i2c_new_device(&dev->i2c_adap, &dev->info);
+       if (info.addr) {
+               i2c_new_device(&dev->i2c_adap, &info);
                return;
        }
 
        /* Address not known, fallback to probing */
-       i2c_new_probed_device(&dev->i2c_adap, &dev->info, addr_list);
+       i2c_new_probed_device(&dev->i2c_adap, &info, addr_list);
 #endif
 }
 
diff -r fa7323f7801e -r 53166469153e linux/drivers/media/video/saa7134/saa7134.h
--- a/linux/drivers/media/video/saa7134/saa7134.h       Fri Sep 25 21:16:21 
2009 +0000
+++ b/linux/drivers/media/video/saa7134/saa7134.h       Fri Oct 02 08:47:08 
2009 +0000
@@ -599,7 +599,6 @@
 
        /* I2C keyboard data */
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 30)
-       struct i2c_board_info      info;
        struct IR_i2c_init_data    init_data;
 #endif
 


---

Patch is available at: 
http://linuxtv.org/hg/v4l-dvb/rev/53166469153e62964943a8c23491f00dff541d5a

_______________________________________________
linuxtv-commits mailing list
linuxtv-commits@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits

Reply via email to