|
@@ -1398,7 +1398,7 @@ static int gpiod_request(struct gpio_desc *desc, const char *label)
|
|
int status = -EPROBE_DEFER;
|
|
int status = -EPROBE_DEFER;
|
|
unsigned long flags;
|
|
unsigned long flags;
|
|
|
|
|
|
- if (!desc || !desc->chip) {
|
|
|
|
|
|
+ if (!desc) {
|
|
pr_warn("%s: invalid GPIO\n", __func__);
|
|
pr_warn("%s: invalid GPIO\n", __func__);
|
|
return -EINVAL;
|
|
return -EINVAL;
|
|
}
|
|
}
|
|
@@ -1406,6 +1406,8 @@ static int gpiod_request(struct gpio_desc *desc, const char *label)
|
|
spin_lock_irqsave(&gpio_lock, flags);
|
|
spin_lock_irqsave(&gpio_lock, flags);
|
|
|
|
|
|
chip = desc->chip;
|
|
chip = desc->chip;
|
|
|
|
+ if (chip == NULL)
|
|
|
|
+ goto done;
|
|
|
|
|
|
if (!try_module_get(chip->owner))
|
|
if (!try_module_get(chip->owner))
|
|
goto done;
|
|
goto done;
|