Skip to contentSkip to conversation

net: bcmgenet: Drop ACPI_PTR() to avoid compiler warning

PATCH Superseded Andy Shevchenko 2 participants 5 messages Apr 20, 2020

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 net: bcmgenet: Drop ACPI_PTR() to avoid compiler warning

When compiled with CONFIG_ACPI=n, ACPI_PTR() will be no-op, and thus genet_acpi_match table defined, but not used. Compiler is not happy about such data. Drop ACPI_PTR() for good.

---
 drivers/net/ethernet/broadcom/genet/bcmgenet.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/broadcom/genet/bcmgenet.c +1 -1
index d975338bf78df..9f2f0e6816568 100644
@@ -3740,7 +3740,7 @@ static struct platform_driver bcmgenet_driver = {
 		.name	= "bcmgenet",
 		.of_match_table = bcmgenet_match,
 		.pm	= &bcmgenet_pm_ops,
-		.acpi_match_table = ACPI_PTR(genet_acpi_match),
+		.acpi_match_table = genet_acpi_match,
 	},
 };
 module_platform_driver(bcmgenet_driver);
Signature · 1 line
2.26.1
#1 lore raw

PATCH 2/2 net: bcmgenet: Drop useless OF code

There is nothing which needs a set of OF headers, followed by redundant OF node ID check. Drop them for good.

---
 drivers/net/ethernet/broadcom/genet/bcmgenet.c | 13 -------------
 1 file changed, 13 deletions(-)
drivers/net/ethernet/broadcom/genet/bcmgenet.c +0 -13
index 9f2f0e6816568..ef275db018f73 100644
@@ -23,11 +23,6 @@
 #include <linux/dma-mapping.h>
 #include <linux/pm.h>
 #include <linux/clk.h>
-#include <linux/of.h>
-#include <linux/of_address.h>
-#include <linux/of_irq.h>
-#include <linux/of_net.h>
-#include <linux/of_platform.h>
 #include <net/arp.h>
 
 #include <linux/mii.h>
@@ -3417,8 +3412,6 @@ MODULE_DEVICE_TABLE(of, bcmgenet_match);
 static int bcmgenet_probe(struct platform_device *pdev)
 {
 	struct bcmgenet_platform_data *pd = pdev->dev.platform_data;
-	struct device_node *dn = pdev->dev.of_node;
-	const struct of_device_id *of_id = NULL;
 	const struct bcmgenet_plat_data *pdata;
 	struct bcmgenet_priv *priv;
 	struct net_device *dev;
@@ -3433,12 +3426,6 @@ static int bcmgenet_probe(struct platform_device *pdev)
 		return -ENOMEM;
 	}
 
-	if (dn) {
-		of_id = of_match_node(bcmgenet_match, dn);
-		if (!of_id)
-			return -EINVAL;
-	}
-
 	priv = netdev_priv(dev);
 	priv->irq0 = platform_get_irq(pdev, 0);
 	if (priv->irq0 < 0) {
Signature · 1 line
2.26.1
Acked-by on v1 2/2
#2 lore raw

Re: [PATCH v1 2/2] net: bcmgenet: Drop useless OF code

In reply to Andy Shevchenko
Quoted 2 lines · Andy Shevchenko

There is nothing which needs a set of OF headers, followed by redundant OF node ID check. Drop them for good.

After commit 99c6b06a37d4cab118c45448fef9d28df62d35d8 ("net: bcmgenet: Initial bcmgenet ACPI support") yes, this is true.

Quoted 2 lines
Signature · 1 line
Florian
#4 lore raw
In reply to Florian Fainelli
Quoted 10 lines · Florian Fainelli
Quoted 5 lines · Andy Shevchenko

When compiled with CONFIG_ACPI=n, ACPI_PTR() will be no-op, and thus genet_acpi_match table defined, but not used. Compiler is not happy about such data. Drop ACPI_PTR() for good.

Thank you!

Please, do not apply this, I will combine all patches together in a series. I have more because of that ACPI enabling work.

Signature · 2 lines
With Best Regards,
Andy Shevchenko