w1: ds2433: use the kernel bitmap implementation
authorMarc Ferland <marc.ferland@sonatest.com>
Mon, 18 Dec 2023 15:02:29 +0000 (10:02 -0500)
committerKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Wed, 20 Dec 2023 08:25:25 +0000 (09:25 +0100)
commit3fe3a1bfef75efcdfbcca955fe1d47ec07215110
tree20798c15797bf28c5af6477505d4fd57610453ef
parent75f0c1c78d709f258004562a540c83bc05bfb962
w1: ds2433: use the kernel bitmap implementation

The ds2433 driver uses the 'validcrc' variable to mark out which pages
have been successfully (crc is valid) retrieved from the eeprom and
placed in the internal 'memory' buffer (see CONFIG_W1_SLAVE_DS2433_CRC).

The current implementation assumes that the number of pages will never
go beyond 32 pages (bit field is a u32). This is fine for the ds2433
since it only has 16 pages.

On the ds28ec20 though, the number of pages increases to 80 which will
not fit on a single u32.

As a solution, I replaced the u32 variable with a standard bitmap and
set the number of bits to 32 which is the same size we had before.

Signed-off-by: Marc Ferland <marc.ferland@sonatest.com>
Link: https://lore.kernel.org/r/20231218150230.1992448-5-marc.ferland@sonatest.com
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
drivers/w1/slaves/w1_ds2433.c