media: i2c: thp7312: select CONFIG_FW_LOADER
PATCH 1/1 media: i2c: thp7312: select CONFIG_FW_LOADER
From: Arnd Bergmann <[email protected]>
The recently added driver uses the firmware loader mechanism but causes a link failure when that is in a loadable module while thp7312 itself is built-in:
arm-linux-gnueabi-ld: drivers/media/i2c/thp7312.o: in function `thp7312_probe':
thp7312.c:(.text+0x4164): undefined reference to `firmware_upload_register'
Select the required Kconfig symbol. Note that the driver specifically needs the firmware upload interface that is controlled by CONFIG_FW_UPLOAD, but there is no link failure when that is disabled because the interfaces are stubbed out here.
--- drivers/media/i2c/Kconfig | 1 + 1 file changed, 1 insertion(+)
drivers/media/i2c/Kconfig +1 -0
@@ -674,6 +674,7 @@ menu "Camera ISPs" config VIDEO_THP7312 tristate "THine THP7312 support" depends on I2C + select FW_LOADER select MEDIA_CONTROLLER select V4L2_CCI_I2C select V4L2_FWNODE
Signature · 1 line
2.39.2
Hi Arnd,
Thank you for the patch.
Quoted 9 lines · Arnd Bergmann
From: Arnd Bergmann <[email protected]>
The recently added driver uses the firmware loader mechanism but causes a link failure when that is in a loadable module while thp7312 itself is built-in:
arm-linux-gnueabi-ld:
drivers/media/i2c/thp7312.o: in function `thp7312_probe':
thp7312.c:(.text+0x4164): undefined reference to `firmware_upload_register'
Quoted 7 lines
Select the required
Kconfigsymbol. Note that the driver specifically needs the firmware upload interface that is controlled byCONFIG_FW_UPLOAD, but there is no link failure when that is disabled because the interfaces are stubbed out here.Fixes 7a52ab415b43 ("media: i2c: Add driver for THine THP7312")Signed-off-by Arnd Bergmann <[email protected]>
I've posted a similar fix yesterday, see
https://lore.kernel.org/linux-media/[email protected]
What approach do you think is best ?
Quoted 16 lines
--- drivers/media/i2c/Kconfig | 1 + 1 file changed, 1 insertion(+)drivers/media/i2c/Kconfig +1
-0@@ -674,6 +674,7 @@ menu "Camera ISPs" config VIDEO_THP7312 tristate "THine THP7312 support" depends on I2C + select FW_LOADER select MEDIA_CONTROLLER select V4L2_CCI_I2C select V4L2_FWNODE
Signature · 3 lines
Regards, Laurent Pinchart
Quoted 19 lines · Laurent Pinchart
Hi Arnd,
Thank you for the patch.
Quoted 14 lines · Arnd Bergmann
From: Arnd Bergmann <[email protected]>
The recently added driver uses the firmware loader mechanism but causes a link failure when that is in a loadable module while thp7312 itself is built-in:
arm-linux-gnueabi-ld:
drivers/media/i2c/thp7312.o: in function `thp7312_probe':
thp7312.c:(.text+0x4164): undefined reference to `firmware_upload_register'Select the required
Kconfigsymbol. Note that the driver specifically needs the firmware upload interface that is controlled byCONFIG_FW_UPLOAD, but there is no link failure when that is disabled because the interfaces are stubbed out here.
Quoted 7 lines
Quoted 2 lines
Fixes 7a52ab415b43 ("media: i2c: Add driver for THine THP7312")Signed-off-by Arnd Bergmann <[email protected]>I've posted a similar fix yesterday, see
https://lore.kernel.org/linux-media/[email protected]What approach do you think is best ?
By far the dominant use of FW_LOADER is to select it instead of depend on it, so I prefer Arnd's patch.
Quoted 18 lines
Quoted 17 lines
--- drivers/media/i2c/Kconfig | 1 + 1 file changed, 1 insertion(+)drivers/media/i2c/Kconfig +1
-0@@ -674,6 +674,7 @@ menu "Camera ISPs" config VIDEO_THP7312 tristate "THine THP7312 support" depends on I2C + select FW_LOADER select MEDIA_CONTROLLER select V4L2_CCI_I2C select V4L2_FWNODE
Signature · 1 line
#Randy
Laurent Pinchart
Reviewed-byQuoted 19 lines · Randy Dunlap
Quoted 18 lines · Laurent Pinchart
Quoted 16 lines · Arnd Bergmann
From: Arnd Bergmann <[email protected]>
The recently added driver uses the firmware loader mechanism but causes a link failure when that is in a loadable module while thp7312 itself is built-in:
arm-linux-gnueabi-ld:
drivers/media/i2c/thp7312.o: in function `thp7312_probe':
thp7312.c:(.text+0x4164): undefined reference to `firmware_upload_register'Select the required
Kconfigsymbol. Note that the driver specifically needs the firmware upload interface that is controlled byCONFIG_FW_UPLOAD, but there is no link failure when that is disabled because the interfaces are stubbed out here.Fixes 7a52ab415b43 ("media: i2c: Add driver for THine THP7312")Signed-off-by Arnd Bergmann <[email protected]>
Quoted 7 lines
Quoted 4 lines
I've posted a similar fix yesterday, see
https://lore.kernel.org/linux-media/[email protected]What approach do you think is best ?
By far the dominant use of
FW_LOADERis to select it instead of depend on it, so I prefer Arnd's patch.
The alternative could save space, but I expect that to be an uncommon use case, as FW_LOADER will likely be selected for other reasons anyway.
Quoted 16 lines
Quoted 16 lines
Quoted 16 lines
--- drivers/media/i2c/Kconfig | 1 + 1 file changed, 1 insertion(+)drivers/media/i2c/Kconfig +1
-0@@ -674,6 +674,7 @@ menu "Camera ISPs" config VIDEO_THP7312 tristate "THine THP7312 support" depends on I2C + select FW_LOADER select MEDIA_CONTROLLER select V4L2_CCI_I2C select V4L2_FWNODE
Signature · 3 lines
Regards, Laurent Pinchart