Skip to content

Commit 3069ce6

Browse files
sknseanmarckleinebudde
authored andcommitted
can: tcan4x5x: tcan4x5x_can_probe(): get the device out of standby before register access
The m_can tries to detect if Non ISO Operation is available while in standby mode, this function results in the following error: | tcan4x5x spi2.0 (unnamed net_device) (uninitialized): Failed to init module | tcan4x5x spi2.0: m_can device registered (irq=84, version=32) | tcan4x5x spi2.0 can2: TCAN4X5X successfully initialized. When the tcan device comes out of reset it goes in standby mode. The m_can driver tries to access the control register but fails due to the device being in standby mode. So this patch will put the tcan device in normal mode before the m_can driver does the initialization. Fixes: 5443c22 ("can: tcan4x5x: Add tcan4x5x driver to the kernel") Cc: [email protected] Signed-off-by: Sean Nyekjaer <[email protected]> Acked-by: Dan Murphy <[email protected]> Signed-off-by: Marc Kleine-Budde <[email protected]>
1 parent 738d290 commit 3069ce6

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

drivers/net/can/m_can/tcan4x5x.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -457,6 +457,10 @@ static int tcan4x5x_can_probe(struct spi_device *spi)
457457

458458
tcan4x5x_power_enable(priv->power, 1);
459459

460+
ret = tcan4x5x_init(mcan_class);
461+
if (ret)
462+
goto out_power;
463+
460464
ret = m_can_class_register(mcan_class);
461465
if (ret)
462466
goto out_power;

0 commit comments

Comments
 (0)