Skip to content

Commit

Permalink
soc: qcom: pmic_glink_altmode: Print return value on error
Browse files Browse the repository at this point in the history
It can be useful to know with which return value for example the
typec_retimer_set call failed, so include this info in the dev_err
prints.

Signed-off-by: Luca Weiss <luca.weiss@fairphone.com>
Link: https://lore.kernel.org/r/20231017-glink-altmode-ret-v2-1-921aa7cfc381@fairphone.com
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
  • Loading branch information
Luca Weiss authored and Bjorn Andersson committed Oct 22, 2023
1 parent d79a27e commit 723d346
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions drivers/soc/qcom/pmic_glink_altmode.c
Original file line number Diff line number Diff line change
Expand Up @@ -160,15 +160,15 @@ static void pmic_glink_altmode_enable_dp(struct pmic_glink_altmode *altmode,

ret = typec_mux_set(port->typec_mux, &port->state);
if (ret)
dev_err(altmode->dev, "failed to switch mux to DP\n");
dev_err(altmode->dev, "failed to switch mux to DP: %d\n", ret);

port->retimer_state.alt = &port->dp_alt;
port->retimer_state.data = &dp_data;
port->retimer_state.mode = TYPEC_MODAL_STATE(mode);

ret = typec_retimer_set(port->typec_retimer, &port->retimer_state);
if (ret)
dev_err(altmode->dev, "failed to setup retimer to DP\n");
dev_err(altmode->dev, "failed to setup retimer to DP: %d\n", ret);
}

static void pmic_glink_altmode_enable_usb(struct pmic_glink_altmode *altmode,
Expand All @@ -182,15 +182,15 @@ static void pmic_glink_altmode_enable_usb(struct pmic_glink_altmode *altmode,

ret = typec_mux_set(port->typec_mux, &port->state);
if (ret)
dev_err(altmode->dev, "failed to switch mux to USB\n");
dev_err(altmode->dev, "failed to switch mux to USB: %d\n", ret);

port->retimer_state.alt = NULL;
port->retimer_state.data = NULL;
port->retimer_state.mode = TYPEC_STATE_USB;

ret = typec_retimer_set(port->typec_retimer, &port->retimer_state);
if (ret)
dev_err(altmode->dev, "failed to setup retimer to USB\n");
dev_err(altmode->dev, "failed to setup retimer to USB: %d\n", ret);
}

static void pmic_glink_altmode_safe(struct pmic_glink_altmode *altmode,
Expand All @@ -204,15 +204,15 @@ static void pmic_glink_altmode_safe(struct pmic_glink_altmode *altmode,

ret = typec_mux_set(port->typec_mux, &port->state);
if (ret)
dev_err(altmode->dev, "failed to switch mux to safe mode\n");
dev_err(altmode->dev, "failed to switch mux to safe mode: %d\n", ret);

port->retimer_state.alt = NULL;
port->retimer_state.data = NULL;
port->retimer_state.mode = TYPEC_STATE_SAFE;

ret = typec_retimer_set(port->typec_retimer, &port->retimer_state);
if (ret)
dev_err(altmode->dev, "failed to setup retimer to USB\n");
dev_err(altmode->dev, "failed to setup retimer to USB: %d\n", ret);
}

static void pmic_glink_altmode_worker(struct work_struct *work)
Expand Down Expand Up @@ -397,7 +397,7 @@ static void pmic_glink_altmode_enable_worker(struct work_struct *work)

ret = pmic_glink_altmode_request(altmode, ALTMODE_PAN_EN, 0);
if (ret)
dev_err(altmode->dev, "failed to request altmode notifications\n");
dev_err(altmode->dev, "failed to request altmode notifications: %d\n", ret);
}

static void pmic_glink_altmode_pdr_notify(void *priv, int state)
Expand Down

0 comments on commit 723d346

Please sign in to comment.