Correct some error returns for gettod() and settod() left over from the

pre-todr code, and use actual E* return codes for any error return.
This commit is contained in:
mhitch 2006-09-07 20:59:47 +00:00
parent 9f65f017a3
commit 7b2d0951ce
3 changed files with 13 additions and 13 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: a2kbbc.c,v 1.18 2006/09/05 05:32:30 mhitch Exp $ */
/* $NetBSD: a2kbbc.c,v 1.19 2006/09/07 20:59:47 mhitch Exp $ */
/*
* Copyright (c) 1982, 1990 The Regents of the University of California.
@ -78,7 +78,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: a2kbbc.c,v 1.18 2006/09/05 05:32:30 mhitch Exp $");
__KERNEL_RCSID(0, "$NetBSD: a2kbbc.c,v 1.19 2006/09/07 20:59:47 mhitch Exp $");
#include <sys/param.h>
#include <sys/kernel.h>
@ -165,7 +165,7 @@ a2kugettod(todr_chip_handle_t h, volatile struct timeval *tvp)
while (rt->control1 & A2CONTROL1_BUSY && i--)
;
if (rt->control1 & A2CONTROL1_BUSY)
return (0); /* Give up and say it's not there */
return (ENXIO); /* Give up and say it's not there */
/* Copy the info. Careful about the order! */
dt.dt_sec = rt->second1 * 10 + rt->second2;
@ -214,7 +214,7 @@ a2kugettod(todr_chip_handle_t h, volatile struct timeval *tvp)
(dt.dt_day > 31) ||
(dt.dt_mon > 12) ||
/* (dt.dt_year < STARTOFTIME) || */ (dt.dt_year > 2036))
return (0);
return (EINVAL);
secs = clock_ymdhms_to_secs(&dt);
if (tvp) {
@ -239,7 +239,7 @@ a2kusettod(todr_chip_handle_t h, volatile struct timeval *tvp)
* currently used..
*/
if (! rt)
return (1);
return (ENXIO);
clock_secs_to_ymdhms(secs, &dt);
@ -251,7 +251,7 @@ a2kusettod(todr_chip_handle_t h, volatile struct timeval *tvp)
while (rt->control1 & A2CONTROL1_BUSY && i--)
;
if (rt->control1 & A2CONTROL1_BUSY)
return (0); /* Give up and say it's not there */
return (ENXIO); /* Give up and say it's not there */
ampm = 0;
if ((rt->control3 & A2CONTROL3_24HMODE) == 0) {

View File

@ -1,4 +1,4 @@
/* $NetBSD: a34kbbc.c,v 1.17 2006/09/05 05:32:30 mhitch Exp $ */
/* $NetBSD: a34kbbc.c,v 1.18 2006/09/07 20:59:47 mhitch Exp $ */
/*
* Copyright (c) 1982, 1990 The Regents of the University of California.
@ -78,7 +78,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: a34kbbc.c,v 1.17 2006/09/05 05:32:30 mhitch Exp $");
__KERNEL_RCSID(0, "$NetBSD: a34kbbc.c,v 1.18 2006/09/07 20:59:47 mhitch Exp $");
#include <sys/param.h>
#include <sys/kernel.h>
@ -177,7 +177,7 @@ a34kugettod(todr_chip_handle_t h, volatile struct timeval *tvp)
(dt.dt_day > 31) ||
(dt.dt_mon > 12) ||
/* (dt.dt_year < STARTOFTIME) || */ (dt.dt_year > 2036))
return (0);
return (EINVAL);
secs = clock_ymdhms_to_secs(&dt);
if (tvp)
@ -200,7 +200,7 @@ a34kusettod(todr_chip_handle_t h, volatile struct timeval *tvp)
*/
if (! rt)
return (1);
return (ENXIO);
clock_secs_to_ymdhms(secs, &dt);

View File

@ -1,4 +1,4 @@
/* $NetBSD: drbbc.c,v 1.15 2006/09/05 05:32:30 mhitch Exp $ */
/* $NetBSD: drbbc.c,v 1.16 2006/09/07 20:59:47 mhitch Exp $ */
/*-
* Copyright (c) 1997 The NetBSD Foundation, Inc.
@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: drbbc.c,v 1.15 2006/09/05 05:32:30 mhitch Exp $");
__KERNEL_RCSID(0, "$NetBSD: drbbc.c,v 1.16 2006/09/07 20:59:47 mhitch Exp $");
#include <sys/param.h>
#include <sys/kernel.h>
@ -203,5 +203,5 @@ dracougettod(todr_chip_handle_t h, volatile struct timeval *tvp)
int
dracousettod(todr_chip_handle_t h, volatile struct timeval *tvp)
{
return 1;
return (ENXIO);
}