summaryrefslogtreecommitdiffstats
path: root/arch/microblaze/kernel/reset.c
diff options
context:
space:
mode:
authorRob Herring <robh@kernel.org>2018-06-19 15:36:20 -0600
committerMichal Simek <michal.simek@xilinx.com>2018-06-21 13:57:39 +0200
commit45df561a7ae2ca5080708cc2cf84a236f4d930ef (patch)
treed692aef30b98bec81c0769bba9cbac05ae76bc7a /arch/microblaze/kernel/reset.c
parent2dbeb7040a21846facbeea876e85cbde41fa81e9 (diff)
downloadlinux-45df561a7ae2ca5080708cc2cf84a236f4d930ef.tar.bz2
microblaze: consolidate GPIO reset handling
Now that platform.c only has the GPIO reset handling left, move the initcall to reset.c and remove platform.c. Cc: Michal Simek <monstr@monstr.eu> Signed-off-by: Rob Herring <robh@kernel.org> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Diffstat (limited to 'arch/microblaze/kernel/reset.c')
-rw-r--r--arch/microblaze/kernel/reset.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/arch/microblaze/kernel/reset.c b/arch/microblaze/kernel/reset.c
index bab4c8330ef4..fcbe1daf6316 100644
--- a/arch/microblaze/kernel/reset.c
+++ b/arch/microblaze/kernel/reset.c
@@ -18,7 +18,7 @@
static int handle; /* reset pin handle */
static unsigned int reset_val;
-void of_platform_reset_gpio_probe(void)
+static int of_platform_reset_gpio_probe(void)
{
int ret;
handle = of_get_named_gpio(of_find_node_by_path("/"),
@@ -27,13 +27,13 @@ void of_platform_reset_gpio_probe(void)
if (!gpio_is_valid(handle)) {
pr_info("Skipping unavailable RESET gpio %d (%s)\n",
handle, "reset");
- return;
+ return -ENODEV;
}
ret = gpio_request(handle, "reset");
if (ret < 0) {
pr_info("GPIO pin is already allocated\n");
- return;
+ return ret;
}
/* get current setup value */
@@ -51,11 +51,12 @@ void of_platform_reset_gpio_probe(void)
pr_info("RESET: Registered gpio device: %d, current val: %d\n",
handle, reset_val);
- return;
+ return 0;
err:
gpio_free(handle);
- return;
+ return ret;
}
+device_initcall(of_platform_reset_gpio_probe);
static void gpio_system_reset(void)