Bug 118331 - typing error in https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/drivers/rtc/rtc-bq32k.c
Summary: typing error in https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.g...
Status: NEW
Alias: None
Product: Drivers
Classification: Unclassified
Component: Other (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: drivers_other
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-05-17 02:17 UTC by paul
Modified: 2016-05-17 02:17 UTC (History)
0 users

See Also:
Kernel Version: 4.6
Subsystem:
Regression: No
Bisected commit-id:


Attachments

Description paul 2016-05-17 02:17:57 UTC
Hi 

https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/drivers/rtc/rtc-bq32k.c


static int bq32k_rtc_read_time(struct device *dev, struct rtc_time *tm)
{
	struct bq32k_regs regs;
	int error;

	error = bq32k_read(dev, &regs, 0, sizeof(regs));
	if (error)
		return error;

	tm->tm_sec = bcd2bin(regs.seconds & BQ32K_SECONDS_MASK);
	tm->tm_min = bcd2bin(regs.minutes & BQ32K_SECONDS_MASK); <---Wrong here
	tm->tm_hour = bcd2bin(regs.cent_hours & BQ32K_HOURS_MASK);
	tm->tm_mday = bcd2bin(regs.date);
	tm->tm_wday = bcd2bin(regs.day) - 1;
	tm->tm_mon = bcd2bin(regs.month) - 1;
	tm->tm_year = bcd2bin(regs.years) +
				((regs.cent_hours & BQ32K_CENT) ? 100 : 0);

	return rtc_valid_tm(tm);
}

the correct is BQ32K_MINUTES_MASK , not BQ32K_SECONDS_MASK

Note You need to log in before you can comment on or make changes to this bug.