Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/i2c if no carrier, other status fields are invalid



details:   https://anonhg.NetBSD.org/src/rev/7f837a764e7e
branches:  trunk
changeset: 767305:7f837a764e7e
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Fri Jul 15 03:29:23 2011 +0000

description:
if no carrier, other status fields are invalid

diffstat:

 sys/dev/i2c/lg3303.c |  9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diffs (32 lines):

diff -r 9c6802b95f59 -r 7f837a764e7e sys/dev/i2c/lg3303.c
--- a/sys/dev/i2c/lg3303.c      Fri Jul 15 00:21:26 2011 +0000
+++ b/sys/dev/i2c/lg3303.c      Fri Jul 15 03:29:23 2011 +0000
@@ -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;



Home | Main Index | Thread Index | Old Index