[PATCH v2 25/31] [media] r820t: Don't put it in standby if not initialized yet

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



r820t_standby() can be called before r820t_init().
If that happens, just do nothing.

Signed-off-by: Mauro Carvalho Chehab <mchehab@xxxxxxxxxx>
---
 drivers/media/tuners/r820t.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/media/tuners/r820t.c b/drivers/media/tuners/r820t.c
index fc660f2..b679a3f 100644
--- a/drivers/media/tuners/r820t.c
+++ b/drivers/media/tuners/r820t.c
@@ -1298,6 +1298,10 @@ static int r820t_standby(struct r820t_priv *priv)
 {
 	int rc;
 
+	/* If device was not initialized yet, don't need to standby */
+	if (!priv->init_done)
+		return 0;
+
 	rc = r820t_write_reg(priv, 0x06, 0xb1);
 	if (rc < 0)
 		return rc;
-- 
1.8.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux