Skip to contentSkip to conversation

v4l2-pci-skeleton: Only build if PCI is available

PATCH In review Mark Brown 2 participants 7 messages Aug 26, 2014 – Aug 27, 2014

Subsystems (2)
lore
Share & tools
lore

Mark Brown

author
#0 lore raw

PATCH 1/1 v4l2-pci-skeleton: Only build if PCI is available

From: Mark Brown <[email protected]>

Currently arm64 does not support PCI but it does support v4l2. Since the PCI skeleton driver is built unconditionally as a module with no dependency on PCI this causes build failures for arm64 allmodconfig. Fix this by defining a symbol VIDEO_PCI_SKELETON for the skeleton and conditionalising the build on that.

---

The patch adding the Makefile was added to the Documentation tree, either it should be reverted or something like this added on top.

 Documentation/video4linux/Makefile | 2 +-
 drivers/media/v4l2-core/Kconfig    | 7 +++++++
 2 files changed, 8 insertions(+), 1 deletion(-)
Documentation/video4linux/Makefile +1 -1
index d58101e788fc..65a351d75c95 100644
@@ -1 +1 @@
-obj-m := v4l2-pci-skeleton.o
+obj-$(CONFIG_VIDEO_PCI_SKELETON) := v4l2-pci-skeleton.o
drivers/media/v4l2-core/Kconfig +7 -0
index 9ca0f8d59a14..2b368f711c9e 100644
@@ -25,6 +25,13 @@ config VIDEO_FIXED_MINOR_RANGES
 
 	  When in doubt, say N.
 
+config VIDEO_PCI_SKELETON
+	tristate "Skeleton PCI V4L2 driver"
+	depends on PCI && COMPILE_TEST
+	---help---
+	  Enable build of the skeleton PCI driver, used as a reference
+	  when developign new drivers.
+
 # Used by drivers that need tuner.ko
 config VIDEO_TUNER
 	tristate
Signature · 1 line
2.1.0.rc1
reviewer
#1 lore raw
Quoted 7 lines · Mark Brown

From: Mark Brown <[email protected]>

Currently arm64 does not support PCI but it does support v4l2. Since the PCI skeleton driver is built unconditionally as a module with no dependency on PCI this causes build failures for arm64 allmodconfig. Fix this by defining a symbol VIDEO_PCI_SKELETON for the skeleton and conditionalising the build on that.

Looks good. Applied. Thanks.

I'm pretty sure that it also needs "depends on VIDEOBUF2_CORE" or something in that family. I'll check that and add it.

Quoted 36 lines

---

The patch adding the Makefile was added to the Documentation tree, either it should be reverted or something like this added on top.

 Documentation/video4linux/Makefile | 2 +-
 drivers/media/v4l2-core/Kconfig    | 7 +++++++
 2 files changed, 8 insertions(+), 1 deletion(-)
Documentation/video4linux/Makefile +1 -1
index d58101e788fc..65a351d75c95 100644
@@ -1 +1 @@
-obj-m := v4l2-pci-skeleton.o
+obj-$(CONFIG_VIDEO_PCI_SKELETON) := v4l2-pci-skeleton.o
drivers/media/v4l2-core/Kconfig +7 -0
index 9ca0f8d59a14..2b368f711c9e 100644
@@ -25,6 +25,13 @@ config VIDEO_FIXED_MINOR_RANGES
 
 	  When in doubt, say N.
 
+config VIDEO_PCI_SKELETON
+	tristate "Skeleton PCI V4L2 driver"
+	depends on PCI && COMPILE_TEST
+	---help---
+	  Enable build of the skeleton PCI driver, used as a reference
+	  when developign new drivers.
+
 # Used by drivers that need tuner.ko
 config VIDEO_TUNER
 	tristate
Signature · 1 line
~Randy
reviewer
#2 lore raw
In reply to Mark Brown
Quoted 30 lines · Mark Brown

From: Mark Brown <[email protected]>

Currently arm64 does not support PCI but it does support v4l2. Since the PCI skeleton driver is built unconditionally as a module with no dependency on PCI this causes build failures for arm64 allmodconfig. Fix this by defining a symbol VIDEO_PCI_SKELETON for the skeleton and conditionalising the build on that.

---

The patch adding the Makefile was added to the Documentation tree, either it should be reverted or something like this added on top.

 Documentation/video4linux/Makefile | 2 +-
 drivers/media/v4l2-core/Kconfig    | 7 +++++++
 2 files changed, 8 insertions(+), 1 deletion(-)
Documentation/video4linux/Makefile +1 -1
index d58101e788fc..65a351d75c95 100644
@@ -1 +1 @@
-obj-m := v4l2-pci-skeleton.o
+obj-$(CONFIG_VIDEO_PCI_SKELETON) := v4l2-pci-skeleton.o
drivers/media/v4l2-core/Kconfig +0 -0
index 9ca0f8d59a14..2b368f711c9e 100644

drivers/media/v4l2-core/Kconfig config VIDEO_FIXED_MINOR_RANGES · line 30

Quoted 6 lines
drivers/media/v4l2-core/Kconfig +3 -0
@@ -25,6 +25,13 @@ config VIDEO_FIXED_MINOR_RANGES
 
 	  When in doubt, say N.
 
+config VIDEO_PCI_SKELETON
+	tristate "Skeleton PCI V4L2 driver"
+	depends on PCI && COMPILE_TEST
	               && ??  No, don't require COMPILE_TEST.
		However, PCI || COMPILE_TEST would allow it to build on arm64
		if COMPILE_TEST is enabled, guaranteeing build errors.
		Is that what should happen?  I suppose so...
