Skip to contentSkip to conversation

cedrus: Drop unneeded CONFIG_OF dependency

PATCH In review Ezequiel Garcia 2 participants 5 messages Apr 2, 2020 – Apr 21, 2020

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cedrus: Drop unneeded CONFIG_OF dependency

The driver is perfectly capable of being built without CONFIG_OF. Remove this dependency, which is useful for compile-only tests.

---
 drivers/staging/media/sunxi/cedrus/Kconfig | 1 -
 1 file changed, 1 deletion(-)
drivers/staging/media/sunxi/cedrus/Kconfig +0 -1
index 17733e9a088f..59b8d1b29865 100644
@@ -3,7 +3,6 @@ config VIDEO_SUNXI_CEDRUS
 	tristate "Allwinner Cedrus VPU driver"
 	depends on VIDEO_DEV && VIDEO_V4L2 && MEDIA_CONTROLLER
 	depends on HAS_DMA
-	depends on OF
 	depends on MEDIA_CONTROLLER_REQUEST_API
 	select SUNXI_SRAM
 	select VIDEOBUF2_DMA_CONTIG
Signature · 1 line
2.26.0.rc2
#1 lore raw

Hi Ezequiel,

Quoted 2 lines · Ezequiel Garcia

The driver is perfectly capable of being built without CONFIG_OF. Remove this dependency, which is useful for compile-only tests.

Thanks for the patch!

Alas, the driver won't do anything useful without OF enabled, so it seems useful to keep that dependency.

I would suggest making this a: depends on OF || COMPILE_TEST instead. What do you think?

Cheers,

Paul

Quoted 20 lines
---
 drivers/staging/media/sunxi/cedrus/Kconfig | 1 -
 1 file changed, 1 deletion(-)
drivers/staging/media/sunxi/cedrus/Kconfig +0 -1
index 17733e9a088f..59b8d1b29865 100644
@@ -3,7 +3,6 @@ config VIDEO_SUNXI_CEDRUS
 	tristate "Allwinner Cedrus VPU driver"
 	depends on VIDEO_DEV && VIDEO_V4L2 && MEDIA_CONTROLLER
 	depends on HAS_DMA
-	depends on OF
 	depends on MEDIA_CONTROLLER_REQUEST_API
 	select SUNXI_SRAM
 	select VIDEOBUF2_DMA_CONTIG
Signature · 1 line
2.26.0.rc2
Signature · 3 lines
Paul Kocialkowski, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com
#2 lore raw
Quoted 11 lines · Paul Kocialkowski

Hi Ezequiel,

Quoted 2 lines · Ezequiel Garcia

The driver is perfectly capable of being built without CONFIG_OF. Remove this dependency, which is useful for compile-only tests.

Thanks for the patch!

Alas, the driver won't do anything useful without OF enabled, so it seems useful to keep that dependency.

I'm not convinced about this argument, I like to have dependencies on things the driver needs to compile (except the machine option, see below).

Quoted 3 lines

I would suggest making this a: depends on OF || COMPILE_TEST instead. What do you think?

Although there are a handful, I don't see many drivers doing that. To be honest, I don't like this much.

Also, if you want to make sure this driver can only be selected where it makes sense, you consider having a ARCH_SUNXI || COMPILE_TEST.

IMO, the dependency on OF should be dropped as well.

Cheers,
Eze

Quoted 24 lines

Cheers,

Paul

Quoted 20 lines
---
 drivers/staging/media/sunxi/cedrus/Kconfig | 1 -
 1 file changed, 1 deletion(-)
drivers/staging/media/sunxi/cedrus/Kconfig +0 -1
index 17733e9a088f..59b8d1b29865 100644
@@ -3,7 +3,6 @@ config VIDEO_SUNXI_CEDRUS
 	tristate "Allwinner Cedrus VPU driver"
 	depends on VIDEO_DEV && VIDEO_V4L2 && MEDIA_CONTROLLER
 	depends on HAS_DMA
