]> err.no Git - linux-2.6/commitdiff
V4L/DVB (5255): Fix cx25840 firmware loading.
authorHans Verkuil <hverkuil@xs4all.nl>
Thu, 15 Feb 2007 06:40:34 +0000 (03:40 -0300)
committerMauro Carvalho Chehab <mchehab@infradead.org>
Thu, 1 Mar 2007 15:09:44 +0000 (13:09 -0200)
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.
Acked-by: Mike Isely <isely@pobox.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
drivers/media/video/cx25840/cx25840-core.c
drivers/media/video/cx25840/cx25840-firmware.c

index cc535ca713d20cadf2082f79778c67f6b0c82e01..3ff5fc00c09d269bac20851030a86b6f1b353d9e 100644 (file)
@@ -903,13 +903,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);
-
        return 0;
 }
 
index 1958d4016ea15c4bb5b9e7faa59377fe80d9a4f6..0e86b9d033ac8b6cb2bb302152d4e6ac3f0203ea 100644 (file)
@@ -37,7 +37,7 @@
  */
 #define FWSEND 48
 
-#define FWDEV(x) &((x)->adapter->dev)
+#define FWDEV(x) &((x)->dev)
 
 static char *firmware = FWFILE;