tech-kern archive

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

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



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 <bouyer%antioche.eu.org@localhost>
     NetBSD: 26 ans d'experience feront toujours la difference
--


Home | Main Index | Thread Index | Old Index