saa7134: ir-kbd-i2c init data needs a persistent object
commitf2594aa22a219c7c1226b655292ffd5f81a35549
authorBrian Rogers <brian@xyzw.org>
Wed, 23 Sep 2009 10:05:03 +0000 (23 03:05 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 5 Oct 2009 16:33:05 +0000 (5 09:33 -0700)
tree79f8f60c9b4c174938097f6d642b761aef3d9c23
parent45af991d4e6a44e663c1314545e53bfae91bde68
saa7134: ir-kbd-i2c init data needs a persistent object

commit 7aedd5ec87686c557d48584d69ad880c11a0984d upstream.

Tested on MSI TV@nywhere Plus.

Original commit message:

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.

Original-patch-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
[brian@xyzw.org: backported for 2.6.31]
Signed-off-by: Brian Rogers <brian@xyzw.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/media/video/saa7134/saa7134-input.c
drivers/media/video/saa7134/saa7134.h