Skip to contentSkip to conversation

media: i2c: video-i2c: fix build errors due to 'imply hwmon'

PATCH Superseded Matt Ranostay 2 participants 3 messages Mar 22, 2020 – Mar 23, 2020 1 message not in the archive

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Matt Ranostay

author maintainer
#0 lore raw

PATCH 1/1 media: i2c: video-i2c: fix build errors due to 'imply hwmon'

Fix build fault when CONFIG_HWMON is a module, and CONFIG_VIDEO_I2C as builtin. This is due to 'imply hwmon' in the respective Kconfig.

Issue build log:

ld: drivers/media/i2c/video-i2c.o: in function `amg88xx_hwmon_init':
video-i2c.c:(.text+0x2e1): undefined reference to `devm_hwmon_device_register_with_info

Fixes acbea6798955 (media: video-i2c: add hwmon support for amg88xx)
---
 drivers/media/i2c/video-i2c.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/i2c/video-i2c.c +1 -1
index 3c770ecd4bf7..b34eff4745e3 100644
@@ -255,7 +255,7 @@ static int amg88xx_set_power(struct video_i2c_data *data, bool on)
 	return amg88xx_set_power_off(data);
 }
 
-#if IS_ENABLED(CONFIG_HWMON)
+#if IS_ENABLED(CONFIG_HWMON) && !(IS_MODULE(CONFIG_HWMON) && IS_BUILTIN(CONFIG_VIDEO_I2C))
 
 static const u32 amg88xx_temp_config[] = {
 	HWMON_T_INPUT,
Signature · 1 line
2.25.1
Acked-by on v1 1/1
#1 lore raw
Quoted 11 lines · Matt Ranostay

Fix build fault when CONFIG_HWMON is a module, and CONFIG_VIDEO_I2C as builtin. This is due to 'imply hwmon' in the respective Kconfig.

Issue build log:

ld: drivers/media/i2c/video-i2c.o: in function `amg88xx_hwmon_init':
video-i2c.c:(.text+0x2e1): undefined reference to `devm_hwmon_device_register_with_info

Fixes acbea6798955 (media: video-i2c: add hwmon support for amg88xx)
Signature · 1 line
Sakari Ailus

A message that is not in the archive (sent off-list or not yet received): CAHp75VfOorFXrR9pVOj7VRH4e4tEUByHbHavffJ9AuRCd=aVzw@mail.gmail.com

author maintainer
#3 lore raw
Quoted 2 lines · Andy Shevchenko

Perhaps IS_REACHABLE?

Ah learn a new macro everyday. I'll use that for v2

Thanks,

Matt

Quoted 28 lines · Sakari Ailus
Quoted 10 lines · Matt Ranostay
Quoted 8 lines

Fix build fault when CONFIG_HWMON is a module, and CONFIG_VIDEO_I2C as builtin. This is due to 'imply hwmon' in the respective Kconfig.

Issue build log:

ld: drivers/media/i2c/video-i2c.o: in function `amg88xx_hwmon_init':
video-i2c.c:(.text+0x2e1): undefined reference to `devm_hwmon_device_register_with_info

Quoted 8 lines
Quoted 3 lines
Fixes acbea6798955 (media: video-i2c: add hwmon support for amg88xx)

--
Sakari Ailus

--
With Best Regards,
Andy Shevchenko