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: Handle failed extcon allocation better

Return the actual error code upon failure to allocate extcon device, instead
of hardcoding -ENOMEM. Use dev_err_probe() to also log appropriate messages,
which is fine because the containing function is used in the probe path.

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

authored by

Dragan Simic and committed by
Vinod Koul
595ad7a3 449d2a52

+2 -1
+2 -1
drivers/phy/rockchip/phy-rockchip-inno-usb2.c
··· 435 435 rockchip_usb2phy_extcon_cable); 436 436 437 437 if (IS_ERR(edev)) 438 - return -ENOMEM; 438 + return dev_err_probe(rphy->dev, PTR_ERR(edev), 439 + "failed to allocate extcon device\n"); 439 440 440 441 ret = devm_extcon_dev_register(rphy->dev, edev); 441 442 if (ret) {