usb: vhci-hcd: Switch to dev_err_probe() in probe path

Replace pr_err() calls in vhci_hcd_probe() with dev_err_probe(), to
simplify error handling a bit and improve consistency.

Acked-by: Shuah Khan <skhan@linuxfoundation.org>
Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
Link: https://lore.kernel.org/r/20251008-vhci-hcd-cleanup-v2-1-b6acc4dd6e44@collabora.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Cristian Ciocaltea 2025-10-08 19:54:26 +03:00 committed by Greg Kroah-Hartman
parent 082c8dc13a
commit e361b2bf54

View File

@ -1372,10 +1372,9 @@ static int vhci_hcd_probe(struct platform_device *pdev)
* Our private data is also allocated automatically.
*/
hcd_hs = usb_create_hcd(&vhci_hc_driver, &pdev->dev, dev_name(&pdev->dev));
if (!hcd_hs) {
pr_err("create primary hcd failed\n");
return -ENOMEM;
}
if (!hcd_hs)
return dev_err_probe(&pdev->dev, -ENOMEM, "create primary hcd failed\n");
hcd_hs->has_tt = 1;
/*
@ -1383,22 +1382,21 @@ static int vhci_hcd_probe(struct platform_device *pdev)
* Call the driver's reset() and start() routines.
*/
ret = usb_add_hcd(hcd_hs, 0, 0);
if (ret != 0) {
pr_err("usb_add_hcd hs failed %d\n", ret);
if (ret) {
dev_err_probe(&pdev->dev, ret, "usb_add_hcd hs failed\n");
goto put_usb2_hcd;
}
hcd_ss = usb_create_shared_hcd(&vhci_hc_driver, &pdev->dev,
dev_name(&pdev->dev), hcd_hs);
if (!hcd_ss) {
ret = -ENOMEM;
pr_err("create shared hcd failed\n");
ret = dev_err_probe(&pdev->dev, -ENOMEM, "create shared hcd failed\n");
goto remove_usb2_hcd;
}
ret = usb_add_hcd(hcd_ss, 0, 0);
if (ret) {
pr_err("usb_add_hcd ss failed %d\n", ret);
dev_err_probe(&pdev->dev, ret, "usb_add_hcd ss failed\n");
goto put_usb3_hcd;
}