summaryrefslogtreecommitdiff
path: root/arch/xtensa
diff options
context:
space:
mode:
authorMax Filippov <jcmvbkbc@gmail.com>2022-07-07 00:23:16 -0700
committerMax Filippov <jcmvbkbc@gmail.com>2022-07-14 00:54:31 -0700
commit8864fb8359682912ee99235db7db916733a1fd7b (patch)
tree9dbdc10176d92f943638c0c0d40bf58f830cdc8d /arch/xtensa
parent0391334907937f841f23e77d0e1c0a2eb26c15d5 (diff)
xtensa: iss/network: provide release() callback
Provide release() callback for the platform device embedded into struct iss_net_private and registered in the iss_net_configure so that platform_device_unregister could be called for it. Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Diffstat (limited to 'arch/xtensa')
-rw-r--r--arch/xtensa/platforms/iss/network.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/arch/xtensa/platforms/iss/network.c b/arch/xtensa/platforms/iss/network.c
index 2d566231688f..2a22e80a488d 100644
--- a/arch/xtensa/platforms/iss/network.c
+++ b/arch/xtensa/platforms/iss/network.c
@@ -466,6 +466,15 @@ static const struct net_device_ops iss_netdev_ops = {
.ndo_set_rx_mode = iss_net_set_multicast_list,
};
+static void iss_net_pdev_release(struct device *dev)
+{
+ struct platform_device *pdev = to_platform_device(dev);
+ struct iss_net_private *lp =
+ container_of(pdev, struct iss_net_private, pdev);
+
+ free_netdev(lp->dev);
+}
+
static int iss_net_configure(int index, char *init)
{
struct net_device *dev;
@@ -516,6 +525,7 @@ static int iss_net_configure(int index, char *init)
lp->pdev.id = index;
lp->pdev.name = DRIVER_NAME;
+ lp->pdev.dev.release = iss_net_pdev_release;
platform_device_register(&lp->pdev);
SET_NETDEV_DEV(dev, &lp->pdev.dev);