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 dd8088d5a896 ("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: 96e3a6b92f23 ("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
..
2021-04-27 13:42:11 -07:00
2021-05-05 13:24:11 -07:00
2021-04-18 09:36:56 +03:00
2021-05-07 11:35:12 -07:00
2021-04-29 11:57:23 -07:00
2021-04-26 12:11:52 -07:00
2021-05-05 13:24:11 -07:00
2021-05-01 10:14:08 -07:00
2021-05-01 10:14:08 -07:00
2021-05-04 11:24:46 -07:00
2021-04-28 15:59:13 -07:00
2021-04-26 12:11:52 -07:00
2021-05-05 12:39:29 -07:00
2021-05-09 13:42:39 -07:00
2021-04-27 18:09:44 -07:00
2021-04-26 15:03:23 -07:00
2021-05-01 10:14:08 -07:00
2021-04-26 16:32:11 -07:00
2021-05-07 11:35:12 -07:00
2021-05-05 13:24:11 -07:00
2021-05-01 10:14:08 -07:00
2021-04-28 15:59:13 -07:00
2021-05-01 09:33:00 -07:00
2021-04-28 15:56:51 -07:00
2021-04-13 14:50:57 -07:00
2021-05-01 10:14:08 -07:00
2021-04-29 11:57:23 -07:00
2021-05-07 14:49:18 -07:00
2021-05-01 10:14:08 -07:00
2021-05-05 12:53:16 -07:00
2021-04-28 15:59:13 -07:00
2021-05-04 11:13:33 -07:00
2021-05-05 13:24:11 -07:00
2021-05-03 12:15:21 -07:00
2021-05-07 11:35:12 -07:00
2021-05-08 10:44:36 -07:00
2021-05-01 09:33:00 -07:00
2021-04-30 12:48:14 -07:00
2021-05-08 10:44:36 -07:00
2021-04-26 12:11:52 -07:00
2021-04-28 17:22:10 -07:00
2021-05-01 09:33:00 -07:00
2021-05-05 13:31:39 -07:00
2021-04-28 15:59:13 -07:00
2021-05-05 13:31:39 -07:00