Thread (43 messages) 43 messages, 7 authors, 2023-08-03

Re: [PATCH v2 07/10] net: stmmac: dwmac-loongson: Add LS7A support

From: Feiyang Chen <hidden>
Date: 2023-07-28 02:00:49
Also in: loongarch

On Thu, Jul 27, 2023 at 6:35 PM Andrew Lunn [off-list ref] wrote:
quoted
+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.
Hi, Andrew,

OK.

Thanks,
Feiyang
        Andrew
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help