ioexpander/gpio: Remove the hardcode 100 limitation

it's very easy to have more than 100 GPIOs on the modern SoC

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
Xiang Xiao 2021-10-19 16:00:19 +08:00 committed by David Sidrane
parent f1f0bcc521
commit 7183009400

View File

@ -524,11 +524,10 @@ static int gpio_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
int gpio_pin_register(FAR struct gpio_dev_s *dev, int minor)
{
FAR const char *fmt;
char devname[16];
char devname[32];
int ret;
DEBUGASSERT(dev != NULL && dev->gp_ops != NULL &&
(unsigned int)minor < 100);
DEBUGASSERT(dev != NULL && dev->gp_ops != NULL);
switch (dev->gp_pintype)
{
@ -619,7 +618,7 @@ void gpio_pin_unregister(FAR struct gpio_dev_s *dev, int minor)
break;
}
snprintf(devname, 16, fmt, (unsigned int)minor);
snprintf(devname, sizeof(devname), fmt, (unsigned int)minor);
gpioinfo("Unregistering %s\n", devname);
unregister_driver(devname);