-	depends on OF
 	depends on MEDIA_CONTROLLER_REQUEST_API
 	select SUNXI_SRAM
 	select VIDEOBUF2_DMA_CONTIG
Signature · 1 line
2.26.0.rc2
#3 lore raw

Hi Ezequiel,

Quoted 7 lines · Ezequiel Garcia
Quoted 6 lines · Paul Kocialkowski

Hi Ezequiel,

Quoted 2 lines · Ezequiel Garcia

The driver is perfectly capable of being built without CONFIG_OF. Remove this dependency, which is useful for compile-only tests.

Quoted 8 lines
Quoted 4 lines

Thanks for the patch!

Alas, the driver won't do anything useful without OF enabled, so it seems useful to keep that dependency.

I'm not convinced about this argument, I like to have dependencies on things the driver needs to compile (except the machine option, see below).

Is there a general kernel-wide policy about that?

I must admit that I never really understood if Kconfig depends are supposed to strictly reflect build dependencies or dependencies that must reasonably be expected for the driver to be useful. The arch dependency (which is farily common) seems to suggest the latter.

Maxime, any thought about that?

Quoted 8 lines
Quoted 2 lines

I would suggest making this a: depends on OF || COMPILE_TEST instead. What do you think?

Although there are a handful, I don't see many drivers doing that. To be honest, I don't like this much.

Also, if you want to make sure this driver can only be selected where it makes sense, you consider having a ARCH_SUNXI || COMPILE_TEST.

Fair enough, that would be the consistent choice with OF || COMPILE_TEST.

Quoted 31 lines

IMO, the dependency on OF should be dropped as well.

Cheers,
Eze

Quoted 24 lines

Cheers,

Paul

Quoted 20 lines
---
 drivers/staging/media/sunxi/cedrus/Kconfig | 1 -
 1 file changed, 1 deletion(-)
drivers/staging/media/sunxi/cedrus/Kconfig +0 -1
index 17733e9a088f..59b8d1b29865 100644
@@ -3,7 +3,6 @@ config VIDEO_SUNXI_CEDRUS
 	tristate "Allwinner Cedrus VPU driver"
 	depends on VIDEO_DEV && VIDEO_V4L2 && MEDIA_CONTROLLER
 	depends on HAS_DMA
-	depends on OF
 	depends on MEDIA_CONTROLLER_REQUEST_API
 	select SUNXI_SRAM
 	select VIDEOBUF2_DMA_CONTIG
Signature · 1 line
2.26.0.rc2
Signature · 3 lines
Paul Kocialkowski, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com
#4 lore raw

Hello Paul,

Quoted 12 lines · Paul Kocialkowski

Hi Ezequiel,

Quoted 9 lines · Ezequiel Garcia
Quoted 8 lines · Paul Kocialkowski

Hi Ezequiel,

Quoted 2 lines · Ezequiel Garcia

The driver is perfectly capable of being built without CONFIG_OF. Remove this dependency, which is useful for compile-only tests.

Thanks for the patch!

Quoted 9 lines
Quoted 6 lines
Quoted 2 lines

Alas, the driver won't do anything useful without OF enabled, so it seems useful to keep that dependency.

I'm not convinced about this argument, I like to have dependencies on things the driver needs to compile (except the machine option, see below).

Is there a general kernel-wide policy about that?

I don't think there is.

Quoted 5 lines

I must admit that I never really understood if Kconfig depends are supposed to strictly reflect build dependencies or dependencies that must reasonably be expected for the driver to be useful. The arch dependency (which is farily common) seems to suggest the latter.

Indeed, it's a good point. Just forget this patch :-)

As a note, some drivers use something like (ARCH_FOO && OF) || COMPILE_TEST to allow compile testing in the absence of OF support, if that's something that you care for.

I do think the ARCH_SUNXI dependency makes sense.

Thanks,
Ezequiel