]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
rtc: ds3232: Use HWMON_CHANNEL_INFO macro to simplify code
authorHuisong Li <lihuisong@huawei.com>
Mon, 10 Feb 2025 05:45:46 +0000 (13:45 +0800)
committerAlexandre Belloni <alexandre.belloni@bootlin.com>
Mon, 3 Mar 2025 22:04:37 +0000 (23:04 +0100)
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>
drivers/rtc/rtc-ds3232.c

index 19c09c4187462881c0100bcf1107e9f53fc391f3..18f35823b4b5b899139a7d56bdb8ac00c9aba629 100644 (file)
@@ -339,29 +339,9 @@ static int ds3232_hwmon_read(struct device *dev,
        return err;
 }
 
-static u32 ds3232_hwmon_chip_config[] = {
-       HWMON_C_REGISTER_TZ,
-       0
-};
-
-static const struct hwmon_channel_info ds3232_hwmon_chip = {
-       .type = hwmon_chip,
-       .config = ds3232_hwmon_chip_config,
-};
-
-static u32 ds3232_hwmon_temp_config[] = {
-       HWMON_T_INPUT,
-       0
-};
-
-static const struct hwmon_channel_info ds3232_hwmon_temp = {
-       .type = hwmon_temp,
-       .config = ds3232_hwmon_temp_config,
-};
-
 static const struct hwmon_channel_info * const ds3232_hwmon_info[] = {
-       &ds3232_hwmon_chip,
-       &ds3232_hwmon_temp,
+       HWMON_CHANNEL_INFO(chip, HWMON_C_REGISTER_TZ),
+       HWMON_CHANNEL_INFO(temp, HWMON_T_INPUT),
        NULL
 };