diff options
author | Fabrice Gasnier <fabrice.gasnier@foss.st.com> | 2023-04-12 18:17:34 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2023-04-20 11:04:47 +0200 |
commit | 511b74e7c0b8ecd78b8175f5ee84dc0b6e014c19 (patch) | |
tree | deaf2e592822d0a8dfe91db46304c4c6453647c3 /drivers/usb | |
parent | dac3b192107b978198e89ec0f77375738352e0c8 (diff) |
usb: typec: ucsi: don't print PPM init deferred errors
ucsi_init() may be deferred as usb_role_sw may be deferred in
ucsi_register_port(). This results in several PPM init failed (-517)
messages maybe printed several times upon boot, like on stm32mp135f-dk
board, until the role_switch driver gets probed.
[ 19.880945] dwc2 49000000.usb: supply vusb_d not found, using dummy regulator
[ 19.887136] dwc2 49000000.usb: supply vusb_a not found, using dummy regulator
[ 19.975432] ucsi-stm32g0-i2c 0-0053: PPM init failed (-517)
[ 20.155746] dwc2 49000000.usb: EPs: 9, dedicated fifos, 952 entries in SPRAM
[ 20.175429] ucsi-stm32g0-i2c 0-0053: PPM init failed (-517)
[ 20.184242] dwc2 49000000.usb: DWC OTG Controller
Adopt dev_err_probe() instead of dev_err(), to only print other errors.
Also print an error in case the wait count has expired.
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Fabrice Gasnier <fabrice.gasnier@foss.st.com>
Link: https://lore.kernel.org/r/20230412161734.3425090-1-fabrice.gasnier@foss.st.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/typec/ucsi/ucsi.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/usb/typec/ucsi/ucsi.c b/drivers/usb/typec/ucsi/ucsi.c index 8d1baf28df55..2b472ec01dc4 100644 --- a/drivers/usb/typec/ucsi/ucsi.c +++ b/drivers/usb/typec/ucsi/ucsi.c @@ -1444,11 +1444,13 @@ static void ucsi_init_work(struct work_struct *work) ret = ucsi_init(ucsi); if (ret) - dev_err(ucsi->dev, "PPM init failed (%d)\n", ret); + dev_err_probe(ucsi->dev, ret, "PPM init failed\n"); if (ret == -EPROBE_DEFER) { - if (ucsi->work_count++ > UCSI_ROLE_SWITCH_WAIT_COUNT) + if (ucsi->work_count++ > UCSI_ROLE_SWITCH_WAIT_COUNT) { + dev_err(ucsi->dev, "PPM init failed, stop trying\n"); return; + } queue_delayed_work(system_long_wq, &ucsi->work, UCSI_ROLE_SWITCH_INTERVAL); |