i2c: qcom-geni: Simplify PM resume error handling
Subsystems (3)
Mukesh Kumar Savaliya
maintainerPATCH 1/1 i2c: qcom-geni: Simplify PM resume error handling
The driver currently logs pm_runtime_resume_and_get() failures with dev_err() and returns the error code separately.
Replace this with dev_err_probe(), which combines the dev_err() log message and the return value propagation into a single call, consistent with how all other error paths in this driver already report failures.
No functional change intended.
--- drivers/i2c/busses/i2c-qcom-geni.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/i2c/busses/i2c-qcom-geni.c +2 -4
@@ -994,10 +994,8 @@ static int geni_i2c_init(struct geni_i2c_dev *gi2c)int ret; ret =pm_runtime_resume_and_get (gi2c->se.dev); -if (ret <0 ) { -dev_err (gi2c->se.dev,"error turning on device :%d\n" , ret); -return ret; - } +if (ret <0 ) +return dev_err_probe (gi2c->se.dev, ret,"error turning on device\n" ); proto =geni_se_read_proto (&gi2c->se);if (proto ==GENI_SE_INVALID_PROTO ) {
Signature · 1 line
2.43.0
Hi Mukesh
Quoted 19 lines · Mukesh Kumar Savaliya
The driver currently logs
pm_runtime_resume_and_get()failures withdev_err()and returns the error code separately.Replace this with
dev_err_probe(), which combines thedev_err()log message and the return value propagation into a single call, consistent with how all other error paths in this driver already report failures.No functional change intended.
Signed-off-by Mukesh Kumar Savaliya <[email protected]>--- drivers/i2c/busses/i2c-qcom-geni.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)drivers/i2c/busses/i2c-qcom-geni.c +0
-0
drivers/i2c/busses/i2c-qcom-geni.c static int geni_i2c_init(struct geni_i2c_dev *gi2c) · line 998
Quoted 9 lines
drivers/i2c/busses/i2c-qcom-geni.c +2
-4@@ -994,10 +994,8 @@ static int geni_i2c_init(struct geni_i2c_dev *gi2c)int ret; ret =pm_runtime_resume_and_get (gi2c->se.dev); -if (ret <0 ) { -dev_err (gi2c->se.dev,"error turning on device :%d\n" , ret); -return ret; - } +if (ret <0 ) +return dev_err_probe (gi2c->se.dev, ret,"error turning on device\n" );
This change is not required, as this API will be used in the deep sleep use case to reinitialise the SE.
Thanks,
Praveen Talari
Quoted 3 lines
drivers/i2c/busses/i2c-qcom-geni.c +0
-0proto =geni_se_read_proto (&gi2c->se);if (proto ==GENI_SE_INVALID_PROTO ) {
Mukesh Savaliya
maintainerThanks Praveen for the review !
Quoted 17 lines · Praveen Talari
Hi Mukesh
Quoted 14 lines · Mukesh Kumar Savaliya
The driver currently logs
pm_runtime_resume_and_get()failures withdev_err()and returns the error code separately.Replace this with
dev_err_probe(), which combines thedev_err()log message and the return value propagation into a single call, consistent with how all other error paths in this driver already report failures.No functional change intended.
Signed-off-by Mukesh Kumar Savaliya <[email protected]>---
drivers/i2c/busses/i2c-qcom-geni.c| 6 ++----1 file changed, 2 insertions(+), 4 deletions(-)
Quoted 17 lines
Quoted 5 lines
drivers/i2c/busses/i2c-qcom-geni.c +0
-0drivers/i2c/busses/i2c-qcom-geni.c static int geni_i2c_init(struct geni_i2c_dev *gi2c) · line 998
Quoted 9 lines
drivers/i2c/busses/i2c-qcom-geni.c +2
-4@@ -994,10 +994,8 @@ static int geni_i2c_init(struct geni_i2c_dev *gi2c) int ret; ret = pm_runtime_resume_and_get(gi2c->se.dev); - if (ret < 0) { - dev_err(gi2c->se.dev, "error turning on device :%d\n", ret); - return ret; - } + if (ret < 0) + return dev_err_probe(gi2c->se.dev, ret, "error turning on device\n");This change is not required, as this API will be used in the deep sleep use case to reinitialise the SE.
I think this change is generic and does not appear to introduce any new functionality. Its more like a cleanup or modernization that aligns the PM handling with the pattern already used in the drivers probe path.
What exactly is getting broken during deep sleep with this change ? Could you elaborate on the specific suspend/resume issue that is getting disturbed ?
Quoted 3 lines
Quoted 3 lines
drivers/i2c/busses/i2c-qcom-geni.c +0
-0proto = geni_se_read_proto(&gi2c->se); if (proto == GENI_SE_INVALID_PROTO) {
Quoted 21 lines · Mukesh Kumar Savaliya
The driver currently logs
pm_runtime_resume_and_get()failures withdev_err()and returns the error code separately.Replace this with
dev_err_probe(), which combines thedev_err()log message and the return value propagation into a single call, consistent with how all other error paths in this driver already report failures.No functional change intended.
Signed-off-by Mukesh Kumar Savaliya <[email protected]>--- drivers/i2c/busses/i2c-qcom-geni.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)drivers/i2c/busses/i2c-qcom-geni.c +0
-0@@ -994,10 +994,8 @@ static int geni_i2c_init(struct geni_i2c_dev *gi2c)int ret;
drivers/i2c/busses/i2c-qcom-geni.c static int geni_i2c_init(struct geni_i2c_dev *gi2c) · line 1001
Quoted 10 lines
drivers/i2c/busses/i2c-qcom-geni.c +2
-4ret =pm_runtime_resume_and_get (gi2c->se.dev); -if (ret <0 ) { -dev_err (gi2c->se.dev,"error turning on device :%d\n" , ret); -return ret; - } +if (ret <0 ) +return dev_err_probe (gi2c->se.dev, ret,"error turning on device\n" ); proto =geni_se_read_proto (&gi2c->se);if (proto ==GENI_SE_INVALID_PROTO ) {
Quoted 21 lines · Mukesh Kumar Savaliya
The driver currently logs
pm_runtime_resume_and_get()failures withdev_err()and returns the error code separately.Replace this with
dev_err_probe(), which combines thedev_err()log message and the return value propagation into a single call, consistent with how all other error paths in this driver already report failures.No functional change intended.
Signed-off-by Mukesh Kumar Savaliya <[email protected]>--- drivers/i2c/busses/i2c-qcom-geni.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)drivers/i2c/busses/i2c-qcom-geni.c +0
-0@@ -994,10 +994,8 @@ static int geni_i2c_init(struct geni_i2c_dev *gi2c)int ret;
drivers/i2c/busses/i2c-qcom-geni.c static int geni_i2c_init(struct geni_i2c_dev *gi2c) · line 1001
Quoted 10 lines
drivers/i2c/busses/i2c-qcom-geni.c +2
-4ret =pm_runtime_resume_and_get (gi2c->se.dev); -if (ret <0 ) { -dev_err (gi2c->se.dev,"error turning on device :%d\n" , ret); -return ret; - } +if (ret <0 ) +return dev_err_probe (gi2c->se.dev, ret,"error turning on device\n" ); proto =geni_se_read_proto (&gi2c->se);if (proto ==GENI_SE_INVALID_PROTO ) {
Hi Mukesh,
Quoted 10 lines · Mukesh Kumar Savaliya
The driver currently logs
pm_runtime_resume_and_get()failures withdev_err()and returns the error code separately.Replace this with
dev_err_probe(), which combines thedev_err()log message and the return value propagation into a single call, consistent with how all other error paths in this driver already report failures.No functional change intended.
Signed-off-by Mukesh Kumar Savaliya <[email protected]>
merged to i2c/i2c.
Thanks,
Andi