diff mbox series

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

Message ID 20200322011833.231963-1-matt.ranostay@konsulko.com (mailing list archive)
State New, archived
Headers show
Series media: i2c: video-i2c: fix build errors due to 'imply hwmon' | expand

Commit Message

Matt Ranostay March 22, 2020, 1:18 a.m. UTC
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

Cc: rdunlap@infradead.org
Fixes: acbea6798955 (media: video-i2c: add hwmon support for amg88xx)
Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com>
---
 drivers/media/i2c/video-i2c.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Sakari Ailus March 23, 2020, 7:13 a.m. UTC | #1
On Sat, Mar 21, 2020 at 06:18:33PM -0700, Matt Ranostay wrote:
> 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
> 
> Cc: rdunlap@infradead.org
> Fixes: acbea6798955 (media: video-i2c: add hwmon support for amg88xx)
> Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com>

Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Matt Ranostay March 23, 2020, 8:21 p.m. UTC | #2
On Mon, Mar 23, 2020 at 12:29 AM Andy Shevchenko
<andy.shevchenko@gmail.com> wrote:
>
> Perhaps IS_REACHABLE?

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

Thanks,

Matt

>
> On Monday, March 23, 2020, Sakari Ailus <sakari.ailus@iki.fi> wrote:
>>
>> On Sat, Mar 21, 2020 at 06:18:33PM -0700, Matt Ranostay wrote:
>> > 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
>> >
>> > Cc: rdunlap@infradead.org
>> > Fixes: acbea6798955 (media: video-i2c: add hwmon support for amg88xx)
>> > Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com>
>>
>> Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
>>
>> --
>> Sakari Ailus
>
>
>
> --
> With Best Regards,
> Andy Shevchenko
>
>
diff mbox series

Patch

diff --git a/drivers/media/i2c/video-i2c.c b/drivers/media/i2c/video-i2c.c
index 3c770ecd4bf7..b34eff4745e3 100644
--- a/drivers/media/i2c/video-i2c.c
+++ b/drivers/media/i2c/video-i2c.c
@@ -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,