OSDN Git Service

net: mvneta: remove data pointer usage from device_node structure
authorGregory CLEMENT <gregory.clement@bootlin.com>
Wed, 18 Jul 2018 16:10:52 +0000 (18:10 +0200)
committerDavid S. Miller <davem@davemloft.net>
Sun, 29 Jul 2018 05:12:55 +0000 (22:12 -0700)
commit965cbbec7f207fef969d268fdabbcb779ec294ab
tree88ff14d888bcfc46c8ab6eb1e3c5aa22c67957e2
parent8466baf788ec3e18836bd9c91ba0b1a07af25878
net: mvneta: remove data pointer usage from device_node structure

On year ago Rob Herring wanted to remove the data pointer from the
device_node structure[1]. The mvneta driver seemed to be the only one
which used (abused ?) it. However, the proposal of Rob to remove this
pointer from the driver introduced a regression, and I tested and fixed an
alternative way, but it was never submitted as a proper patch.

Now here it is: Instead of using the device_node structure ->data
pointer, we store the BM private data as the driver data of the BM
platform_device. The core mvneta code can retrieve it by doing a lookup
on which platform_device corresponds to the BM device tree node using
of_find_device_by_node(), and get its driver data

[1]https://www.spinics.net/lists/netdev/msg445197.html

Signed-off-by: Gregory CLEMENT <gregory.clement@bootlin.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/marvell/mvneta.c
drivers/net/ethernet/marvell/mvneta_bm.c
drivers/net/ethernet/marvell/mvneta_bm.h