diff --git a/drivers/pinctrl/sh-pfc/gpio.c b/drivers/pinctrl/sh-pfc/gpio.c index d37efa7dcf90c78282a12503ad4a3d1cfb991e32..3620bd84ae938a5712ee7ad1ab66ac0474061115 100644 --- a/drivers/pinctrl/sh-pfc/gpio.c +++ b/drivers/pinctrl/sh-pfc/gpio.c @@ -224,8 +224,8 @@ static int gpio_pin_setup(struct sh_pfc_chip *chip) struct gpio_chip *gc = &chip->gpio_chip; int ret; - chip->pins = devm_kzalloc(pfc->dev, pfc->nr_pins * sizeof(*chip->pins), - GFP_KERNEL); + chip->pins = devm_kzalloc(pfc->dev, pfc->info->nr_pins * + sizeof(*chip->pins), GFP_KERNEL); if (chip->pins == NULL) return -ENOMEM;