can: m_can: let m_can_class_allocate_dev() allocate driver specific private data
This patch enhances m_can_class_allocate_dev() to allocate driver specific private data. The driver's private data struct must contain struct m_can_classdev as its first member followed by the remaining private data. Link: https://lore.kernel.org/r/20201212175518.139651-7-mkl@pengutronix.de Reviewed-by: Sean Nyekjaer <sean@geanix.com> Reviewed-by: Dan Murphy <dmurphy@ti.com> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
This commit is contained in:
@@ -86,8 +86,6 @@ struct m_can_classdev {
|
||||
|
||||
struct m_can_ops *ops;
|
||||
|
||||
void *device_data;
|
||||
|
||||
int version;
|
||||
u32 irqstatus;
|
||||
|
||||
@@ -97,7 +95,7 @@ struct m_can_classdev {
|
||||
struct mram_cfg mcfg[MRAM_CFG_NUM];
|
||||
};
|
||||
|
||||
struct m_can_classdev *m_can_class_allocate_dev(struct device *dev);
|
||||
struct m_can_classdev *m_can_class_allocate_dev(struct device *dev, int sizeof_priv);
|
||||
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);
|
||||
|
||||
Reference in New Issue
Block a user