diff options
author | Rob Herring <robh@kernel.org> | 2018-06-19 17:36:20 -0400 |
---|---|---|
committer | Michal Simek <michal.simek@xilinx.com> | 2018-06-21 07:57:39 -0400 |
commit | 45df561a7ae2ca5080708cc2cf84a236f4d930ef (patch) | |
tree | d692aef30b98bec81c0769bba9cbac05ae76bc7a /arch/microblaze/kernel/reset.c | |
parent | 2dbeb7040a21846facbeea876e85cbde41fa81e9 (diff) |
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.c | 11 |
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 @@ | |||
18 | static int handle; /* reset pin handle */ | 18 | static int handle; /* reset pin handle */ |
19 | static unsigned int reset_val; | 19 | static unsigned int reset_val; |
20 | 20 | ||
21 | void of_platform_reset_gpio_probe(void) | 21 | static int of_platform_reset_gpio_probe(void) |
22 | { | 22 | { |
23 | int ret; | 23 | int ret; |
24 | handle = of_get_named_gpio(of_find_node_by_path("/"), | 24 | handle = of_get_named_gpio(of_find_node_by_path("/"), |
@@ -27,13 +27,13 @@ void of_platform_reset_gpio_probe(void) | |||
27 | if (!gpio_is_valid(handle)) { | 27 | if (!gpio_is_valid(handle)) { |
28 | pr_info("Skipping unavailable RESET gpio %d (%s)\n", | 28 | pr_info("Skipping unavailable RESET gpio %d (%s)\n", |
29 | handle, "reset"); | 29 | handle, "reset"); |
30 | return; | 30 | return -ENODEV; |
31 | } | 31 | } |
32 | 32 | ||
33 | ret = gpio_request(handle, "reset"); | 33 | ret = gpio_request(handle, "reset"); |
34 | if (ret < 0) { | 34 | if (ret < 0) { |
35 | pr_info("GPIO pin is already allocated\n"); | 35 | pr_info("GPIO pin is already allocated\n"); |
36 | return; | 36 | return ret; |
37 | } | 37 | } |
38 | 38 | ||
39 | /* get current setup value */ | 39 | /* get current setup value */ |
@@ -51,11 +51,12 @@ void of_platform_reset_gpio_probe(void) | |||
51 | 51 | ||
52 | pr_info("RESET: Registered gpio device: %d, current val: %d\n", | 52 | pr_info("RESET: Registered gpio device: %d, current val: %d\n", |
53 | handle, reset_val); | 53 | handle, reset_val); |
54 | return; | 54 | return 0; |
55 | err: | 55 | err: |
56 | gpio_free(handle); | 56 | gpio_free(handle); |
57 | return; | 57 | return ret; |
58 | } | 58 | } |
59 | device_initcall(of_platform_reset_gpio_probe); | ||
59 | 60 | ||
60 | 61 | ||
61 | static void gpio_system_reset(void) | 62 | static void gpio_system_reset(void) |