diff mbox

gpio: of: remove unnecessary variable in of_get_gpio_hog()

Message ID 1435825632-16103-1-git-send-email-yamada.masahiro@socionext.com
State New
Headers show

Commit Message

Masahiro Yamada July 2, 2015, 8:27 a.m. UTC
The variable "desc" is only used for storing the return value at the
end of the function.  It is is unneeded.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---

 drivers/gpio/gpiolib-of.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

Comments

Alexandre Courbot July 13, 2015, 2:27 p.m. UTC | #1
On Thu, Jul 2, 2015 at 5:27 PM, Masahiro Yamada
<yamada.masahiro@socionext.com> wrote:
> The variable "desc" is only used for storing the return value at the
> end of the function.  It is is unneeded.

Fair enough.

Acked-by: Alexandre Courbot <acourbot@nvidia.com>
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Masahiro Yamada July 14, 2015, 1:03 a.m. UTC | #2
2015-07-13 23:27 GMT+09:00 Alexandre Courbot <gnurou@gmail.com>:
> On Thu, Jul 2, 2015 at 5:27 PM, Masahiro Yamada
> <yamada.masahiro@socionext.com> wrote:
>> The variable "desc" is only used for storing the return value at the
>> end of the function.  It is is unneeded.
>
> Fair enough.
>
> Acked-by: Alexandre Courbot <acourbot@nvidia.com>
> --


I've noticed my typo.  "It is is unneeded" -> "It is unneeded"


Just in case, I've sent v2 with your Acked-by.
diff mbox

Patch

diff --git a/drivers/gpio/gpiolib-of.c b/drivers/gpio/gpiolib-of.c
index 9a0ec48..fd2db4b 100644
--- a/drivers/gpio/gpiolib-of.c
+++ b/drivers/gpio/gpiolib-of.c
@@ -136,7 +136,6 @@  static struct gpio_desc *of_get_gpio_hog(struct device_node *np,
 {
 	struct device_node *chip_np;
 	enum of_gpio_flags xlate_flags;
-	struct gpio_desc *desc;
 	struct gg_data gg_data = {
 		.flags = &xlate_flags,
 	};
@@ -193,9 +192,7 @@  static struct gpio_desc *of_get_gpio_hog(struct device_node *np,
 	if (name && of_property_read_string(np, "line-name", name))
 		*name = np->name;
 
-	desc = gg_data.out_gpio;
-
-	return desc;
+	return gg_data.out_gpio;
 }
 
 /**