[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <d66e6af7-7384-41aa-76a7-7017f27d43cb@loongson.cn>
Date: Tue, 22 Jun 2021 10:10:26 +0800
From: zhangqing <zhangqing@...ngson.cn>
To: Andrew Lunn <andrew@...n.ch>
Cc: Giuseppe Cavallaro <peppe.cavallaro@...com>,
Alexandre Torgue <alexandre.torgue@...s.st.com>,
Jose Abreu <joabreu@...opsys.com>,
Maxime Coquelin <mcoquelin.stm32@...il.com>,
"David S . Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>,
Thomas Bogendoerfer <tsbogend@...ha.franken.de>,
Rob Herring <robh+dt@...nel.org>,
Huacai Chen <chenhc@...ote.com>, linux-mips@...r.kernel.org,
linux-kernel@...r.kernel.org, devicetree@...r.kernel.org,
netdev@...r.kernel.org, Jiaxun Yang <jiaxun.yang@...goat.com>
Subject: Re: [PATCH 1/4] stmmac: pci: Add dwmac support for Loongson
On 06/21/2021 10:55 AM, Andrew Lunn wrote:
>> +static int loongson_dwmac_probe(struct pci_dev *pdev, const struct pci_device_id *id)
>> +{
>> + struct plat_stmmacenet_data *plat;
>> + struct stmmac_resources res;
>> + int ret, i, mdio;
>> + struct device_node *np;
>> +
>> + np = dev_of_node(&pdev->dev);
>> +
>> + if (!np) {
>> + pr_info("dwmac_loongson_pci: No OF node\n");
>> + return -ENODEV;
>> + }
>> +
>> + if (!of_device_is_compatible(np, "loongson, pci-gmac")) {
>> + pr_info("dwmac_loongson_pci: Incompatible OF node\n");
>> + return -ENODEV;
>> + }
>> +
>> + plat = devm_kzalloc(&pdev->dev, sizeof(*plat), GFP_KERNEL);
>> + if (!plat)
>> + return -ENOMEM;
>> +
>> + if (plat->mdio_node) {
>> + dev_err(&pdev->dev, "Found MDIO subnode\n");
> It is an error is an MDIO node is found?
Hi,Andrew
Thanks for your advice,
Using dev_ DEG () is appropriate,
and other issues I will fix in v2.
Thanks,
-Qing
>
>> + mdio = true;
>> + }
>> +
> ...
>
>> +
>> + plat->phy_interface = device_get_phy_mode(&pdev->dev);
>> + if (plat->phy_interface < 0)
>> + dev_err(&pdev->dev, "phy_mode not found\n");
>> +
>> + plat->interface = PHY_INTERFACE_MODE_GMII;
> Seems odd you call device_get_phy_mode() but then have this hard coded
> PHY_INTERFACE_MODE_GMII?
>
> Andrew
Powered by blists - more mailing lists