summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2007-02-15 07:40:34 +0100
committerHans Verkuil <hverkuil@xs4all.nl>2007-02-15 07:40:34 +0100
commit576a4462214a9b98c55dd518697ebd0c07f6ea37 (patch)
tree312c67f9000ea4847877d6cfd251250eacaf6f91 /linux/drivers/media/video
parentfe13e147a7c65a93afe394f14e57b3315fc0697c (diff)
downloadmediapointer-dvb-s2-576a4462214a9b98c55dd518697ebd0c07f6ea37.tar.gz
mediapointer-dvb-s2-576a4462214a9b98c55dd518697ebd0c07f6ea37.tar.bz2
Fix cx25840 firmware loading.
From: Hans Verkuil <hverkuil@xs4all.nl> 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 <hverkuil@xs4all.nl> Acked-by: Mike Isely <isely@pobox.com>
Diffstat (limited to 'linux/drivers/media/video')
-rw-r--r--linux/drivers/media/video/cx25840/cx25840-core.c4
-rw-r--r--linux/drivers/media/video/cx25840/cx25840-firmware.c2
2 files changed, 3 insertions, 3 deletions
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