]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
can: m_can: m_can_class_free_dev(): introduce new function
authorDan Murphy <dmurphy@ti.com>
Thu, 27 Feb 2020 18:38:29 +0000 (12:38 -0600)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Sun, 15 Nov 2020 17:33:42 +0000 (18:33 +0100)
This patch creates a common function that peripherials can call to free the
netdev device when failures occur.

Fixes: f524f829b75a ("can: m_can: Create a m_can platform framework")
Reported-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Dan Murphy <dmurphy@ti.com>
Link: http://lore.kernel.org/r/20200227183829.21854-2-dmurphy@ti.com
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
drivers/net/can/m_can/m_can.c
drivers/net/can/m_can/m_can.h

index 63887e23d89c0a2a54ebfd88210021ce21bb4474..f2c87b76e569256e21be6d104aa56d0d98ed59da 100644 (file)
@@ -1812,6 +1812,12 @@ out:
 }
 EXPORT_SYMBOL_GPL(m_can_class_allocate_dev);
 
+void m_can_class_free_dev(struct net_device *net)
+{
+       free_candev(net);
+}
+EXPORT_SYMBOL_GPL(m_can_class_free_dev);
+
 int m_can_class_register(struct m_can_classdev *m_can_dev)
 {
        int ret;
index 49f42b50627a1c3111d3f436a5198c3dbff057b7..b2699a7c99973516cd2ee1dbf3609884a58404a8 100644 (file)
@@ -99,6 +99,7 @@ struct m_can_classdev {
 };
 
 struct m_can_classdev *m_can_class_allocate_dev(struct device *dev);
+void m_can_class_free_dev(struct net_device *net);
 int m_can_class_register(struct m_can_classdev *cdev);
 void m_can_class_unregister(struct m_can_classdev *cdev);
 int m_can_class_get_clocks(struct m_can_classdev *cdev);