gpio-sta2x11: don't use pdata if null
If there is no platform data available, the driver shouldn't use the pointer or it will oops. Since things will mostly work nonetheless, (the BIOS may have set up the pins properly), I'd better not fail the probe even in this case. Signed-off-by: Alessandro Rubini <rubini@gnudd.com> Acked-by: Giancarlo Asnaghi <giancarlo.asnaghi@st.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
This commit is contained in:
parent
6887a4131d
commit
2e2070c85a
|
@ -383,6 +383,7 @@ static int __devinit gsta_probe(struct platform_device *dev)
|
|||
}
|
||||
spin_lock_init(&chip->lock);
|
||||
gsta_gpio_setup(chip);
|
||||
if (gpio_pdata)
|
||||
for (i = 0; i < GSTA_NR_GPIO; i++)
|
||||
gsta_set_config(chip, i, gpio_pdata->pinconfig[i]);
|
||||
|
||||
|
|
Loading…
Reference in New Issue