Skip to content

Commit 723d346

Browse files
lweiss-fairphoneandersson
authored andcommitted
soc: qcom: pmic_glink_altmode: Print return value on error
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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Bjorn Andersson <[email protected]>
1 parent d79a27e commit 723d346

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

drivers/soc/qcom/pmic_glink_altmode.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -160,15 +160,15 @@ static void pmic_glink_altmode_enable_dp(struct pmic_glink_altmode *altmode,
160160

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

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

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

174174
static void pmic_glink_altmode_enable_usb(struct pmic_glink_altmode *altmode,
@@ -182,15 +182,15 @@ static void pmic_glink_altmode_enable_usb(struct pmic_glink_altmode *altmode,
182182

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

187187
port->retimer_state.alt = NULL;
188188
port->retimer_state.data = NULL;
189189
port->retimer_state.mode = TYPEC_STATE_USB;
190190

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

196196
static void pmic_glink_altmode_safe(struct pmic_glink_altmode *altmode,
@@ -204,15 +204,15 @@ static void pmic_glink_altmode_safe(struct pmic_glink_altmode *altmode,
204204

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

209209
port->retimer_state.alt = NULL;
210210
port->retimer_state.data = NULL;
211211
port->retimer_state.mode = TYPEC_STATE_SAFE;
212212

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

218218
static void pmic_glink_altmode_worker(struct work_struct *work)
@@ -397,7 +397,7 @@ static void pmic_glink_altmode_enable_worker(struct work_struct *work)
397397

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

403403
static void pmic_glink_altmode_pdr_notify(void *priv, int state)

0 commit comments

Comments
 (0)