Skip to content

Commit f1de1c7

Browse files
ehristevmchehab
authored andcommitted
media: atmel: fix build when ISC=m and XISC=y
Building VIDEO_ATMEL_ISC as module and VIDEO_ATMEL_XISC as built-in (or viceversa) causes build errors: or1k-linux-ld: drivers/media/platform/atmel/atmel-isc-base.o: in function `isc_async_complete': atmel-isc-base.c:(.text+0x40d0): undefined reference to `__this_module' or1k-linux-ld: atmel-isc-base.c:(.text+0x40f0): undefined reference to `__this_module' or1k-linux-ld: drivers/media/platform/atmel/atmel-isc-base.o:(.rodata+0x390): undefined reference to `__this_module' or1k-linux-ld: drivers/media/platform/atmel/atmel-isc-base.o:(__param+0x4): undefined reference to `__this_module' or1k-linux-ld: drivers/media/platform/atmel/atmel-isc-base.o:(__param+0x18): undefined reference to `__this_module' This is caused by the file atmel-isc-base.c which is common code between the two drivers. The solution is to create another Kconfig symbol that is automatically selected and generates the module atmel-isc-base.ko. This module can be loaded when both drivers are modules, or built-in when at least one of them is built-in. Reported-by: kernel test robot <[email protected]> Fixes: c9aa973 ("media: atmel: atmel-isc: add microchip-xisc driver") Signed-off-by: Eugen Hristev <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
1 parent c592b46 commit f1de1c7

File tree

3 files changed

+22
-2
lines changed

3 files changed

+22
-2
lines changed

drivers/media/platform/atmel/Kconfig

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ config VIDEO_ATMEL_ISC
88
select VIDEOBUF2_DMA_CONTIG
99
select REGMAP_MMIO
1010
select V4L2_FWNODE
11+
select VIDEO_ATMEL_ISC_BASE
1112
help
1213
This module makes the ATMEL Image Sensor Controller available
1314
as a v4l2 device.
@@ -19,10 +20,17 @@ config VIDEO_ATMEL_XISC
1920
select VIDEOBUF2_DMA_CONTIG
2021
select REGMAP_MMIO
2122
select V4L2_FWNODE
23+
select VIDEO_ATMEL_ISC_BASE
2224
help
2325
This module makes the ATMEL eXtended Image Sensor Controller
2426
available as a v4l2 device.
2527

28+
config VIDEO_ATMEL_ISC_BASE
29+
tristate
30+
default n
31+
help
32+
ATMEL ISC and XISC common code base.
33+
2634
config VIDEO_ATMEL_ISI
2735
tristate "ATMEL Image Sensor Interface (ISI) support"
2836
depends on VIDEO_V4L2 && OF

drivers/media/platform/atmel/Makefile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
# SPDX-License-Identifier: GPL-2.0-only
2-
atmel-isc-objs = atmel-sama5d2-isc.o atmel-isc-base.o
3-
atmel-xisc-objs = atmel-sama7g5-isc.o atmel-isc-base.o
2+
atmel-isc-objs = atmel-sama5d2-isc.o
3+
atmel-xisc-objs = atmel-sama7g5-isc.o
44

55
obj-$(CONFIG_VIDEO_ATMEL_ISI) += atmel-isi.o
6+
obj-$(CONFIG_VIDEO_ATMEL_ISC_BASE) += atmel-isc-base.o
67
obj-$(CONFIG_VIDEO_ATMEL_ISC) += atmel-isc.o
78
obj-$(CONFIG_VIDEO_ATMEL_XISC) += atmel-xisc.o

drivers/media/platform/atmel/atmel-isc-base.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -378,6 +378,7 @@ int isc_clk_init(struct isc_device *isc)
378378

379379
return 0;
380380
}
381+
EXPORT_SYMBOL_GPL(isc_clk_init);
381382

382383
void isc_clk_cleanup(struct isc_device *isc)
383384
{
@@ -392,6 +393,7 @@ void isc_clk_cleanup(struct isc_device *isc)
392393
clk_unregister(isc_clk->clk);
393394
}
394395
}
396+
EXPORT_SYMBOL_GPL(isc_clk_cleanup);
395397

396398
static int isc_queue_setup(struct vb2_queue *vq,
397399
unsigned int *nbuffers, unsigned int *nplanes,
@@ -1578,6 +1580,7 @@ irqreturn_t isc_interrupt(int irq, void *dev_id)
15781580

15791581
return ret;
15801582
}
1583+
EXPORT_SYMBOL_GPL(isc_interrupt);
15811584

15821585
static void isc_hist_count(struct isc_device *isc, u32 *min, u32 *max)
15831586
{
@@ -2212,6 +2215,7 @@ const struct v4l2_async_notifier_operations isc_async_ops = {
22122215
.unbind = isc_async_unbind,
22132216
.complete = isc_async_complete,
22142217
};
2218+
EXPORT_SYMBOL_GPL(isc_async_ops);
22152219

22162220
void isc_subdev_cleanup(struct isc_device *isc)
22172221
{
@@ -2224,6 +2228,7 @@ void isc_subdev_cleanup(struct isc_device *isc)
22242228

22252229
INIT_LIST_HEAD(&isc->subdev_entities);
22262230
}
2231+
EXPORT_SYMBOL_GPL(isc_subdev_cleanup);
22272232

22282233
int isc_pipeline_init(struct isc_device *isc)
22292234
{
@@ -2264,6 +2269,7 @@ int isc_pipeline_init(struct isc_device *isc)
22642269

22652270
return 0;
22662271
}
2272+
EXPORT_SYMBOL_GPL(isc_pipeline_init);
22672273

22682274
/* regmap configuration */
22692275
#define ATMEL_ISC_REG_MAX 0xd5c
@@ -2273,4 +2279,9 @@ const struct regmap_config isc_regmap_config = {
22732279
.val_bits = 32,
22742280
.max_register = ATMEL_ISC_REG_MAX,
22752281
};
2282+
EXPORT_SYMBOL_GPL(isc_regmap_config);
22762283

2284+
MODULE_AUTHOR("Songjun Wu");
2285+
MODULE_AUTHOR("Eugen Hristev");
2286+
MODULE_DESCRIPTION("Atmel ISC common code base");
2287+
MODULE_LICENSE("GPL v2");

0 commit comments

Comments
 (0)