From 576a4462214a9b98c55dd518697ebd0c07f6ea37 Mon Sep 17 00:00:00 2001 From: Hans Verkuil Date: Thu, 15 Feb 2007 07:40:34 +0100 Subject: Fix cx25840 firmware loading. From: Hans Verkuil Due to changes in the i2c handling in 2.6.20 this cx25840 bug surfaced, causing the firmware load to fail for the ivtv driver. The correct sequence is to first attach the i2c client, then use the client's device to load the firmware. Signed-off-by: Hans Verkuil Acked-by: Mike Isely --- linux/drivers/media/video/cx25840/cx25840-core.c | 4 ++-- linux/drivers/media/video/cx25840/cx25840-firmware.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'linux/drivers/media') diff --git a/linux/drivers/media/video/cx25840/cx25840-core.c b/linux/drivers/media/video/cx25840/cx25840-core.c index a1a4907af..fc1e7da7c 100644 --- a/linux/drivers/media/video/cx25840/cx25840-core.c +++ b/linux/drivers/media/video/cx25840/cx25840-core.c @@ -924,13 +924,13 @@ static int cx25840_detect_client(struct i2c_adapter *adapter, int address, state->vbi_line_offset = 8; state->id = id; + i2c_attach_client(client); + if (state->is_cx25836) cx25836_initialize(client); else cx25840_initialize(client, 1); - i2c_attach_client(client); - #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) MOD_INC_USE_COUNT; #endif diff --git a/linux/drivers/media/video/cx25840/cx25840-firmware.c b/linux/drivers/media/video/cx25840/cx25840-firmware.c index e14e0bc1f..1b730b155 100644 --- a/linux/drivers/media/video/cx25840/cx25840-firmware.c +++ b/linux/drivers/media/video/cx25840/cx25840-firmware.c @@ -39,7 +39,7 @@ #define FWSEND 48 #if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) -#define FWDEV(x) &((x)->adapter->dev) +#define FWDEV(x) &((x)->dev) #else #define FWDEV(x) (x)->name #endif -- cgit v1.2.3