linux/drivers/media/i2c/ccs
Mauro Carvalho Chehab da3a1858c3 media: i2c: ccs-core: fix pm_runtime_get_sync() usage count
The pm_runtime_get_sync() internally increments the
dev->power.usage_count without decrementing it, even on errors.

There is a bug at ccs_pm_get_init(): when this function returns
an error, the stream is not started, and RPM usage_count
should not be incremented. However, if the calls to
v4l2_ctrl_handler_setup() return errors, it will be kept
incremented.

At ccs_suspend() the best is to replace it by the new
pm_runtime_resume_and_get(), introduced by:
commit dd8088d5a8 ("PM: runtime: Add pm_runtime_resume_and_get to deal with usage counter")
in order to properly decrement the usage counter automatically,
in the case of errors.

Fixes: 96e3a6b92f ("media: smiapp: Avoid maintaining power state information")
Cc: stable@vger.kernel.org
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-05-10 11:36:33 +02:00
..
ccs-core.c media: i2c: ccs-core: fix pm_runtime_get_sync() usage count 2021-05-10 11:36:33 +02:00
ccs-data-defs.h media: ccs: Add CCS static data parser library 2020-12-03 12:27:28 +01:00
ccs-data.c Linux 5.11-rc6 2021-02-01 10:03:45 +01:00
ccs-data.h media: i2c/ccs: fix kernel-doc header issues 2021-04-06 14:32:19 +02:00
ccs-limits.c
ccs-limits.h
ccs-quirk.c media: ccs-pll: Add support for decoupled OP domain calculation 2020-12-07 15:53:34 +01:00
ccs-quirk.h media: i2c/ccs: fix kernel-doc header issues 2021-04-06 14:32:19 +02:00
ccs-reg-access.c media: ccs: Switch from standard integer types to kernel ones 2021-01-12 17:56:00 +01:00
ccs-reg-access.h media: ccs: Add support for manufacturer regs from sensor and module files 2020-12-03 12:27:32 +01:00
ccs-regs.h
ccs.h media: ccs: Switch from standard integer types to kernel ones 2021-01-12 17:56:00 +01:00
Kconfig media: smiapp-pll: Rename as ccs-pll 2020-12-03 12:27:31 +01:00
Makefile media: ccs: Add CCS static data parser library 2020-12-03 12:27:28 +01:00
smiapp-reg-defs.h media: ccs: Add support for old-style SMIA digital gain 2021-01-12 17:24:07 +01:00