@@ -232,7 +232,7 @@ static void of_gpiochip_scan_gpios(struct gpio_chip *chip)
continue;
}
- if (gpiod_hog(desc, name, lflags, dflags))
+ if (gpiod_hog(desc, lflags, dflags))
continue;
}
}
@@ -2181,15 +2181,15 @@ EXPORT_SYMBOL_GPL(__gpiod_get_index_optional);
/**
* gpiod_hog - Hog the specified GPIO desc given the provided flags
* @desc: gpio whose value will be assigned
- * @name: gpio line name
* @lflags: gpio_lookup_flags - returned from of_find_gpio() or
* of_get_gpio_hog()
* @dflags: gpiod_flags - optional GPIO initialization flags
*/
-int gpiod_hog(struct gpio_desc *desc, const char *name,
- unsigned long lflags, enum gpiod_flags dflags)
+int gpiod_hog(struct gpio_desc *desc, unsigned long lflags,
+ enum gpiod_flags dflags)
{
int status;
+ const char *name = desc->name;
status = __gpiod_request(desc, name);
if (status) {
@@ -2211,7 +2211,7 @@ int gpiod_hog(struct gpio_desc *desc, const char *name,
set_bit(FLAG_IS_HOGGED, &desc->flags);
pr_info("GPIO line %d (%s) hogged as %s%s\n",
- desc_to_gpio(desc), name,
+ desc_to_gpio(desc), desc->name,
(dflags&GPIOD_FLAGS_BIT_DIR_OUT) ? "output" : "input",
(dflags&GPIOD_FLAGS_BIT_DIR_OUT) ?
(dflags&GPIOD_FLAGS_BIT_DIR_VAL) ? "/high" : "/low":"");
@@ -97,8 +97,8 @@ struct gpio_desc {
int gpiod_request(struct gpio_desc *desc, const char *label);
void gpiod_free(struct gpio_desc *desc);
-int gpiod_hog(struct gpio_desc *desc, const char *name,
- unsigned long lflags, enum gpiod_flags dflags);
+int gpiod_hog(struct gpio_desc *desc, unsigned long lflags,
+ enum gpiod_flags dflags);
/*
* Return the GPIO number of the passed descriptor relative to its chip