lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <31567588.rB9VrggOb6@wuerfel>
Date:	Sun, 24 Apr 2016 00:20:24 +0200
From:	Arnd Bergmann <arnd@...db.de>
To:	Michael Heimpold <mhei@...mpold.de>
Cc:	Jonathan Cameron <jic23@...nel.org>,
	"Andrew F . Davis" <afd@...com>, Mark Brown <broonie@...nel.org>,
	netdev@...r.kernel.org, devicetree@...r.kernel.org,
	Rob Herring <robh+dt@...nel.org>,
	Pawel Moll <pawel.moll@....com>,
	Mark Rutland <mark.rutland@....com>,
	Ian Campbell <ijc+devicetree@...lion.org.uk>,
	Kumar Gala <galak@...eaurora.org>,
	Claudio Lanconelli <lanconelli.claudio@...ar.com>
Subject: Re: [PATCH net-next 2/2] net: ethernet: enc28j60: add device tree support

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