Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

rtc: ds3232: Use HWMON_CHANNEL_INFO macro to simplify code

Use HWMON_CHANNEL_INFO macro to simplify code.

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Link: https://lore.kernel.org/r/20250210054546.10785-3-lihuisong@huawei.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>

authored by

Huisong Li and committed by
Alexandre Belloni
d659dfec f432c5d5

+2 -22
+2 -22
drivers/rtc/rtc-ds3232.c
··· 339 339 return err; 340 340 } 341 341 342 - static u32 ds3232_hwmon_chip_config[] = { 343 - HWMON_C_REGISTER_TZ, 344 - 0 345 - }; 346 - 347 - static const struct hwmon_channel_info ds3232_hwmon_chip = { 348 - .type = hwmon_chip, 349 - .config = ds3232_hwmon_chip_config, 350 - }; 351 - 352 - static u32 ds3232_hwmon_temp_config[] = { 353 - HWMON_T_INPUT, 354 - 0 355 - }; 356 - 357 - static const struct hwmon_channel_info ds3232_hwmon_temp = { 358 - .type = hwmon_temp, 359 - .config = ds3232_hwmon_temp_config, 360 - }; 361 - 362 342 static const struct hwmon_channel_info * const ds3232_hwmon_info[] = { 363 - &ds3232_hwmon_chip, 364 - &ds3232_hwmon_temp, 343 + HWMON_CHANNEL_INFO(chip, HWMON_C_REGISTER_TZ), 344 + HWMON_CHANNEL_INFO(temp, HWMON_T_INPUT), 365 345 NULL 366 346 }; 367 347