]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
media: video-i2c: Use HWMON_CHANNEL_INFO macro to simplify code
authorHuisong Li <lihuisong@huawei.com>
Mon, 10 Feb 2025 03:48:42 +0000 (11:48 +0800)
committerHans Verkuil <hverkuil@xs4all.nl>
Fri, 21 Feb 2025 09:33:02 +0000 (10:33 +0100)
Use HWMON_CHANNEL_INFO macro to simplify code.

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
drivers/media/i2c/video-i2c.c

index 036a6375627a95a7ad17a07d883e033324ad471c..0dd991d70d538050731c0106533d6f0618853b1f 100644 (file)
@@ -264,18 +264,8 @@ static int amg88xx_set_power(struct video_i2c_data *data, bool on)
 
 #if IS_REACHABLE(CONFIG_HWMON)
 
-static const u32 amg88xx_temp_config[] = {
-       HWMON_T_INPUT,
-       0
-};
-
-static const struct hwmon_channel_info amg88xx_temp = {
-       .type = hwmon_temp,
-       .config = amg88xx_temp_config,
-};
-
 static const struct hwmon_channel_info * const amg88xx_info[] = {
-       &amg88xx_temp,
+       HWMON_CHANNEL_INFO(temp, HWMON_T_INPUT),
        NULL
 };