Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

staging: vchiq: Make creation of vchiq cdev optional

Before this commit, vchiq cdev (/dev/vchiq) was always created during
platform initialization. Introduce a new Kconfig option
CONFIG_VCHIQ_CDEV which determines if the cdev will be created or not.

Reviewed-by: Stefan Wahren <stefan.wahren@i2se.com>
Signed-off-by: Ojaswin Mujoo <ojaswin98@gmail.com>
Link: https://lore.kernel.org/r/846c424dd4aae14d1cc28c8f30877a06e2b7dd10.1626882325.git.ojaswin98@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Ojaswin Mujoo and committed by
Greg Kroah-Hartman
2b5930fb f0591628

+23 -1
+10
drivers/staging/vc04_services/Kconfig
··· 19 19 Defaults to Y when the Broadcom Videocore services 20 20 are included in the build, N otherwise. 21 21 22 + if BCM2835_VCHIQ 23 + 24 + config VCHIQ_CDEV 25 + bool "VCHIQ Character Driver" 26 + help 27 + Enable the creation of VCHIQ character driver to help 28 + communicate with the Videocore platform. 29 + 30 + endif 31 + 22 32 source "drivers/staging/vc04_services/bcm2835-audio/Kconfig" 23 33 24 34 source "drivers/staging/vc04_services/bcm2835-camera/Kconfig"
+4 -1
drivers/staging/vc04_services/Makefile
··· 7 7 interface/vchiq_arm/vchiq_2835_arm.o \ 8 8 interface/vchiq_arm/vchiq_debugfs.o \ 9 9 interface/vchiq_arm/vchiq_connected.o \ 10 - interface/vchiq_arm/vchiq_dev.o \ 10 + 11 + ifdef CONFIG_VCHIQ_CDEV 12 + vchiq-objs += interface/vchiq_arm/vchiq_dev.o 13 + endif 11 14 12 15 obj-$(CONFIG_SND_BCM2835) += bcm2835-audio/ 13 16 obj-$(CONFIG_VIDEO_BCM2835) += bcm2835-camera/
+9
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.h
··· 174 174 extern void 175 175 vchiq_instance_set_trace(struct vchiq_instance *instance, int trace); 176 176 177 + #if IS_ENABLED(CONFIG_VCHIQ_CDEV) 178 + 177 179 extern void 178 180 vchiq_deregister_chrdev(void); 179 181 180 182 extern int 181 183 vchiq_register_chrdev(struct device *parent); 184 + 185 + #else 186 + 187 + static inline void vchiq_deregister_chrdev(void) { } 188 + static inline int vchiq_register_chrdev(struct device *parent) { return 0; } 189 + 190 + #endif /* IS_ENABLED(CONFIG_VCHIQ_CDEV) */ 182 191 183 192 extern enum vchiq_status 184 193 service_callback(enum vchiq_reason reason, struct vchiq_header *header,