xtensa: iss/network: provide release() callback
[ Upstream commit 8864fb8359682912ee99235db7db916733a1fd7b ] 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> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:

committed by
Greg Kroah-Hartman

parent
2fe0b06c16
commit
fb4c1555f9
@@ -502,6 +502,15 @@ static const struct net_device_ops iss_netdev_ops = {
|
|||||||
.ndo_set_rx_mode = iss_net_set_multicast_list,
|
.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)
|
static int iss_net_configure(int index, char *init)
|
||||||
{
|
{
|
||||||
struct net_device *dev;
|
struct net_device *dev;
|
||||||
@@ -558,6 +567,7 @@ static int iss_net_configure(int index, char *init)
|
|||||||
|
|
||||||
lp->pdev.id = index;
|
lp->pdev.id = index;
|
||||||
lp->pdev.name = DRIVER_NAME;
|
lp->pdev.name = DRIVER_NAME;
|
||||||
|
lp->pdev.dev.release = iss_net_pdev_release;
|
||||||
platform_device_register(&lp->pdev);
|
platform_device_register(&lp->pdev);
|
||||||
SET_NETDEV_DEV(dev, &lp->pdev.dev);
|
SET_NETDEV_DEV(dev, &lp->pdev.dev);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user