[bug report] phy: eswin: Create eswin directory and add EIC7700 SATA PHY driver
Dan Carpenter
error27 at gmail.com
Fri Apr 10 03:14:06 PDT 2026
Hello Yulin Lu,
Commit 67ee9ccaa34a ("phy: eswin: Create eswin directory and add
EIC7700 SATA PHY driver") from Feb 5, 2026 (linux-next), leads to the
following Smatch static checker warning:
drivers/phy/eswin/phy-eic7700-sata.c:219 eic7700_sata_phy_probe()
warn: 'regs' is not an error pointer
drivers/phy/eswin/phy-eic7700-sata.c
194 static int eic7700_sata_phy_probe(struct platform_device *pdev)
195 {
196 struct eic7700_sata_phy *sata_phy;
197 struct phy_provider *phy_provider;
198 struct device *dev = &pdev->dev;
199 struct device_node *np = dev->of_node;
200 struct resource *res;
201 void __iomem *regs;
202
203 sata_phy = devm_kzalloc(dev, sizeof(*sata_phy), GFP_KERNEL);
204 if (!sata_phy)
205 return -ENOMEM;
206
207 /*
208 * Map the I/O resource with platform_get_resource and devm_ioremap
209 * instead of the devm_platform_ioremap_resource API, because the
210 * address region of the SATA-PHY falls into the region of the HSP
211 * clock & reset that has already been obtained by the HSP
212 * clock-and-reset driver.
213 */
214 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
215 if (!res)
216 return -ENOENT;
217
218 regs = devm_ioremap(dev, res->start, resource_size(res));
--> 219 if (IS_ERR(regs))
220 return PTR_ERR(regs);
if (!regs)
return -ENOMEM;
221
222 sata_phy->regmap = devm_regmap_init_mmio
This email is a free service from the Smatch-CI project [smatch.sf.net].
regards,
dan carpenter
More information about the linux-phy
mailing list