V4L/DVB (7393): tda827x: fixed support of tuners with LNA

Tuner refactoring broke support of tuners with LNA configurations 1 and 2
for both, analog TV and DVB-T.
Additionally, this patch initializes the saa713x gpios defined by the gpiomask
at driver init to avoid undefined stated at dvb.

Signed-off-by: Hartmut Hackmann <hartmut.hackmann@t-online.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
diff --git a/drivers/media/video/saa7134/saa7134-cards.c b/drivers/media/video/saa7134/saa7134-cards.c
index 1b6c7d6..bab8498 100644
--- a/drivers/media/video/saa7134/saa7134-cards.c
+++ b/drivers/media/video/saa7134/saa7134-cards.c
@@ -5260,12 +5260,13 @@
 {
 	struct i2c_algo_bit_data *i2c_algo = priv;
 	struct saa7134_dev *dev = i2c_algo->data;
-
-	switch (dev->tuner_type) {
-	case TUNER_PHILIPS_TDA8290:
-		return saa7134_tda8290_callback(dev, command, arg);
-	case TUNER_XC2028:
-		return saa7134_xc2028_callback(dev, command, arg);
+	if (dev != NULL) {
+		switch (dev->tuner_type) {
+		case TUNER_PHILIPS_TDA8290:
+			return saa7134_tda8290_callback(dev, command, arg);
+		case TUNER_XC2028:
+			return saa7134_xc2028_callback(dev, command, arg);
+		}
 	}
 	return -EINVAL;
 }