diff options
Diffstat (limited to 'drivers/net/ieee802154/fakelb.c')
| -rw-r--r-- | drivers/net/ieee802154/fakelb.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/net/ieee802154/fakelb.c b/drivers/net/ieee802154/fakelb.c index e7456fcd091..27d83207d24 100644 --- a/drivers/net/ieee802154/fakelb.c +++ b/drivers/net/ieee802154/fakelb.c @@ -26,6 +26,7 @@ #include <linux/timer.h> #include <linux/platform_device.h> #include <linux/netdevice.h> +#include <linux/device.h> #include <linux/spinlock.h> #include <net/mac802154.h> #include <net/wpan-phy.h> @@ -221,14 +222,15 @@ static void fakelb_del(struct fakelb_dev_priv *priv) ieee802154_free_device(priv->dev); } -static int __devinit fakelb_probe(struct platform_device *pdev) +static int fakelb_probe(struct platform_device *pdev) { struct fakelb_priv *priv; struct fakelb_dev_priv *dp; int err = -ENOMEM; int i; - priv = kzalloc(sizeof(struct fakelb_priv), GFP_KERNEL); + priv = devm_kzalloc(&pdev->dev, sizeof(struct fakelb_priv), + GFP_KERNEL); if (!priv) goto err_alloc; @@ -248,19 +250,17 @@ static int __devinit fakelb_probe(struct platform_device *pdev) err_slave: list_for_each_entry(dp, &priv->list, list) fakelb_del(dp); - kfree(priv); err_alloc: return err; } -static int __devexit fakelb_remove(struct platform_device *pdev) +static int fakelb_remove(struct platform_device *pdev) { struct fakelb_priv *priv = platform_get_drvdata(pdev); struct fakelb_dev_priv *dp, *temp; list_for_each_entry_safe(dp, temp, &priv->list, list) fakelb_del(dp); - kfree(priv); return 0; } @@ -269,7 +269,7 @@ static struct platform_device *ieee802154fake_dev; static struct platform_driver ieee802154fake_driver = { .probe = fakelb_probe, - .remove = __devexit_p(fakelb_remove), + .remove = fakelb_remove, .driver = { .name = "ieee802154fakelb", .owner = THIS_MODULE, |
