Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1651460 > unrolled thread
| Started by | Jan Kiszka <jan.kiszka@siemens.com> |
|---|---|
| First post | 2017-05-26 18:10 +0200 |
| Last post | 2017-05-29 14:40 +0200 |
| Articles | 3 — 3 participants |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
[PATCH v3 07/10] gpio-exar/8250-exar: Rearrange gpiochip parenthood Jan Kiszka <jan.kiszka@siemens.com> - 2017-05-26 18:10 +0200
Re: [PATCH v3 07/10] gpio-exar/8250-exar: Rearrange gpiochip parenthood Andy Shevchenko <andy.shevchenko@gmail.com> - 2017-05-27 15:50 +0200
Re: [PATCH v3 07/10] gpio-exar/8250-exar: Rearrange gpiochip parenthood Linus Walleij <linus.walleij@linaro.org> - 2017-05-29 14:40 +0200
| From | Jan Kiszka <jan.kiszka@siemens.com> |
|---|---|
| Date | 2017-05-26 18:10 +0200 |
| Subject | [PATCH v3 07/10] gpio-exar/8250-exar: Rearrange gpiochip parenthood |
| Message-ID | <tLpYm-83M-27@gated-at.bofh.it> |
Set the parent of the exar gpiochip to its platform device, like other
gpiochips are doing it. In order to keep the relationship discoverable
for ACPI systems, set the platform device companion to the PCI device.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
drivers/gpio/gpio-exar.c | 2 +-
drivers/tty/serial/8250/8250_exar.c | 2 ++
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/gpio/gpio-exar.c b/drivers/gpio/gpio-exar.c
index f3585a184f39..1a629831d45b 100644
--- a/drivers/gpio/gpio-exar.c
+++ b/drivers/gpio/gpio-exar.c
@@ -142,7 +142,7 @@ static int gpio_exar_probe(struct platform_device *pdev)
sprintf(exar_gpio->name, "exar_gpio%d", index);
exar_gpio->gpio_chip.label = exar_gpio->name;
- exar_gpio->gpio_chip.parent = &pcidev->dev;
+ exar_gpio->gpio_chip.parent = &pdev->dev;
exar_gpio->gpio_chip.direction_output = exar_direction_output;
exar_gpio->gpio_chip.direction_input = exar_direction_input;
exar_gpio->gpio_chip.get_direction = exar_get_direction;
diff --git a/drivers/tty/serial/8250/8250_exar.c b/drivers/tty/serial/8250/8250_exar.c
index 0f4b236d7e68..ee4b142f3ed0 100644
--- a/drivers/tty/serial/8250/8250_exar.c
+++ b/drivers/tty/serial/8250/8250_exar.c
@@ -9,6 +9,7 @@
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License.
*/
+#include <linux/acpi.h>
#include <linux/io.h>
#include <linux/kernel.h>
#include <linux/module.h>
@@ -204,6 +205,7 @@ xr17v35x_register_gpio(struct pci_dev *pcidev)
return NULL;
pdev->dev.parent = &pcidev->dev;
+ ACPI_COMPANION_SET(&pdev->dev, ACPI_COMPANION(&pcidev->dev));
if (platform_device_add(pdev) < 0) {
platform_device_put(pdev);
--
2.12.0
[toc] | [next] | [standalone]
| From | Andy Shevchenko <andy.shevchenko@gmail.com> |
|---|---|
| Date | 2017-05-27 15:50 +0200 |
| Message-ID | <tLKgp-4Gs-11@gated-at.bofh.it> |
| In reply to | #1651460 |
On Fri, May 26, 2017 at 7:02 PM, Jan Kiszka <jan.kiszka@siemens.com> wrote:
> Set the parent of the exar gpiochip to its platform device, like other
> gpiochips are doing it. In order to keep the relationship discoverable
> for ACPI systems, set the platform device companion to the PCI device.
>
Setting companion is a right thing to do (like it's done in other similar cases)
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 | 2 ++
> 2 files changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpio/gpio-exar.c b/drivers/gpio/gpio-exar.c
> index f3585a184f39..1a629831d45b 100644
> --- a/drivers/gpio/gpio-exar.c
> +++ b/drivers/gpio/gpio-exar.c
> @@ -142,7 +142,7 @@ static int gpio_exar_probe(struct platform_device *pdev)
>
> sprintf(exar_gpio->name, "exar_gpio%d", index);
> exar_gpio->gpio_chip.label = exar_gpio->name;
> - exar_gpio->gpio_chip.parent = &pcidev->dev;
> + exar_gpio->gpio_chip.parent = &pdev->dev;
> exar_gpio->gpio_chip.direction_output = exar_direction_output;
> exar_gpio->gpio_chip.direction_input = exar_direction_input;
> exar_gpio->gpio_chip.get_direction = exar_get_direction;
> diff --git a/drivers/tty/serial/8250/8250_exar.c b/drivers/tty/serial/8250/8250_exar.c
> index 0f4b236d7e68..ee4b142f3ed0 100644
> --- a/drivers/tty/serial/8250/8250_exar.c
> +++ b/drivers/tty/serial/8250/8250_exar.c
> @@ -9,6 +9,7 @@
> * it under the terms of the GNU General Public License as published by
> * the Free Software Foundation; either version 2 of the License.
> */
> +#include <linux/acpi.h>
> #include <linux/io.h>
> #include <linux/kernel.h>
> #include <linux/module.h>
> @@ -204,6 +205,7 @@ xr17v35x_register_gpio(struct pci_dev *pcidev)
> return NULL;
>
> pdev->dev.parent = &pcidev->dev;
> + ACPI_COMPANION_SET(&pdev->dev, ACPI_COMPANION(&pcidev->dev));
>
> if (platform_device_add(pdev) < 0) {
> platform_device_put(pdev);
> --
> 2.12.0
>
--
With Best Regards,
Andy Shevchenko
[toc] | [prev] | [next] | [standalone]
| From | Linus Walleij <linus.walleij@linaro.org> |
|---|---|
| Date | 2017-05-29 14:40 +0200 |
| Message-ID | <tMs7L-8i4-11@gated-at.bofh.it> |
| In reply to | #1651460 |
On Fri, May 26, 2017 at 6:02 PM, Jan Kiszka <jan.kiszka@siemens.com> wrote: > Set the parent of the exar gpiochip to its platform device, like other > gpiochips are doing it. In order to keep the relationship discoverable > for ACPI systems, set the platform device companion to the PCI device. > > Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Acked-by: Linus Walleij <linus.walleij@linaro.org> Yours, Linus Walleij
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web