Re: [PATCH v3 5/8] rtc: abx80x: use regmap instead of I2C specific API
[email protected] Fri, 31 Jul 2026 19:05:58 +0000
| Newsgroups | org.kernel.vger.linux-rtc,org.kernel.vger.linux-devicetree |
|---|---|
| Message-ID | <[email protected]> |
Thank you for your contribution! Sashiko AI review found 1 potential issue(= s) to consider: - [Low] Variables declared as `int` are passed by reference to `regmap_read= `, which expects an `unsigned int *`. -- --- Patch [5]: [PATCH v3 5/8] rtc: abx80x: use regmap instead of I2C specif= ic API --- commit 5bae78c37282c7d7693255ad432126ac7e8c51f8 Author: Antoni Pokusinski <[email protected]> rtc: abx80x: use regmap instead of I2C specific API This commit reworks the abx80x RTC driver to use regmap API instead of=20 i2c_smbus functions. This prepares the driver for future ABX81X SPI support. > diff --git a/drivers/rtc/rtc-abx80x.c b/drivers/rtc/rtc-abx80x.c > index 4ac3ace687a1e..23823fc2f5458 100644 > --- a/drivers/rtc/rtc-abx80x.c > +++ b/drivers/rtc/rtc-abx80x.c [ ... ] > @@ -221,8 +224,7 @@ static int abx80x_rtc_read_time(struct device *dev, s= truct rtc_time *tm) > =20 > static int abx80x_rtc_set_time(struct device *dev, struct rtc_time *tm) > { > - struct i2c_client *client =3D to_i2c_client(dev); > - struct abx80x_priv *priv =3D i2c_get_clientdata(client); > + struct abx80x_priv *priv =3D dev_get_drvdata(dev); > unsigned char buf[8]; > int err, flags; > =20 [ ... ] > /* Clear the OF bit of Oscillator Status Register */ > - flags =3D i2c_smbus_read_byte_data(client, ABX8XX_REG_OSS); > - if (flags < 0) > - return flags; > + err =3D regmap_read(priv->regmap, ABX8XX_REG_OSS, &flags); [Severity: Low] Will this cause a compiler error on GCC 14+ due to incompatible pointer typ= es? The regmap_read() function expects an "unsigned int *" for its third argume= nt, but "flags" is declared as an "int" here. It looks like this same issue with passing an "int *" to regmap_read() also happens with the "flags" variable in abx80x_rtc_set_autocalibration() and oscillator_store(), as well as with the "data" variable in abx80x_probe(). [ ... ] --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20260731184831.4403= [email protected]?part=3D5