mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-05-24 10:39:52 +00:00
gpio: sysfs: preparatory clean ups
Put the recently introduced gpio-chip pointer to some more use in gpiod_export. Signed-off-by: Johan Hovold <johan@kernel.org> Reviewed-by: Alexandre Courbot <acourbot@nvidia.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
This commit is contained in:
parent
52176d0d3b
commit
cecf58ab55
1 changed files with 4 additions and 4 deletions
|
@ -599,7 +599,7 @@ int gpiod_export(struct gpio_desc *desc, bool direction_may_change)
|
||||||
goto fail_unlock;
|
goto fail_unlock;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (desc->chip->direction_input && desc->chip->direction_output &&
|
if (chip->direction_input && chip->direction_output &&
|
||||||
direction_may_change) {
|
direction_may_change) {
|
||||||
set_bit(FLAG_SYSFS_DIR, &desc->flags);
|
set_bit(FLAG_SYSFS_DIR, &desc->flags);
|
||||||
}
|
}
|
||||||
|
@ -607,10 +607,10 @@ int gpiod_export(struct gpio_desc *desc, bool direction_may_change)
|
||||||
spin_unlock_irqrestore(&gpio_lock, flags);
|
spin_unlock_irqrestore(&gpio_lock, flags);
|
||||||
|
|
||||||
offset = gpio_chip_hwgpio(desc);
|
offset = gpio_chip_hwgpio(desc);
|
||||||
if (desc->chip->names && desc->chip->names[offset])
|
if (chip->names && chip->names[offset])
|
||||||
ioname = desc->chip->names[offset];
|
ioname = chip->names[offset];
|
||||||
|
|
||||||
dev = device_create_with_groups(&gpio_class, desc->chip->dev,
|
dev = device_create_with_groups(&gpio_class, chip->dev,
|
||||||
MKDEV(0, 0), desc, gpio_groups,
|
MKDEV(0, 0), desc, gpio_groups,
|
||||||
ioname ? ioname : "gpio%u",
|
ioname ? ioname : "gpio%u",
|
||||||
desc_to_gpio(desc));
|
desc_to_gpio(desc));
|
||||||
|
|
Loading…
Add table
Reference in a new issue