gpiod_chip_iter_next() should use gpiod_chip_open_by_name() internally
when opening chips by dentry->d_name.
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
struct gpiod_chip * gpiod_chip_iter_next(struct gpiod_chip_iter *iter)
{
+ struct gpiod_chip *chip;
struct dirent *dentry;
int status;
status = strncmp(dentry->d_name, cdev_prefix,
sizeof(cdev_prefix) - 1);
if (status == 0) {
- iter->current = gpiod_chip_open(dentry->d_name);
+ chip = gpiod_chip_open_by_name(dentry->d_name);
+ iter->current = chip;
return iter->current;
}
}