From: Arnd Bergmann <arnd@arndb.de>
To: Michael Heimpold <mhei@heimpold.de>
Cc: Jonathan Cameron <jic23@kernel.org>,
"Andrew F . Davis" <afd@ti.com>, Mark Brown <broonie@kernel.org>,
netdev@vger.kernel.org, devicetree@vger.kernel.org,
Rob Herring <robh+dt@kernel.org>, Pawel Moll <pawel.moll@arm.com>,
Mark Rutland <mark.rutland@arm.com>,
Ian Campbell <ijc+devicetree@hellion.org.uk>,
Kumar Gala <galak@codeaurora.org>,
Claudio Lanconelli <lanconelli.claudio@eptar.com>
Subject: Re: [PATCH net-next 2/2] net: ethernet: enc28j60: add device tree support
Date: Sun, 24 Apr 2016 00:20:24 +0200 [thread overview]
Message-ID: <31567588.rB9VrggOb6@wuerfel> (raw)
In-Reply-To: <1461447800-11381-3-git-send-email-mhei@heimpold.de>
On Saturday 23 April 2016 23:43:20 Michael Heimpold wrote:
> diff --git a/drivers/net/ethernet/microchip/enc28j60.c b/drivers/net/ethernet/microchip/enc28j60.c
> index b723622..49635d7 100644
> --- a/drivers/net/ethernet/microchip/enc28j60.c
> +++ b/drivers/net/ethernet/microchip/enc28j60.c
> @@ -1634,9 +1634,20 @@ static int enc28j60_remove(struct spi_device *spi)
> return 0;
> }
>
> +#ifdef CONFIG_OF
> +static const struct of_device_id enc28j60_dt_ids[] = {
> + { .compatible = "microchip,enc28j60" },
> + { /* sentinel */ }
> +};
> +MODULE_DEVICE_TABLE(of, enc28j60_dt_ids);
> +#else
> +#define enc28j60_dt_ids NULL
> +#endif
> +
> static struct spi_driver enc28j60_driver = {
> .driver = {
> - .name = DRV_NAME,
> + .name = DRV_NAME,
> + .of_match_table = enc28j60_dt_ids,
> },
> .probe = enc28j60_probe,
> .remove = enc28j60_remove,
> --
>
You probably also want to add support for calling of_get_mac_address()
here, to allow giving the device a fixed address from the boot loader.
I think you can drop the #ifdef and just define the device table
unconditionally.
Arnd
next prev parent reply other threads:[~2016-04-23 22:20 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1461447800-11381-1-git-send-email-mhei@heimpold.de>
2016-04-23 21:43 ` [PATCH net-next 2/2] net: ethernet: enc28j60: add device tree support Michael Heimpold
2016-04-23 22:20 ` Arnd Bergmann [this message]
2016-04-24 21:28 ` [PATCH v2 net-next] " Michael Heimpold
2016-04-25 13:23 ` Rob Herring
2016-04-25 18:41 ` Michael Heimpold
[not found] ` <1461533283-24852-1-git-send-email-mhei-Z/Lg1yOAjpkb1SvskN2V4Q@public.gmane.org>
2016-04-25 15:39 ` Andrew F. Davis
2016-04-25 17:46 ` Michael Heimpold
2016-04-25 18:04 ` Andrew F. Davis
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=31567588.rB9VrggOb6@wuerfel \
--to=arnd@arndb.de \
--cc=afd@ti.com \
--cc=broonie@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=galak@codeaurora.org \
--cc=ijc+devicetree@hellion.org.uk \
--cc=jic23@kernel.org \
--cc=lanconelli.claudio@eptar.com \
--cc=mark.rutland@arm.com \
--cc=mhei@heimpold.de \
--cc=netdev@vger.kernel.org \
--cc=pawel.moll@arm.com \
--cc=robh+dt@kernel.org \
/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