net: bcmgenet: Drop ACPI_PTR() to avoid compiler warning
Subsystems (3)
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
@@ -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
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
@@ -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
Re: [PATCH v1 2/2] net: bcmgenet: Drop useless OF code
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
Signed-off-by Andy Shevchenko <[email protected]>
Signature · 1 line
Florian
Quoted 5 lines · Andy Shevchenko
When compiled with
CONFIG_ACPI=n,ACPI_PTR()will be no-op, and thusgenet_acpi_matchtable defined, but not used. Compiler is not happy about such data. DropACPI_PTR()for good.Signed-off-by Andy Shevchenko <[email protected]>
Signature · 1 line
Florian
Quoted 10 lines · Florian Fainelli
Quoted 5 lines · Andy Shevchenko
When compiled with
CONFIG_ACPI=n,ACPI_PTR()will be no-op, and thusgenet_acpi_matchtable defined, but not used. Compiler is not happy about such data. DropACPI_PTR()for good.Signed-off-by Andy Shevchenko <[email protected]>Acked-by Florian Fainelli <[email protected]>
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