[PATCH v3 3/3] net: stmmac: dwmac-nuvoton: Add dwmac glue for Nuvoton MA35 family
Krzysztof Kozlowski
krzk at kernel.org
Tue Nov 26 21:10:42 AEDT 2024
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
More information about the openbmc
mailing list