Skip to content

Commit

Permalink
rtc: rv3028: Fix backup-switchover-mode crash
Browse files Browse the repository at this point in the history
Commit "rtc: rv3028: Mirror BSM and TCE/TCR to EEPROM" was a
forward-port from rpi-5.9.y, and between then and rpi-5.15.y the
rv3028_eeprom_read function was changed from requiring a regmap
pointer to a pointer to the rv3028_data structure. However,
because the declaration specifies a void * pointer, the compiler issues
no warning and the added call to rv3028_eeprom_read leads to an
exception when backup-switchover-mode is used.

See: #2912

Signed-off-by: Phil Elwell <[email protected]>
  • Loading branch information
pelwell committed Jan 9, 2023
1 parent d8ca89e commit cd8d5fb
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/rtc/rtc-rv3028.c
Original file line number Diff line number Diff line change
Expand Up @@ -963,8 +963,7 @@ static int rv3028_probe(struct i2c_client *client)
}

if (backup_mask) {
ret = rv3028_eeprom_read((void *)(rv3028->regmap),
RV3028_BACKUP,
ret = rv3028_eeprom_read((void *)rv3028, RV3028_BACKUP,
(void *)&backup, 1);
/* Write register and EEPROM if needed */
if (!ret && (backup & backup_mask) != backup_bits) {
Expand Down

0 comments on commit cd8d5fb

Please sign in to comment.