Commit e361b2bf authored by Cristian Ciocaltea's avatar Cristian Ciocaltea Committed by Greg Kroah-Hartman
Browse files

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: default avatarShuah Khan <skhan@linuxfoundation.org>
Signed-off-by: default avatarCristian Ciocaltea <cristian.ciocaltea@collabora.com>
Link: https://lore.kernel.org/r/20251008-vhci-hcd-cleanup-v2-1-b6acc4dd6e44@collabora.com


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 082c8dc1
Loading
Loading
Loading
Loading
+7 −9
Original line number Diff line number Diff line
@@ -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;
	}