@@ -2189,25 +2189,20 @@ EXPORT_SYMBOL_GPL(__gpiod_get_index_optional);
int gpiod_hog(struct gpio_desc *desc, const char *name,
unsigned long lflags, enum gpiod_flags dflags)
{
- struct gpio_chip *chip;
- struct gpio_desc *local_desc;
- int hwnum;
int status;
- chip = gpiod_to_chip(desc);
- hwnum = gpio_chip_hwgpio(desc);
-
- local_desc = gpiochip_request_own_desc(chip, hwnum, name);
- if (IS_ERR(local_desc)) {
+ status = __gpiod_request(desc, name);
+ if (status) {
pr_err("requesting hog GPIO %s (chip %s, offset %d) failed\n",
- name, chip->label, hwnum);
- return PTR_ERR(local_desc);
+ name, gpiod_to_chip(desc)->label,
+ gpio_chip_hwgpio(desc));
+ return status;
}
status = gpiod_configure_flags(desc, name, lflags, dflags);
if (status < 0) {
pr_err("setup of hog GPIO %s (chip %s, offset %d) failed\n",
- name, chip->label, hwnum);
+ name, gpiod_to_chip(desc)->label, gpio_chip_hwgpio(desc));
gpiochip_free_own_desc(desc);
return status;
}