Skip to content

Commit c81d0b6

Browse files
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: 5443c22 ("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>
1 parent 1ff203b commit c81d0b6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/net/can/m_can/tcan4x5x.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -527,10 +527,10 @@ static int tcan4x5x_can_remove(struct spi_device *spi)
527527
{
528528
struct tcan4x5x_priv *priv = spi_get_drvdata(spi);
529529

530-
tcan4x5x_power_enable(priv->power, 0);
531-
532530
m_can_class_unregister(priv->mcan_dev);
533531

532+
tcan4x5x_power_enable(priv->power, 0);
533+
534534
return 0;
535535
}
536536

0 commit comments

Comments
 (0)