Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

phy: phy-rockchip-inno-usb2: Use dev_err_probe() in the probe path

Improve error handling in the probe path by using function dev_err_probe()
instead of function dev_err(), where appropriate.

Signed-off-by: Dragan Simic <dsimic@manjaro.org>
Reviewed-by: Heiko Stuebner <heiko@sntech.de>
Link: https://lore.kernel.org/r/d4ccd9fc278fb46ea868406bf77811ee507f0e4e.1725524803.git.dsimic@manjaro.org
Signed-off-by: Vinod Koul <vkoul@kernel.org>

authored by

Dragan Simic and committed by
Vinod Koul
40452520 595ad7a3

+10 -17
+10 -17
drivers/phy/rockchip/phy-rockchip-inno-usb2.c
··· 424 424 425 425 if (of_property_read_bool(node, "extcon")) { 426 426 edev = extcon_get_edev_by_phandle(rphy->dev, 0); 427 - if (IS_ERR(edev)) { 428 - if (PTR_ERR(edev) != -EPROBE_DEFER) 429 - dev_err(rphy->dev, "Invalid or missing extcon\n"); 430 - return PTR_ERR(edev); 431 - } 427 + if (IS_ERR(edev)) 428 + return dev_err_probe(rphy->dev, PTR_ERR(edev), 429 + "invalid or missing extcon\n"); 432 430 } else { 433 431 /* Initialize extcon device */ 434 432 edev = devm_extcon_dev_allocate(rphy->dev, ··· 437 439 "failed to allocate extcon device\n"); 438 440 439 441 ret = devm_extcon_dev_register(rphy->dev, edev); 440 - if (ret) { 441 - dev_err(rphy->dev, "failed to register extcon device\n"); 442 - return ret; 443 - } 442 + if (ret) 443 + return dev_err_probe(rphy->dev, ret, 444 + "failed to register extcon device\n"); 444 445 } 445 446 446 447 rphy->edev = edev; ··· 1405 1408 "failed to get phyclk\n"); 1406 1409 1407 1410 ret = rockchip_usb2phy_clk480m_register(rphy); 1408 - if (ret) { 1409 - dev_err(dev, "failed to register 480m output clock\n"); 1410 - return ret; 1411 - } 1411 + if (ret) 1412 + return dev_err_probe(dev, ret, "failed to register 480m output clock\n"); 1412 1413 1413 1414 if (rphy->phy_cfg->phy_tuning) { 1414 1415 ret = rphy->phy_cfg->phy_tuning(rphy); ··· 1426 1431 1427 1432 phy = devm_phy_create(dev, child_np, &rockchip_usb2phy_ops); 1428 1433 if (IS_ERR(phy)) { 1429 - dev_err_probe(dev, PTR_ERR(phy), "failed to create phy\n"); 1430 - ret = PTR_ERR(phy); 1434 + ret = dev_err_probe(dev, PTR_ERR(phy), "failed to create phy\n"); 1431 1435 goto put_child; 1432 1436 } 1433 1437 ··· 1461 1467 "rockchip_usb2phy", 1462 1468 rphy); 1463 1469 if (ret) { 1464 - dev_err(rphy->dev, 1465 - "failed to request usb2phy irq handle\n"); 1470 + dev_err_probe(rphy->dev, ret, "failed to request usb2phy irq handle\n"); 1466 1471 goto put_child; 1467 1472 } 1468 1473 }