OSDN Git Service

can: tcan4x5x: tcan4x5x_can_probe(): turn on the power before parsing the config
authorDan Murphy <dmurphy@ti.com>
Tue, 10 Dec 2019 16:32:04 +0000 (10:32 -0600)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Thu, 2 Jan 2020 14:34:26 +0000 (15:34 +0100)
commit3814ca3a10be795693e9d95142c69134c6189a9b
tree583637747cd3736e9f298421917d68f0646164ce
parent3069ce620daed85e4ef2b0c087dca2509f809470
can: tcan4x5x: tcan4x5x_can_probe(): turn on the power before parsing the config

The tcan4x5x_parse_config() function now performs action on the device
either reading or writing and a reset. If the devive has a switchable
power supppy (i.e. regulator is managed) it needs to be turned on.

So turn on the regulator if available. If the parsing fails, turn off
the regulator.

Fixes: 2de497356955 ("can: tcan45x: Make wake-up GPIO an optional GPIO")
Signed-off-by: Dan Murphy <dmurphy@ti.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
drivers/net/can/m_can/tcan4x5x.c