[PATCH v3 3/3] net: stmmac: dwmac-nuvoton: Add dwmac glue for Nuvoton MA35 family
Joey Lu
a0987203069 at gmail.com
Wed Nov 27 19:03:36 AEDT 2024
Krzysztof Kozlowski 於 11/26/2024 6:10 PM 寫道:
> 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
I will use dev_err_probe instead.
>
>> + return ERR_PTR(-ENODEV);
>> + }
>> + if (macid > 1) {
>> + dev_err(dev, "Invalid sys arguments\n");
>> + return ERR_PTR(-EINVAL);
>> + }
>> +
>
>
> ...
>
I will use dev_err_probe instead.
>> +
>> + 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.
Got it.
>
>> + device_set_wakeup_capable(&pdev->dev, 1);
>> +
>> + return 0;
>> +}
>
>
> Best regards,
> Krzysztof
Thanks!
BR,
Joey
More information about the openbmc
mailing list