On 18/11/2024 09:27, Joey Lu wrote: > + > +static struct nvt_priv_data * > +nuvoton_gmac_setup(struct platform_device *pdev, struct plat_stmmacenet_data *plat) > +{ > + struct device *dev = &pdev->dev; > + struct nvt_priv_data *bsp_priv; > + phy_interface_t phy_mode; > + u32 tx_delay, rx_delay; > + u32 macid, arg, reg; > + > + bsp_priv = devm_kzalloc(dev, sizeof(*bsp_priv), GFP_KERNEL); > + if (!bsp_priv) > + return ERR_PTR(-ENOMEM); > + > + bsp_priv->regmap = > + syscon_regmap_lookup_by_phandle_args(dev->of_node, "nuvoton,sys", 1, &macid); > + if (IS_ERR(bsp_priv->regmap)) { > + dev_err(dev, "Failed to get sys register\n"); Syntax is: return dev_err_probe > + return ERR_PTR(-ENODEV); > + } > + if (macid > 1) { > + dev_err(dev, "Invalid sys arguments\n"); > + return ERR_PTR(-EINVAL); > + } > + ... > + > + ret = stmmac_dvr_probe(&pdev->dev, plat_dat, &stmmac_res); > + if (ret) > + return ret; > + > + /* We support WoL by magic packet, override pmt to make it work! */ > + plat_dat->pmt = 1; > + dev_info(&pdev->dev, "Wake-Up On Lan supported\n"); Drop, driver should be silent on success. > + device_set_wakeup_capable(&pdev->dev, 1); > + > + return 0; > +} Best regards, Krzysztof