net: pcs: lynx: add lynx_pcs_create_mdiodev()
authorRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
Fri, 26 May 2023 10:14:39 +0000 (11:14 +0100)
committerJakub Kicinski <kuba@kernel.org>
Tue, 30 May 2023 04:46:53 +0000 (21:46 -0700)
commit86b5f2d8cd7828c881036d30ce3a4e711a071726
treea8f9cd183b17fd3a4d01004c6eaf272318ebac0f
parent727e373f897d06214ffc59f820a356a5bc458789
net: pcs: lynx: add lynx_pcs_create_mdiodev()

Add lynx_pcs_create_mdiodev() to simplify the creation of the mdio
device associated with lynx PCS. In order to allow lynx_pcs_destroy()
to clean this up, we need to arrange for lynx_pcs_create() to take a
refcount on the mdiodev, and lynx_pcs_destroy() to put it.

Adding the refcounting to lynx_pcs_create()..lynx_pcs_destroy() will
be transparent to existing users of these interfaces.

Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Tested-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/pcs/pcs-lynx.c
include/linux/pcs-lynx.h