Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1651881

Re: [PATCH v3 03/10] gpio-exar/8250-exar: Fix passing in of parent PCI device

From Andy Shevchenko <andy.shevchenko@gmail.com>
Newsgroups linux.kernel
Subject Re: [PATCH v3 03/10] gpio-exar/8250-exar: Fix passing in of parent PCI device
Date 2017-05-27 15:50 +0200
Message-ID <tLKgp-4Gs-7@gated-at.bofh.it> (permalink)
References <tLpYm-83M-3@gated-at.bofh.it> <tLpYn-83M-47@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Fri, May 26, 2017 at 7:02 PM, Jan Kiszka <jan.kiszka@siemens.com> wrote:
> This fixes reloading of the GPIO driver for the same platform device
> instance as created by the exar UART driver: First of all, the driver
> sets drvdata to its own value during probing and does not restore the
> original value on exit. But this won't help anyway as the core clears
> drvdata after the driver left.
>
> Set the platform device parent instead.

Now this one looks much better than first efforts.

Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>

>
> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
> ---
>  drivers/gpio/gpio-exar.c            | 2 +-
>  drivers/tty/serial/8250/8250_exar.c | 3 ++-
>  2 files changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpio/gpio-exar.c b/drivers/gpio/gpio-exar.c
> index 006a9a67c2a4..da4550bb9939 100644
> --- a/drivers/gpio/gpio-exar.c
> +++ b/drivers/gpio/gpio-exar.c
> @@ -119,7 +119,7 @@ static int exar_direction_input(struct gpio_chip *chip, unsigned int offset)
>
>  static int gpio_exar_probe(struct platform_device *pdev)
>  {
> -       struct pci_dev *pcidev = platform_get_drvdata(pdev);
> +       struct pci_dev *pcidev = to_pci_dev(pdev->dev.parent);
>         struct exar_gpio_chip *exar_gpio;
>         void __iomem *p;
>         int index, ret;
> diff --git a/drivers/tty/serial/8250/8250_exar.c b/drivers/tty/serial/8250/8250_exar.c
> index c29c7e675890..0f4b236d7e68 100644
> --- a/drivers/tty/serial/8250/8250_exar.c
> +++ b/drivers/tty/serial/8250/8250_exar.c
> @@ -203,7 +203,8 @@ xr17v35x_register_gpio(struct pci_dev *pcidev)
>         if (!pdev)
>                 return NULL;
>
> -       platform_set_drvdata(pdev, pcidev);
> +       pdev->dev.parent = &pcidev->dev;
> +
>         if (platform_device_add(pdev) < 0) {
>                 platform_device_put(pdev);
>                 return NULL;
> --
> 2.12.0
>



-- 
With Best Regards,
Andy Shevchenko

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v3 00/10] serial/gpio: exar: Fixes and support for IOT2000 Jan Kiszka <jan.kiszka@siemens.com> - 2017-05-26 18:10 +0200
  [PATCH v3 04/10] gpio: exar: Allocate resources on behalf of the platform device Jan Kiszka <jan.kiszka@siemens.com> - 2017-05-26 18:10 +0200
    Re: [PATCH v3 04/10] gpio: exar: Allocate resources on behalf of the  platform device Linus Walleij <linus.walleij@linaro.org> - 2017-05-29 14:40 +0200
  [PATCH v3 03/10] gpio-exar/8250-exar: Fix passing in of parent PCI device Jan Kiszka <jan.kiszka@siemens.com> - 2017-05-26 18:10 +0200
    Re: [PATCH v3 03/10] gpio-exar/8250-exar: Fix passing in of parent  PCI device Andy Shevchenko <andy.shevchenko@gmail.com> - 2017-05-27 15:50 +0200
    Re: [PATCH v3 03/10] gpio-exar/8250-exar: Fix passing in of parent  PCI device Linus Walleij <linus.walleij@linaro.org> - 2017-05-29 14:40 +0200
  [PATCH v3 05/10] gpio: exar: Fix iomap request Jan Kiszka <jan.kiszka@siemens.com> - 2017-05-26 18:10 +0200
    Re: [PATCH v3 05/10] gpio: exar: Fix iomap request Linus Walleij <linus.walleij@linaro.org> - 2017-05-29 14:40 +0200
  Re: [PATCH v3 00/10] serial/gpio: exar: Fixes and support for IOT2000 Linus Walleij <linus.walleij@linaro.org> - 2017-05-29 14:40 +0200
    Re: [PATCH v3 00/10] serial/gpio: exar: Fixes and support for IOT2000 Jan Kiszka <jan.kiszka@siemens.com> - 2017-05-29 15:50 +0200
      Re: [PATCH v3 00/10] serial/gpio: exar: Fixes and support for IOT2000 Linus Walleij <linus.walleij@linaro.org> - 2017-05-31 02:10 +0200

csiph-web