reset: add exported __reset_control_get, return NULL if optional
authorPhilipp Zabel <p.zabel@pengutronix.de>
Fri, 5 Feb 2016 12:41:39 +0000 (13:41 +0100)
committerPhilipp Zabel <p.zabel@pengutronix.de>
Tue, 4 Apr 2017 15:36:10 +0000 (17:36 +0200)
commit62e24c5775ecb387a3eb33701378ccfa6dbc98ee
tree66b088d3862e20b8680fa7982b9902d83092df40
parent0ca10b60ceeb5372da01798ca68c116ae45a6eb6
reset: add exported __reset_control_get, return NULL if optional

Rename the internal __reset_control_get/put functions to
__reset_control_get/put_internal and add an exported
__reset_control_get equivalent to __of_reset_control_get
that takes a struct device parameter.
This avoids the confusing call to __of_reset_control_get in
the non-DT case and fixes the devm_reset_control_get_optional
function to return NULL if RESET_CONTROLLER is enabled but
dev->of_node == NULL.

Fixes: bb475230b8e5 ("reset: make optional functions really optional")
Reported-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Tested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Ramiro Oliveira <Ramiro.Oliveira@synopsys.com>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
drivers/reset/core.c
include/linux/reset.h