[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <9add374b-27ba-47c9-95cf-eec896231d58@lunn.ch>
Date: Thu, 27 Jul 2023 12:35:39 +0200
From: Andrew Lunn <andrew@...n.ch>
To: Feiyang Chen <chenfeiyang@...ngson.cn>
Cc: hkallweit1@...il.com, peppe.cavallaro@...com,
alexandre.torgue@...s.st.com, joabreu@...opsys.com,
chenhuacai@...ngson.cn, linux@...linux.org.uk, dongbiao@...ngson.cn,
loongson-kernel@...ts.loongnix.cn, netdev@...r.kernel.org,
loongarch@...ts.linux.dev, chris.chenfeiyang@...il.com
Subject: Re: [PATCH v2 07/10] net: stmmac: dwmac-loongson: Add LS7A support
> +static int loongson_dwmac_probe(struct pci_dev *pdev,
> + const struct pci_device_id *id)
> {
> + int ret, i, bus_id, phy_mode;
> struct plat_stmmacenet_data *plat;
> + struct stmmac_pci_info *info;
> struct stmmac_resources res;
> struct device_node *np;
> - int ret, i, phy_mode;
> -
> - 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;
> - }
There are a lot of changes here, and it is not easy to review. I
would suggest you first do a refactoring patch, moving all handling of
DT into a helper. Since it is just moving code around, it should be
easy to review. Then you can add support for platforms which don't
support DT.
Andrew
Powered by blists - more mailing lists