i2c: fix missing pm_runtime_put_sync in i2c_device_probe
authorAlain Volmat <alain.volmat@st.com>
Thu, 30 Apr 2020 15:43:21 +0000 (17:43 +0200)
committerWolfram Sang <wsa@kernel.org>
Tue, 5 May 2020 14:27:43 +0000 (16:27 +0200)
commit3c3dd56f760da056e821ac177e3ad0de4209a435
tree82e6479d3c27575bbea994864a8c95b75f3255f6
parent0e698dfa282211e414076f9dc7e83c1c288314fd
i2c: fix missing pm_runtime_put_sync in i2c_device_probe

In case of the I2C client exposes the flag I2C_CLIENT_HOST_NOTIFY,
pm_runtime_get_sync is called in order to always keep active the
adapter. However later on, pm_runtime_put_sync is never called
within the function in case of an error. This commit add this
error handling.

Fixes: 72bfcee11cf8 ("i2c: Prevent runtime suspend of adapter when Host Notify is required")
Signed-off-by: Alain Volmat <alain.volmat@st.com>
Reviewed-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Signed-off-by: Wolfram Sang <wsa@kernel.org>
drivers/i2c/i2c-core-base.c