Skip to content

Commit

Permalink
xtensa: iss/network: provide release() callback
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Max Filippov committed Jul 14, 2022
1 parent 0391334 commit 8864fb8
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions arch/xtensa/platforms/iss/network.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);

Expand Down

0 comments on commit 8864fb8

Please sign in to comment.