Re: (tiny) patch review: return if RTC diag fails

Manuel Bouyer <[email protected]>
Newsgroups gmane.os.netbsd.devel.kernel
Message-ID <[email protected]>
On Tue, Feb 18, 2025 at 09:43:16PM +0100, Emile `iMil' Heitor wrote:
> On Tue, 18 Feb 2025, Emile `iMil' Heitor wrote:
> 
> > if ((mc146818_read(NULL, MC_REGD) & MC_REGD_VRT) == 0)
> > 	 return (-1);
> 
> My bad, this test assumes the chip is replying something valid, what
> we want to test is that bits 0 to 6 are set to 0, so in startrtclock()
> it would be:
> 
> /* RTC is present, bits 0 to 6 are 0 */
> if ((mc146818_read(NULL, MC_REGD) & 0x7f) != 0)
> 	return;

To me it looks good.

-- 
Manuel Bouyer <[email protected]>
     NetBSD: 26 ans d'experience feront toujours la difference
--
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.