[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250704212929.12348-1-abd.masalkhi@gmail.com>
Date: Fri, 4 Jul 2025 21:29:28 +0000
From: Abd-Alrhman Masalkhi <abd.masalkhi@...il.com>
To: christophe.jaillet@...adoo.fr
Cc: abd.masalkhi@...il.com,
arnd@...db.de,
conor+dt@...nel.org,
devicetree@...r.kernel.org,
gregkh@...uxfoundation.org,
krzk+dt@...nel.org,
linux-kernel@...r.kernel.org,
luoyifan@...s.chinamobile.com,
robh@...nel.org
Subject: Re: [PATCH v5 2/3] eeprom: add driver for ST M24LR series RFID/NFC EEPROM chips
Hi Christophe
On Fri, 4 Jul 2025 20:40:51 +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()?
>
> Hmm, this ends being used with BIN_ATTR() in
> m24lr_ctl_sss_[read|write]() so it needs to keep with ssize_t.
Done.
Best regards,
Abd-Alrhman Masalkhi
Powered by blists - more mailing lists