Re: [PATCH v5 2/3] eeprom: add driver for ST M24LR series RFID/NFC EEPROM chips

From: Abd-Alrhman Masalkhi
Date: Fri Jul 04 2025 - 11:13:06 EST


Hi Christophe,

Thank you for the review!

On Fri, 4 Jul 2025 16:12:56 +0200, Christophe JAILLET wrote:
> > +/**
> > + * m24lr_regmap_read - read data using regmap with retry on failure
> > + * @regmap: regmap instance for the device
> > + * @buf: buffer to store the read data
> > + * @size: number of bytes to read
> > + * @offset: starting register address
> > + *
> > + * Attempts to read a block of data from the device with retries and timeout.
> > + * Some M24LR chips may transiently NACK reads (e.g., during internal write
> > + * cycles), so this function retries with a short sleep until the timeout
> > + * expires.
> > + *
> > + * Returns:
> > + * Number of bytes read on success,
> > + * -ETIMEDOUT if the read fails within the timeout window.
> > + */
> > +static ssize_t m24lr_regmap_read(struct regmap *regmap, u8 *buf,
> > + size_t size, unsigned int offset)
>
> Why returning a ssize_t?
> regmap_bulk_read() returns an int.

Since I return @size (of type size_t) on success, should I keep the
return type as ssize_t, or would it be better to change it to int
to match regmap_bulk_read()?

Best regards,
Abd-Alrhman Masalkhi