]> asedeno.scripts.mit.edu Git - linux.git/commit
net: mvpp2: debugfs: Store debugfs entries data in mvpp2 struct
authorMaxime Chevallier <maxime.chevallier@bootlin.com>
Wed, 27 Mar 2019 08:44:11 +0000 (09:44 +0100)
committerDavid S. Miller <davem@davemloft.net>
Wed, 27 Mar 2019 18:10:57 +0000 (11:10 -0700)
commit7cb5e368591a2100a9c079b926991d093b76e1bb
tree078fb5c7690062c67003ff07bc9ba6cbbe224de0
parent0b27f8650f20714c49b797da278a4bb86843209c
net: mvpp2: debugfs: Store debugfs entries data in mvpp2 struct

The current way to store the required private data needed to access
various debugfs entries is to alloc them on the fly, share them within
the entries that need to access them, and finally have one entry free
that data upon closing. This leads to hard to maintain code, and is very
error-prone.

This commit stores all debugfs related data in the same place, making
sure this is allocated only when the debugfs directory is successfully
created, so that we don't waste memory when we don't use this feature.

Signed-off-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/marvell/mvpp2/mvpp2.h
drivers/net/ethernet/marvell/mvpp2/mvpp2_debugfs.c