]> git.baikalelectronics.ru Git - kernel.git/commit
can: mcp251xfd: mcp251xfd_open(): open_candev() first
authorMarc Kleine-Budde <mkl@pengutronix.de>
Fri, 22 Oct 2021 16:45:05 +0000 (18:45 +0200)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Sat, 8 Jan 2022 19:17:41 +0000 (20:17 +0100)
commitdb5f35c78d7528d6c03116d42be9eb1929af85f5
tree352e38b19ee5ced7c55070e7501590622c57157a
parent7830afff4842766925288894a0d8edad16e394c4
can: mcp251xfd: mcp251xfd_open(): open_candev() first

This patch exchanges the order of open_candev() and
pm_runtime_get_sync(), so that open_candev() is called first.

A usual reason why open_candev() fails is missing CAN bit rate
configuration. It makes no sense to resume the device from PM sleep
first just to put it to sleep if the bit rate is not configured.

Link: https://lore.kernel.org/all/20220105154300.1258636-5-mkl@pengutronix.de
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c