Re: [PATCH v2 next 1/5] iio: sca3000: cache SPI device ID in probe

From: David Lechner

Date: Tue Feb 03 2026 - 10:27:09 EST


On 2/3/26 4:24 AM, Harshit Mogalapalli wrote:
> Hi David,
>
> On 03/02/26 04:31, David Lechner wrote:
>> On 2/2/26 1:40 PM, Harshit Mogalapalli wrote:
>>> Store the spi_device_id at probe entry and reuse it for the name and
>>> chip info instead of calling spi_get_device_id() repeatedly.
>>
>> Even better would be to replace spi_get_device_id() with
>> pi_get_device_match_data() and turn sca3000_spi_chip_info_tbl[]
>> into individual structs that are used directly as the match
>> data pointers.
>>
>
> Thanks for the review.
>
> Jonathan also suggested this on v1, but thought of doing this item separate to this patch series(as its a functional change) , would you mind if I do it in a separate patch after this series ?

I'm not sure why it would be considered a functional change. If you want to
save it for a separate series, that is fine. If we do that though, there
is probably not much point in cleaning up spi_get_device_id() first since
it will all be replaced anyway.