]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
phy: eswin: Fix incorrect error check in probe()
authorYulin Lu <luyulin@eswincomputing.com>
Mon, 13 Apr 2026 07:00:33 +0000 (15:00 +0800)
committerVinod Koul <vkoul@kernel.org>
Sun, 10 May 2026 11:53:41 +0000 (17:23 +0530)
devm_ioremap() returns NULL on failure, not an ERR_PTR.
Using IS_ERR() to check the return value is incorrect.

Fix this by checking for NULL and returning -ENOMEM.

Fixes: 67ee9ccaa34a ("phy: eswin: Create eswin directory and add EIC7700 SATA PHY driver")
Reported-by: Dan Carpenter <error27@gmail.com>
Closes: https://lore.kernel.org/linux-phy/adjNbuWoc1B-3Ok1@stanley.mountain/
Signed-off-by: Yulin Lu <luyulin@eswincomputing.com>
Link: https://patch.msgid.link/20260413070033.128-1-luyulin@eswincomputing.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/phy/eswin/phy-eic7700-sata.c

index c33653d48daaf2826f7921f9f4550a5a8c8d097b..76774b9e391b1f9b0f151ae741cbb1470fe9832b 100644 (file)
@@ -216,8 +216,8 @@ static int eic7700_sata_phy_probe(struct platform_device *pdev)
                return -ENOENT;
 
        regs = devm_ioremap(dev, res->start, resource_size(res));
-       if (IS_ERR(regs))
-               return PTR_ERR(regs);
+       if (!regs)
+               return -ENOMEM;
 
        sata_phy->regmap = devm_regmap_init_mmio
                           (dev, regs, &eic7700_sata_phy_regmap_config);