]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
media: stv090x: Only print tuner lock if get_status is available
authorMauro Carvalho Chehab <mchehab@s-opensource.com>
Wed, 1 Nov 2017 21:06:01 +0000 (17:06 -0400)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Mon, 11 Dec 2017 18:04:52 +0000 (13:04 -0500)
The current code doesn't report tuner lock properly if the
tuner get_status callback is not available, as reported by
smatch:
drivers/media/dvb-frontends/stv090x.c:2220 stv090x_get_coldlock() error: uninitialized symbol 'reg'.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
drivers/media/dvb-frontends/stv090x.c

index 7ef469c0c8668ac5cf76a1268e0aac387c19d04c..0f375df13fbeb73bd0ba8b899efbecdc9601bbc5 100644 (file)
@@ -2215,13 +2215,12 @@ static int stv090x_get_coldlock(struct stv090x_state *state, s32 timeout_dmd)
                if (state->config->tuner_get_status) {
                        if (state->config->tuner_get_status(fe, &reg) < 0)
                                goto err_gateoff;
+                       if (reg)
+                               dprintk(FE_DEBUG, 1, "Tuner phase locked");
+                       else
+                               dprintk(FE_DEBUG, 1, "Tuner unlocked");
                }
 
-               if (reg)
-                       dprintk(FE_DEBUG, 1, "Tuner phase locked");
-               else
-                       dprintk(FE_DEBUG, 1, "Tuner unlocked");
-
                if (stv090x_i2c_gate_ctrl(state, 0) < 0)
                        goto err;