diff options
author | Grant Likely <grant.likely@secretlab.ca> | 2011-12-12 11:25:56 -0500 |
---|---|---|
committer | Grant Likely <grant.likely@secretlab.ca> | 2011-12-12 15:40:16 -0500 |
commit | fe9f68449a507e03d41bee4500456bbfa22095d3 (patch) | |
tree | d9028277ead4c701b6a273b1eb5161586dac2e3d /arch | |
parent | 64842aad5ec5ea3b6f6e716ce53a863f7c409da8 (diff) |
gpio/microblaze: Eliminate duplication of of_get_named_gpio_flags()
of_reset_gpio_handle() is largely a cut-and-paste copy of
of_get_named_gpio_flags(). There really isn't any reason for the
split, so this patch deletes the duplicate function
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Cc: Michal Simek <monstr@monstr.eu>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/microblaze/kernel/reset.c | 43 |
1 files changed, 2 insertions, 41 deletions
diff --git a/arch/microblaze/kernel/reset.c b/arch/microblaze/kernel/reset.c index bd8ccab5ceff..88a01636f785 100644 --- a/arch/microblaze/kernel/reset.c +++ b/arch/microblaze/kernel/reset.c | |||
@@ -19,50 +19,11 @@ | |||
19 | static int handle; /* reset pin handle */ | 19 | static int handle; /* reset pin handle */ |
20 | static unsigned int reset_val; | 20 | static unsigned int reset_val; |
21 | 21 | ||
22 | static int of_reset_gpio_handle(void) | ||
23 | { | ||
24 | int ret; /* variable which stored handle reset gpio pin */ | ||
25 | struct device_node *root; /* root node */ | ||
26 | struct device_node *gpio; /* gpio node */ | ||
27 | struct gpio_chip *gc; | ||
28 | u32 flags; | ||
29 | const void *gpio_spec; | ||
30 | |||
31 | /* find out root node */ | ||
32 | root = of_find_node_by_path("/"); | ||
33 | |||
34 | /* give me handle for gpio node to be possible allocate pin */ | ||
35 | ret = of_parse_phandles_with_args(root, "hard-reset-gpios", | ||
36 | "#gpio-cells", 0, &gpio, &gpio_spec); | ||
37 | if (ret) { | ||
38 | pr_debug("%s: can't parse gpios property\n", __func__); | ||
39 | goto err0; | ||
40 | } | ||
41 | |||
42 | gc = of_node_to_gpiochip(gpio); | ||
43 | if (!gc) { | ||
44 | pr_debug("%s: gpio controller %s isn't registered\n", | ||
45 | root->full_name, gpio->full_name); | ||
46 | ret = -ENODEV; | ||
47 | goto err1; | ||
48 | } | ||
49 | |||
50 | ret = gc->of_xlate(gc, root, gpio_spec, &flags); | ||
51 | if (ret < 0) | ||
52 | goto err1; | ||
53 | |||
54 | ret += gc->base; | ||
55 | err1: | ||
56 | of_node_put(gpio); | ||
57 | err0: | ||
58 | pr_debug("%s exited with status %d\n", __func__, ret); | ||
59 | return ret; | ||
60 | } | ||
61 | |||
62 | void of_platform_reset_gpio_probe(void) | 22 | void of_platform_reset_gpio_probe(void) |
63 | { | 23 | { |
64 | int ret; | 24 | int ret; |
65 | handle = of_reset_gpio_handle(); | 25 | handle = of_get_named_gpio(of_find_node_by_path("/"), |
26 | "hard-reset-gpios", 0); | ||
66 | 27 | ||
67 | if (!gpio_is_valid(handle)) { | 28 | if (!gpio_is_valid(handle)) { |
68 | printk(KERN_INFO "Skipping unavailable RESET gpio %d (%s)\n", | 29 | printk(KERN_INFO "Skipping unavailable RESET gpio %d (%s)\n", |