From: Jeremy Linton <jeremy.linton@arm.com>
To: davem@davemloft.net
Cc: nico@fluxnic.net, robert.jarzmik@free.fr,
felipe.balbi@linux.intel.com, fw@strlen.de, arnd@arndb.de,
steve.capper@arm.com, netdev@vger.kernel.org
Subject: [PATCH v2] net: smc91x: ACPI Enable lan91x adapters
Date: Mon, 11 Jul 2016 10:28:40 -0500 [thread overview]
Message-ID: <1468250920-29814-1-git-send-email-jeremy.linton@arm.com> (raw)
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 | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/smsc/smc91x.c b/drivers/net/ethernet/smsc/smc91x.c
index 18ac52d..726b80f 100644
--- a/drivers/net/ethernet/smsc/smc91x.c
+++ b/drivers/net/ethernet/smsc/smc91x.c
@@ -2195,6 +2195,12 @@ static void smc_release_datacs(struct platform_device *pdev, struct net_device *
}
}
+static const struct acpi_device_id smc91x_acpi_match[] = {
+ { "LNRO0003", 0 },
+ { }
+};
+MODULE_DEVICE_TABLE(acpi, smc91x_acpi_match);
+
#if IS_BUILTIN(CONFIG_OF)
static const struct of_device_id smc91x_match[] = {
{ .compatible = "smsc,lan91c94", },
@@ -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))
@@ -2478,7 +2484,8 @@ static struct platform_driver smc_driver = {
.driver = {
.name = CARDNAME,
.pm = &smc_drv_pm_ops,
- .of_match_table = of_match_ptr(smc91x_match),
+ .of_match_table = of_match_ptr(smc91x_match),
+ .acpi_match_table = smc91x_acpi_match,
},
};
--
2.5.5
next reply other threads:[~2016-07-11 15:28 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-11 15:28 Jeremy Linton [this message]
2016-07-11 20:50 ` [PATCH v2] net: smc91x: ACPI Enable lan91x adapters David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1468250920-29814-1-git-send-email-jeremy.linton@arm.com \
--to=jeremy.linton@arm.com \
--cc=arnd@arndb.de \
--cc=davem@davemloft.net \
--cc=felipe.balbi@linux.intel.com \
--cc=fw@strlen.de \
--cc=netdev@vger.kernel.org \
--cc=nico@fluxnic.net \
--cc=robert.jarzmik@free.fr \
--cc=steve.capper@arm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).