V4L/DVB (12701): saa7134: ir-kbd-i2c init data needs a persistent object
commit7aedd5ec87686c557d48584d69ad880c11a0984d
authorMauro Carvalho Chehab <mchehab@redhat.com>
Mon, 7 Sep 2009 05:22:01 +0000 (7 02:22 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Sat, 12 Sep 2009 15:20:17 +0000 (12 12:20 -0300)
tree4b700249f4c94e76fdf86c7f45bc287631d721d7
parent78f2e672b37ae8935ec0b97cedbc2d877ffa0c5f
V4L/DVB (12701): saa7134: ir-kbd-i2c init data needs a persistent object

ir-kbd-i2c's ir_probe() function can be called much later (i.e. at
ir-kbd-i2c module load), than the lifetime of a struct IR_i2c_init_data
allocated off of the stack in cx18_i2c_new_ir() at registration time.
Make sure we pass a pointer to a persistent IR_i2c_init_data object at
i2c registration time.

Thanks to Brian Rogers, Dustin Mitchell, Andy Walls and Jean Delvare to
rise this question.

Before this patch, if ir-kbd-i2c were probed after SAA7134, trash data
were used.

Compile tested only, but the patch is identical to em28xx one. So, it
should work properly.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/video/saa7134/saa7134-input.c
drivers/media/video/saa7134/saa7134.h