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]
Date:	Mon, 14 Jul 2014 11:06:28 +0200
From:	Tobias Klauser <tklauser@...tanz.ch>
To:	Mollie Wu <mollie.wu@...aro.org>
Cc:	linux-arm-kernel@...ts.infradead.org, devicetree@...r.kernel.org,
	netdev@...r.kernel.org, andy.green@...aro.org, patches@...aro.org,
	jaswinder.singh@...aro.org, linux@....linux.org.uk, arnd@...db.de,
	olof@...om.net, mark.rutland@....com, robh+dt@...nel.org,
	pawel.moll@....com, davem@...emloft.net,
	stephen@...workplumber.org, f.fainelli@...il.com,
	romieu@...zoreil.com,
	Tetsuya Takinishi <t.takinishi@...fujitsu.com>
Subject: Re: [PATCH 6/8] net: ethernet driver: Fujitsu OGMA

On 2014-07-13 at 08:31:47 +0200, Mollie Wu <mollie.wu@...aro.org> wrote:
> This driver adds support for "ogma", a Fujitsu Semiconductor Ltd IP Gigabit
> Ethernet + PHY IP used in a variety of their ARM-based ASICs.
> 
> This is being sent as part of a series including the arch support that uses it,
> Fujitsu mb86s7x.
> 
> This driver was originally written by guys inside Fujitsu as an abstracted
> "you can build this for Windows as well" type code, I've removed all that,
> modernized various things, added runtime_pm, and ported it to work with
> Device Tree, using only the bindings already mentioned in
> 
> ./Documentation/devicetree/bindings/net/ethernet.txt
> 
> Bindings documentation is added by this patch.
> 
> Signed-off-by: Andy Green <andy.green@...aro.org>
> Signed-off-by: Tetsuya Takinishi <t.takinishi@...fujitsu.com>
> Signed-off-by: Mollie Wu <mollie.wu@...aro.org>
> ---
>  .../devicetree/bindings/net/fujitsu-ogma.txt       |  43 ++
>  drivers/net/ethernet/fujitsu/Kconfig               |  12 +
>  drivers/net/ethernet/fujitsu/Makefile              |   1 +
>  drivers/net/ethernet/fujitsu/ogma/Makefile         |   6 +
>  drivers/net/ethernet/fujitsu/ogma/ogma.h           | 380 +++++++++++++
>  .../ethernet/fujitsu/ogma/ogma_desc_ring_access.c  | 627 +++++++++++++++++++++
>  drivers/net/ethernet/fujitsu/ogma/ogma_ethtool.c   |  95 ++++
>  .../net/ethernet/fujitsu/ogma/ogma_gmac_access.c   | 295 ++++++++++
>  drivers/net/ethernet/fujitsu/ogma/ogma_netdev.c    | 592 +++++++++++++++++++
>  drivers/net/ethernet/fujitsu/ogma/ogma_platform.c  | 333 +++++++++++
>  10 files changed, 2384 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/net/fujitsu-ogma.txt
>  create mode 100644 drivers/net/ethernet/fujitsu/ogma/Makefile
>  create mode 100644 drivers/net/ethernet/fujitsu/ogma/ogma.h
>  create mode 100644 drivers/net/ethernet/fujitsu/ogma/ogma_desc_ring_access.c
>  create mode 100644 drivers/net/ethernet/fujitsu/ogma/ogma_ethtool.c
>  create mode 100644 drivers/net/ethernet/fujitsu/ogma/ogma_gmac_access.c
>  create mode 100644 drivers/net/ethernet/fujitsu/ogma/ogma_netdev.c
>  create mode 100644 drivers/net/ethernet/fujitsu/ogma/ogma_platform.c

[...]

> diff --git a/drivers/net/ethernet/fujitsu/ogma/ogma_platform.c b/drivers/net/ethernet/fujitsu/ogma/ogma_platform.c
> new file mode 100644
> index 0000000..09071da
> --- /dev/null
> +++ b/drivers/net/ethernet/fujitsu/ogma/ogma_platform.c

[...]

> +#ifdef CONFIG_PM
> +static const struct dev_pm_ops ogma_pm_ops = {
> +	SET_SYSTEM_SLEEP_PM_OPS(ogma_pm_suspend, ogma_pm_resume)
> +	SET_RUNTIME_PM_OPS(ogma_runtime_suspend, ogma_runtime_resume, NULL)
> +};
> +#endif

#ifdef CONFIG_PM can be omitted here since
SET_{SYSTEM_SLEEP,RUNTIME}_PM_OPS will just evaluate empty if CONFIG_PM
is not defined.

> +
> +static const struct of_device_id ogma_dt_ids[] = {
> +	{.compatible = "fujitsu,ogma"},
> +	{ /* sentinel */ }
> +};
> +
> +MODULE_DEVICE_TABLE(of, ogma_dt_ids);
> +
> +static struct platform_driver ogma_driver = {
> +	.probe = ogma_probe,
> +	.remove = ogma_remove,
> +	.driver = {
> +		.name = "ogma",
> +		.of_match_table = ogma_dt_ids,
> +#ifdef CONFIG_PM
> +		.pm = &ogma_pm_ops,
> +#endif

With the above #ifdef CONFIG_PM removed, ogma_pm_ops will be all NULL if
CONFIG_PM is not set. Thus, the #ifdef can be removed as well.

> +		},
> +};
> +
> +module_platform_driver(ogma_driver);
> +
> +MODULE_AUTHOR("Fujitsu Semiconductor Ltd");
> +MODULE_DESCRIPTION("OGMA Ethernet driver");
> +MODULE_LICENSE("GPL");
> +
> +MODULE_ALIAS("platform:ogma");
> -- 
> 1.8.1.2
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