提交 5dab5872 编写于 作者: J Jan Kiszka 提交者: Linus Walleij

gpio: exar: Allocate resources on behalf of the platform device

Do not allocate resources on behalf of the parent device but on our own.
Otherwise, cleanup does not properly work if gpio-exar is removed but
not the parent device.
Signed-off-by: NJan Kiszka <jan.kiszka@siemens.com>
Reviewed-by: NAndy Shevchenko <andy.shevchenko@gmail.com>
Acked-by: NLinus Walleij <linus.walleij@linaro.org>
Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
上级 d3936d74
...@@ -139,7 +139,7 @@ static int gpio_exar_probe(struct platform_device *pdev) ...@@ -139,7 +139,7 @@ static int gpio_exar_probe(struct platform_device *pdev)
if (!p) if (!p)
return -ENOMEM; return -ENOMEM;
exar_gpio = devm_kzalloc(&pcidev->dev, sizeof(*exar_gpio), GFP_KERNEL); exar_gpio = devm_kzalloc(&pdev->dev, sizeof(*exar_gpio), GFP_KERNEL);
if (!exar_gpio) if (!exar_gpio)
return -ENOMEM; return -ENOMEM;
...@@ -160,7 +160,7 @@ static int gpio_exar_probe(struct platform_device *pdev) ...@@ -160,7 +160,7 @@ static int gpio_exar_probe(struct platform_device *pdev)
exar_gpio->regs = p; exar_gpio->regs = p;
exar_gpio->index = index; exar_gpio->index = index;
ret = devm_gpiochip_add_data(&pcidev->dev, ret = devm_gpiochip_add_data(&pdev->dev,
&exar_gpio->gpio_chip, exar_gpio); &exar_gpio->gpio_chip, exar_gpio);
if (ret) if (ret)
goto err_destroy; goto err_destroy;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册