diff options
author | Marc Kleine-Budde <mkl@pengutronix.de> | 2020-08-10 22:23:49 +0200 |
---|---|---|
committer | Marc Kleine-Budde <mkl@pengutronix.de> | 2020-11-15 18:24:36 +0100 |
commit | c81d0b6ca665477c761f227807010762630b089f (patch) | |
tree | 2180c715733221242fd4cc892348ea7a94ac9330 /drivers/net | |
parent | 1ff203badbbf1738027c8395d5b40b0d462b6e4d (diff) | |
download | linux-c81d0b6ca665477c761f227807010762630b089f.tar.bz2 |
can: tcan4x5x: tcan4x5x_can_remove(): fix order of deregistration
Change the order in tcan4x5x_can_remove() to be the exact inverse of
tcan4x5x_can_probe(). First m_can_class_unregister(), then power down the
device.
Fixes: 5443c226ba91 ("can: tcan4x5x: Add tcan4x5x driver to the kernel")
Cc: Dan Murphy <dmurphy@ti.com>
Link: http://lore.kernel.org/r/20201019154233.1262589-10-mkl@pengutronix.de
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/can/m_can/tcan4x5x.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/can/m_can/tcan4x5x.c b/drivers/net/can/m_can/tcan4x5x.c index f058bd9104e9..4fdb7121403a 100644 --- a/drivers/net/can/m_can/tcan4x5x.c +++ b/drivers/net/can/m_can/tcan4x5x.c @@ -527,10 +527,10 @@ static int tcan4x5x_can_remove(struct spi_device *spi) { struct tcan4x5x_priv *priv = spi_get_drvdata(spi); - tcan4x5x_power_enable(priv->power, 0); - m_can_class_unregister(priv->mcan_dev); + tcan4x5x_power_enable(priv->power, 0); + return 0; } |