can: mcp251x: Use devm_clk_get_optional() to get the input clock
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Mon, 26 Aug 2019 17:26:21 +0000 (20:26 +0300)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Tue, 3 Sep 2019 08:23:57 +0000 (10:23 +0200)
commitb4cb76961c953cde1c60f52d2b6d434672da82f8
tree3e331713110dec05b3676d667cd52490620fd84d
parentf6cae800bfdb6711f0d45af98643a944998be6f2
can: mcp251x: Use devm_clk_get_optional() to get the input clock

Simplify the code which fetches the input clock by using
devm_clk_get_optional(). This comes with a small functional change: previously
all errors were ignored when platform data is present. Now all errors are
treated as errors. If no input clock is present devm_clk_get_optional() will
return NULL instead of an error which matches the behavior of the old code.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
drivers/net/can/spi/mcp251x.c