]> git.baikalelectronics.ru Git - kernel.git/commit
media: imx: imx-mipi-csis: Protect mipi_csis_dump_regs()
authorJacopo Mondi <jacopo@jmondi.org>
Mon, 14 Mar 2022 10:39:41 +0000 (10:39 +0000)
committerMauro Carvalho Chehab <mchehab@kernel.org>
Sun, 24 Apr 2022 08:06:41 +0000 (09:06 +0100)
commit84b6ea279d606ca12ce9070b302145c32a6667aa
treefe3d96360e51f943b6702d4a70ee44793fe595e0
parentaa9e7eb3bfc08e3ad8d9a925c71e1cbdfe1fd0e4
media: imx: imx-mipi-csis: Protect mipi_csis_dump_regs()

The mipi_csis_dump_regs() function accesses the interface registers
in order to printout their values for debug purposes.

As the function access the registers, it requires the interface to be
powered up. Currently this is only enforced in one of the function's
callers (mipi_csis_log_status)() but not when the function is called by
the debugfs attribute handler.

Make sure to access registers only if the interface is powered up and
remove the same check from the caller.

Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
Acked-by: Rui Miguel Silva <rmfrfs@gmail.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
drivers/media/platform/nxp/imx-mipi-csis.c