* [PATCH] net: smc91x: ACPI Enable lan91x adapters
@ 2016-06-24 13:16 Jeremy Linton
2016-06-26 9:15 ` Robert Jarzmik
0 siblings, 1 reply; 2+ messages in thread
From: Jeremy Linton @ 2016-06-24 13:16 UTC (permalink / raw)
To: netdev; +Cc: nico, davem, robert.jarzmik, fw, felipe.balbi, arnd, ahs3
Enable lan91x adapters in some ARM machines and models
when booted with an ACPI kernel.
Signed-off-by: Jeremy Linton <jeremy.linton@arm.com>
---
drivers/net/ethernet/smsc/smc91x.c | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/smsc/smc91x.c b/drivers/net/ethernet/smsc/smc91x.c
index 18ac52d..fcf69f9 100644
--- a/drivers/net/ethernet/smsc/smc91x.c
+++ b/drivers/net/ethernet/smsc/smc91x.c
@@ -2203,6 +2203,12 @@ static const struct of_device_id smc91x_match[] = {
};
MODULE_DEVICE_TABLE(of, smc91x_match);
+static const struct acpi_device_id smsc91x_acpi_match[] = {
+ { "LNRO0003", 0 },
+ { }
+};
+MODULE_DEVICE_TABLE(acpi, smsc91x_acpi_match);
+
/**
* of_try_set_control_gpio - configure a gpio if it exists
*/
@@ -2274,7 +2280,6 @@ static int smc_drv_probe(struct platform_device *pdev)
#if IS_BUILTIN(CONFIG_OF)
match = of_match_device(of_match_ptr(smc91x_match), &pdev->dev);
if (match) {
- struct device_node *np = pdev->dev.of_node;
u32 val;
/* Optional pwrdwn GPIO configured? */
@@ -2300,7 +2305,8 @@ static int smc_drv_probe(struct platform_device *pdev)
usleep_range(750, 1000);
/* Combination of IO widths supported, default to 16-bit */
- if (!of_property_read_u32(np, "reg-io-width", &val)) {
+ if (!device_property_read_u32(&pdev->dev, "reg-io-width",
+ &val)) {
if (val & 1)
lp->cfg.flags |= SMC91X_USE_8BIT;
if ((val == 0) || (val & 2))
@@ -2479,6 +2485,7 @@ static struct platform_driver smc_driver = {
.name = CARDNAME,
.pm = &smc_drv_pm_ops,
.of_match_table = of_match_ptr(smc91x_match),
+ .acpi_match_table = smsc91x_acpi_match,
},
};
--
2.5.5
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] net: smc91x: ACPI Enable lan91x adapters
2016-06-24 13:16 [PATCH] net: smc91x: ACPI Enable lan91x adapters Jeremy Linton
@ 2016-06-26 9:15 ` Robert Jarzmik
0 siblings, 0 replies; 2+ messages in thread
From: Robert Jarzmik @ 2016-06-26 9:15 UTC (permalink / raw)
To: Jeremy Linton; +Cc: netdev, nico, davem, fw, felipe.balbi, arnd, ahs3
Jeremy Linton <jeremy.linton@arm.com> writes:
> Enable lan91x adapters in some ARM machines and models
> when booted with an ACPI kernel.
>
> Signed-off-by: Jeremy Linton <jeremy.linton@arm.com>
Hi Jeremy,
I launched your change in my Jenkins yesterday (on Linus's mainline, not
linux-next), and I got:
CC drivers/net/ethernet/smsc/smc91x.o
drivers/net/ethernet/smsc/smc91x.c:2488:23: error: 'smsc91x_acpi_match' undeclared here (not in a function)
.acpi_match_table = smsc91x_acpi_match,
This platform build is _not_ for an device tree platform,
ie. CONFIG_OF=n. You'll have to move some around it seems.
Cheers.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-06-26 9:15 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-24 13:16 [PATCH] net: smc91x: ACPI Enable lan91x adapters Jeremy Linton
2016-06-26 9:15 ` Robert Jarzmik
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).