Quoted 8 lines
drivers/media/v4l2-core/Kconfig +4 -0
+	---help---
+	  Enable build of the skeleton PCI driver, used as a reference
+	  when developign new drivers.
+
 # Used by drivers that need tuner.ko
 config VIDEO_TUNER
 	tristate
Signature · 1 line
~Randy
author
#3 lore raw
Quoted 10 lines · Randy Dunlap
Quoted 7 lines · Mark Brown

index d58101e788fc..65a351d75c95 100644

Documentation/video4linux/Makefile +1 -1
@@ -1 +1 @@
-obj-m := v4l2-pci-skeleton.o
+obj-$(CONFIG_VIDEO_PCI_SKELETON) := v4l2-pci-skeleton.o
drivers/media/v4l2-core/Kconfig +0 -0
Quoted 5 lines

drivers/media/v4l2-core/Kconfig config VIDEO_FIXED_MINOR_RANGES · line 30

Quoted 3 lines
drivers/media/v4l2-core/Kconfig +3 -0
+config VIDEO_PCI_SKELETON
+	tristate "Skeleton PCI V4L2 driver"
+	depends on PCI && COMPILE_TEST
	               && ??  No, don't require COMPILE_TEST.

That's a very deliberate choice. There's no reason I can see to build this code other than to check that it builds, it's reference code rather than something that someone is expected to actually use in their system. This seems like a perfect candidate for COMPILE_TEST.

Quoted 3 lines

However, PCI || COMPILE_TEST would allow it to build on arm64 if COMPILE_TEST is enabled, guaranteeing build errors. Is that what should happen? I suppose so...

No, it's not - if it's going to depend on COMPILE_TEST at all it need to be a hard dependency.

reviewer
#4 lore raw
Quoted 22 lines · Mark Brown
Quoted 10 lines · Randy Dunlap
Quoted 7 lines · Mark Brown

index d58101e788fc..65a351d75c95 100644

Documentation/video4linux/Makefile +1 -1
@@ -1 +1 @@
-obj-m := v4l2-pci-skeleton.o
+obj-$(CONFIG_VIDEO_PCI_SKELETON) := v4l2-pci-skeleton.o
drivers/media/v4l2-core/Kconfig +0 -0
Quoted 5 lines

drivers/media/v4l2-core/Kconfig config VIDEO_FIXED_MINOR_RANGES · line 30

Quoted 3 lines
drivers/media/v4l2-core/Kconfig +3 -0
+config VIDEO_PCI_SKELETON
+	tristate "Skeleton PCI V4L2 driver"
+	depends on PCI && COMPILE_TEST
	               && ??  No, don't require COMPILE_TEST.

That's a very deliberate choice. There's no reason I can see to build this code other than to check that it builds, it's reference code rather than something that someone is expected to actually use in their system. This seems like a perfect candidate for COMPILE_TEST.

Quoted 6 lines
Quoted 3 lines

However, PCI || COMPILE_TEST would allow it to build on arm64 if COMPILE_TEST is enabled, guaranteeing build errors. Is that what should happen? I suppose so...

No, it's not - if it's going to depend on COMPILE_TEST at all it need to be a hard dependency.

How about just drop COMPILE_TEST? This code only builds if someone enabled BUILD_DOCSRC. That should be enough (along with PCI and some VIDEO kconfig symbols) to qualify it.

Signature · 1 line
~Randy
reviewer
#5 lore raw
Quoted 27 lines · Randy Dunlap
Quoted 26 lines · Mark Brown
Quoted 10 lines · Randy Dunlap
Quoted 7 lines · Mark Brown

index d58101e788fc..65a351d75c95 100644

Documentation/video4linux/Makefile +1 -1
@@ -1 +1 @@
-obj-m := v4l2-pci-skeleton.o
+obj-$(CONFIG_VIDEO_PCI_SKELETON) := v4l2-pci-skeleton.o
drivers/media/v4l2-core/Kconfig +0 -0
Quoted 5 lines

drivers/media/v4l2-core/Kconfig config VIDEO_FIXED_MINOR_RANGES · line 30

Quoted 3 lines
drivers/media/v4l2-core/Kconfig +3 -0
+config VIDEO_PCI_SKELETON
+	tristate "Skeleton PCI V4L2 driver"
+	depends on PCI && COMPILE_TEST
	               && ??  No, don't require COMPILE_TEST.

That's a very deliberate choice. There's no reason I can see to build this code other than to check that it builds, it's reference code rather than something that someone is expected to actually use in their system. This seems like a perfect candidate for COMPILE_TEST.

Quoted 3 lines

However, PCI || COMPILE_TEST would allow it to build on arm64 if COMPILE_TEST is enabled, guaranteeing build errors. Is that what should happen? I suppose so...

Quoted 6 lines
Quoted 2 lines

No, it's not - if it's going to depend on COMPILE_TEST at all it need to be a hard dependency.

How about just drop COMPILE_TEST? This code only builds if someone enabled BUILD_DOCSRC. That should be enough (along with PCI and some VIDEO kconfig symbols) to qualify it.

I'll add BUILD_DOCSRC to the depends list in the Kconfig file...

Signature · 1 line
~Randy
author
#6 lore raw
Quoted 11 lines · Randy Dunlap
Quoted 8 lines · Randy Dunlap
Quoted 2 lines · Mark Brown

No, it's not - if it's going to depend on COMPILE_TEST at all it need to be a hard dependency.

How about just drop COMPILE_TEST? This code only builds if someone enabled BUILD_DOCSRC. That should be enough (along with PCI and some VIDEO kconfig symbols) to qualify it.

I'll add BUILD_DOCSRC to the depends list in the Kconfig file...

OK, that symbol probably does the job - I wasn't aware of it previously.