[media] tuner-xc2028: More firmware loading retries
authorAlina Friedrichsen <x-alina@gmx.net>
Sun, 23 Jan 2011 15:27:05 +0000 (12:27 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Mon, 21 Mar 2011 23:31:58 +0000 (20:31 -0300)
My Hauppauge WinTV HVR-1400 needs sometimes more then only one retry to load the firmware successfully.

Signed-off-by: Alina Friedrichsen <x-alina@gmx.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/common/tuners/tuner-xc2028.c

index b6ce528e1889f69bba7c514edb93092a3dec8478..d95f3b256e30f8f1024e2e9ae8333a9769d76afc 100644 (file)
@@ -685,7 +685,7 @@ static int check_firmware(struct dvb_frontend *fe, unsigned int type,
 {
        struct xc2028_data         *priv = fe->tuner_priv;
        struct firmware_properties new_fw;
-       int                        rc = 0, is_retry = 0;
+       int                        rc = 0, retry_count = 0;
        u16                        version, hwmodel;
        v4l2_std_id                std0;
 
@@ -855,9 +855,9 @@ read_not_reliable:
 
 fail:
        memset(&priv->cur_fw, 0, sizeof(priv->cur_fw));
-       if (!is_retry) {
+       if (retry_count < 8) {
                msleep(50);
-               is_retry = 1;
+               retry_count++;
                tuner_dbg("Retrying firmware load\n");
                goto retry;
        }