On Fri, 1 Nov 2013, Christophe Leroy wrote:
diff -urN a/drivers/net/wan/pef2256.c b/drivers/net/wan/pef2256.c
[..]
+static int pef2256_remove(struct platform_device *pdev)
+{
+ struct net_device *ndev = dev_get_drvdata(&pdev->dev);
+ struct pef2256_dev_priv *priv = dev_to_hdlc(ndev)->priv;
+
+
+ device_remove_file(priv->dev, &dev_attr_regs);
+ device_remove_file(priv->dev, &dev_attr_Tx_TS);
+ device_remove_file(priv->dev, &dev_attr_Rx_TS);
+ device_remove_file(priv->dev, &dev_attr_mode);
+
+ unregister_hdlc_device(priv->netdev);
+
+ free_netdev(priv->netdev);
+
+ iounmap(priv->base_addr);
+
+ kfree(priv);
+
+ dev_set_drvdata(&pdev->dev, NULL);
dev_set_drvdata is not necessary. driver core clears the driver data to NULL
after device_release or on probe failure.
//govind
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html