sh_eth: Use the platform device for memory allocation
authorLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Thu, 20 Mar 2014 14:00:31 +0000 (15:00 +0100)
committerSimon Horman <horms@verge.net.au>
Fri, 5 Dec 2014 00:21:28 +0000 (09:21 +0900)
commite6715b7f5f6d7bf2f4e89363d446cc433bbb8cbf
tree43730c23362479ab2abb97967f0f8106cfd7cfc7
parente07c17a9c2aed62f509ef4193a3077f740c4411d
sh_eth: Use the platform device for memory allocation

Memory allocated for the MDIO bus with the devm_kzalloc() API is
associated with the network device. While this will cause memory to be
freed at the right time, it doesn't allow allocating memory before the
network device is initialized.

Replace the network device with the parent platform device for memory
allocation to remove that dependency. This also improves consistency
with the other devm_* calls in the driver that all use the platform
device.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit aa8d422510969b705656e49fc0166d862aca9246)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
drivers/net/ethernet/renesas/sh_eth.c