[PATCH] usb: xhci-mvebu: use dev_err() instead of printf()

Bruno Banelli <[email protected]>
Newsgroups gmane.comp.boot-loaders.u-boot.general,gmane.comp.boot-loaders.u-boot
Message-ID <[email protected]>
Print the VBUS regulator failure with dev_err() so that the message
carries the device name and honours the log level, as
drivers/usb/host/ehci-generic.c already does.

Add the <dm/device_compat.h> include that dev_err() needs; <dm.h> does
not pull it in.

No functional change intended.

Suggested-by: Marek Vasut <[email protected]>
Signed-off-by: Bruno Banelli <[email protected]>
---
 drivers/usb/host/xhci-mvebu.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/usb/host/xhci-mvebu.c b/drivers/usb/host/xhci-mvebu.c
index f932acf848..dbac71842a 100644
--- a/drivers/usb/host/xhci-mvebu.c
+++ b/drivers/usb/host/xhci-mvebu.c
@@ -9,6 +9,7 @@
 #include <fdtdec.h>
 #include <log.h>
 #include <usb.h>
+#include <dm/device_compat.h>
 #include <power/regulator.h>
 #include <asm/gpio.h>
 
@@ -53,7 +54,7 @@ static int xhci_usb_probe(struct udevice *dev)
 	if (!ret) {
 		ret = regulator_set_enable_if_allowed(regulator, true);
 		if (ret && ret != -ENOSYS) {
-			printf("Failed to turn ON the VBUS regulator\n");
+			dev_err(dev, "Failed to turn ON the VBUS regulator\n");
 			return ret;
 		}
 	}
-- 
2.43.0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.