summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAhmad Fatoum <a.fatoum@pengutronix.de>2024-02-19 18:21:08 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2024-02-20 08:19:14 +0100
commitecab0d0bc4c9868190ee9d668b666fdea8ac6a9a (patch)
tree0f6b9bde0c179a5c19cbafb81bb9b95d398ff1df
parent3644f6ce5e806ddcd8833d6dedeef4353395730a (diff)
downloadbarebox-ecab0d0bc4c9.tar.gz
barebox-ecab0d0bc4c9.tar.xz
usb: core: replace calls to strerror with %pe format specifier
printf(), and by extension dev_err(), already has built-in support for formatting error codes, so make use of that instead of manual use of strerror(). Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20240219172108.3780861-1-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r--drivers/usb/core/usb.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/usb/core/usb.c b/drivers/usb/core/usb.c
index 62d9f11146..614527fecb 100644
--- a/drivers/usb/core/usb.c
+++ b/drivers/usb/core/usb.c
@@ -477,8 +477,8 @@ int usb_new_device(struct usb_device *dev)
/* we set the default configuration here */
err = usb_set_configuration(dev, dev->config.desc.bConfigurationValue);
if (err) {
- dev_err(&dev->dev, "Setting default configuration failed with: %s\n" \
- "len %d, status %lX\n", strerror(-err),
+ dev_err(&dev->dev, "Setting default configuration failed with: %pe\n" \
+ "len %d, status %lX\n", ERR_PTR(err),
dev->act_len, dev->status);
goto err_out;
}
@@ -502,7 +502,7 @@ int usb_new_device(struct usb_device *dev)
err = register_device(&dev->dev);
if (err) {
- dev_err(&dev->dev, "Failed to register device: %s\n", strerror(-err));
+ dev_err(&dev->dev, "Failed to register device: %pe\n", ERR_PTR(err));
goto err_out;
}