media: i2c: ccs: Set the device's runtime PM status correctly in remove
commite046045830upstream. Set the device's runtime PM status to suspended in device removal only if it wasn't suspended already. Fixes:9447082ae6("[media] smiapp: Implement power-on and power-off sequences without runtime PM") Cc: stable@vger.kernel.org # for >= v5.15 Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
457a61c598
commit
5a6b5aa8eb
@@ -3677,9 +3677,10 @@ static int ccs_remove(struct i2c_client *client)
|
||||
v4l2_async_unregister_subdev(subdev);
|
||||
|
||||
pm_runtime_disable(&client->dev);
|
||||
if (!pm_runtime_status_suspended(&client->dev))
|
||||
if (!pm_runtime_status_suspended(&client->dev)) {
|
||||
ccs_power_off(&client->dev);
|
||||
pm_runtime_set_suspended(&client->dev);
|
||||
pm_runtime_set_suspended(&client->dev);
|
||||
}
|
||||
|
||||
for (i = 0; i < sensor->ssds_used; i++) {
|
||||
v4l2_device_unregister_subdev(&sensor->ssds[i].sd);
|
||||
|
||||
Reference in New Issue
Block a user