Module Name:    src
Committed By:   jmcneill
Date:           Fri Jul 15 03:29:24 UTC 2011

Modified Files:
        src/sys/dev/i2c: lg3303.c

Log Message:
if no carrier, other status fields are invalid


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/dev/i2c/lg3303.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/i2c/lg3303.c
diff -u src/sys/dev/i2c/lg3303.c:1.2 src/sys/dev/i2c/lg3303.c:1.3
--- src/sys/dev/i2c/lg3303.c:1.2	Thu Jul 14 23:46:52 2011
+++ src/sys/dev/i2c/lg3303.c	Fri Jul 15 03:29:23 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: lg3303.c,v 1.2 2011/07/14 23:46:52 jmcneill Exp $ */
+/* $NetBSD: lg3303.c,v 1.3 2011/07/15 03:29:23 jmcneill Exp $ */
 
 /*-
  * Copyright 2007 Jason Harmening
@@ -28,7 +28,7 @@
  */
 
 #include <sys/param.h>
-__KERNEL_RCSID(0, "$NetBSD: lg3303.c,v 1.2 2011/07/14 23:46:52 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: lg3303.c,v 1.3 2011/07/15 03:29:23 jmcneill Exp $");
 
 #include <sys/types.h>
 #include <sys/kmem.h>
@@ -275,9 +275,12 @@
 		device_printf(lg->parent,
 		    "lg3303: unsupported modulation type (%d)\n",
 		    lg->current_modulation);
-		return EINVAL;
+		return 0;
 	}
 
+	if ((festatus & FE_HAS_CARRIER) == 0)
+		return festatus;
+
 	error = lg3303_read(lg, reg, &value, sizeof(value));
 	if (!error && (value & 0x01))
 		festatus |= FE_HAS_LOCK;

Reply via email to