]> asedeno.scripts.mit.edu Git - linux.git/commit
media: staging: media: imx7-mipi-csis: fix debugfs compilation
authorArnd Bergmann <arnd@arndb.de>
Wed, 13 Mar 2019 21:17:32 +0000 (17:17 -0400)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Fri, 29 Mar 2019 11:38:26 +0000 (07:38 -0400)
commitfc1209602959ffc022432b527fae54b48bf0623a
tree2fc103d41032a7dd3db5ce2157174b0419062156
parent2980c03e1f09a4ba36cb0d818a6a203213e98868
media: staging: media: imx7-mipi-csis: fix debugfs compilation

When CONFIG_DEBUGFS is enabled, we get a warning about an
incorrect section annotation that can lead to undefined
behavior:

WARNING: vmlinux.o(.text+0xd3c7c4): Section mismatch in reference from the function mipi_csis_probe() to the function .init.text:mipi_csis_debugfs_init()
The function mipi_csis_probe() references
the function __init mipi_csis_debugfs_init().
This is often because mipi_csis_probe lacks a __init
annotation or the annotation of mipi_csis_debugfs_init is wrong.

The same function for an unknown reason has a different
version for !CONFIG_DEBUGFS, which does not have this problem,
but behaves the same way otherwise (it does nothing when debugfs
is disabled).
Consolidate the two versions, using the correct section from
one version, and the implementation from the other.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Rui Miguel Silva <rmfrfs@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
drivers/staging/media/imx/imx7-mipi-csis.c