Skip to content

Commit c0e38ea

Browse files
Srinivas-Kandagatlagregkh
authored andcommitted
slimbus: ngd: set correct device for pm
For some reason we ended up using wrong device in some places for pm_runtime calls. Fix this so that NGG driver can do runtime pm correctly. Fixes: 917809e ("slimbus: ngd: Add qcom SLIMBus NGD driver") Cc: <[email protected]> Signed-off-by: Srinivas Kandagatla <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent a263c1f commit c0e38ea

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

drivers/slimbus/qcom-ngd-ctrl.c

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -618,7 +618,7 @@ static void qcom_slim_ngd_rx(struct qcom_slim_ngd_ctrl *ctrl, u8 *buf)
618618
(mc == SLIM_USR_MC_GENERIC_ACK &&
619619
mt == SLIM_MSG_MT_SRC_REFERRED_USER)) {
620620
slim_msg_response(&ctrl->ctrl, &buf[4], buf[3], len - 4);
621-
pm_runtime_mark_last_busy(ctrl->dev);
621+
pm_runtime_mark_last_busy(ctrl->ctrl.dev);
622622
}
623623
}
624624

@@ -1257,13 +1257,14 @@ static int qcom_slim_ngd_enable(struct qcom_slim_ngd_ctrl *ctrl, bool enable)
12571257
}
12581258
/* controller state should be in sync with framework state */
12591259
complete(&ctrl->qmi.qmi_comp);
1260-
if (!pm_runtime_enabled(ctrl->dev) ||
1261-
!pm_runtime_suspended(ctrl->dev))
1262-
qcom_slim_ngd_runtime_resume(ctrl->dev);
1260+
if (!pm_runtime_enabled(ctrl->ctrl.dev) ||
1261+
!pm_runtime_suspended(ctrl->ctrl.dev))
1262+
qcom_slim_ngd_runtime_resume(ctrl->ctrl.dev);
12631263
else
1264-
pm_runtime_resume(ctrl->dev);
1265-
pm_runtime_mark_last_busy(ctrl->dev);
1266-
pm_runtime_put(ctrl->dev);
1264+
pm_runtime_resume(ctrl->ctrl.dev);
1265+
1266+
pm_runtime_mark_last_busy(ctrl->ctrl.dev);
1267+
pm_runtime_put(ctrl->ctrl.dev);
12671268

12681269
ret = slim_register_controller(&ctrl->ctrl);
12691270
if (ret) {
@@ -1389,7 +1390,7 @@ static int qcom_slim_ngd_ssr_pdr_notify(struct qcom_slim_ngd_ctrl *ctrl,
13891390
/* Make sure the last dma xfer is finished */
13901391
mutex_lock(&ctrl->tx_lock);
13911392
if (ctrl->state != QCOM_SLIM_NGD_CTRL_DOWN) {
1392-
pm_runtime_get_noresume(ctrl->dev);
1393+
pm_runtime_get_noresume(ctrl->ctrl.dev);
13931394
ctrl->state = QCOM_SLIM_NGD_CTRL_DOWN;
13941395
qcom_slim_ngd_down(ctrl);
13951396
qcom_slim_ngd_exit_dma(ctrl);

0 commit comments

Comments
 (0)