hwmon: lm70: simplify with spi_get_device_match_data()

Use spi_get_device_match_data() helper to simplify a bit the driver.
Also kernel_ulong_t type is preferred for kernel code over uintptr_t
(needed for the cast).

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20240606142515.132504-1-krzysztof.kozlowski@linaro.org
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
This commit is contained in:
Krzysztof Kozlowski 2024-06-06 16:25:15 +02:00 committed by Guenter Roeck
parent 6ce402327a
commit b1ea8f7a30

View File

@ -169,11 +169,7 @@ static int lm70_probe(struct spi_device *spi)
struct lm70 *p_lm70;
int chip;
if (dev_fwnode(&spi->dev))
chip = (int)(uintptr_t)device_get_match_data(&spi->dev);
else
chip = spi_get_device_id(spi)->driver_data;
chip = (kernel_ulong_t)spi_get_device_match_data(spi);
/* signaling is SPI_MODE_0 */
if ((spi->mode & SPI_MODE_X_MASK) != SPI_MODE_0)