]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commit
can: m_can: use struct m_can_classdev as drvdata
authorMarc Kleine-Budde <mkl@pengutronix.de>
Sat, 12 Dec 2020 17:55:18 +0000 (18:55 +0100)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Mon, 14 Dec 2020 13:24:17 +0000 (14:24 +0100)
commitc6b734892420f00fdc3c49b8c1029aa5bf0790b9
treec57d6bfdb77983fe9ee006a098a28a11658608f0
parentac33ffd3e2b037fe68683b48dadd1cef4a969993
can: m_can: use struct m_can_classdev as drvdata

The m_can driver's suspend and resume functions (m_can_class_suspend() and
m_can_class_resume()) make use of dev_get_drvdata() and assume that the drvdata
is a pointer to the struct net_device.

With upcoming conversion of the tcan4x5x driver to pm_runtime this assumption
is no longer valid. As the suspend and resume functions actually need a struct
m_can_classdev pointer, change the m_can_platform and the m_can_pci driver to
hold a pointer to struct m_can_classdev instead, as the tcan4x5x driver already
does.

Link: https://lore.kernel.org/r/20201212175518.139651-8-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>
drivers/net/can/m_can/m_can.c
drivers/net/can/m_can/m_can_pci.c
drivers/net/can/m_can/m_can_platform.c