[media] b2c2: Reset no_base_addr on skystarS2 attach failure
authorJemma Denson <jdenson@gmail.com>
Fri, 15 May 2015 18:40:29 +0000 (15:40 -0300)
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>
Mon, 18 May 2015 20:48:13 +0000 (17:48 -0300)
If set, all the other drivers reset no_base_addr on failure to
attach - git commit for this being added to some of them seems to
be eccd15aad72f774b2059f708bc422dbb8493bb30

This driver has been floating around outside the mainline for so
long it hasn't had this fix, so add it in.

Whilst here tidy surrounding code to fix style issues.

Signed-off-by: Jemma Denson <jdenson@gmail.com>
Signed-off-by: Patrick Boettcher <patrick.boettcher@posteo.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
drivers/media/common/b2c2/flexcop-fe-tuner.c

index 9305266d0ac073495edfa585660b274de25bad9d..2426062fcb3cfd576aaee60d1f4179f6715eefcd 100644 (file)
@@ -637,15 +637,16 @@ static int skystarS2_rev33_attach(struct flexcop_device *fc,
        struct i2c_adapter *i2c)
 {
        fc->fe = dvb_attach(cx24120_attach,
-               &skystar2_rev3_3_cx24120_config, i2c);
-       if (fc->fe == NULL)
+                           &skystar2_rev3_3_cx24120_config, i2c);
+       if (!fc->fe)
                return 0;
 
        fc->dev_type = FC_SKYS2_REV33;
        fc->fc_i2c_adap[2].no_base_addr = 1;
-       if ((dvb_attach(isl6421_attach, fc->fe,
-               &fc->fc_i2c_adap[2].i2c_adap, 0x08, 0, 0, false) == NULL)) {
+       if (!dvb_attach(isl6421_attach, fc->fe, &fc->fc_i2c_adap[2].i2c_adap,
+                       0x08, 0, 0, false)) {
                err("ISL6421 could NOT be attached!");
+               fc->fc_i2c_adap[2].no_base_addr = 0;
                return 0;
        }
        info("ISL6421 successfully attached.");