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


Groups > linux.kernel > #1298342 > unrolled thread

[PATCH 7/9] serial: 8250_pci: use to_pci_dev()

Started byGeliang Tang <geliangtang@163.com>
First post2015-12-27 11:50 +0100
Last post2015-12-27 15:40 +0100
Articles 3 — 2 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.


Contents

  [PATCH 7/9] serial: 8250_pci: use to_pci_dev() Geliang Tang <geliangtang@163.com> - 2015-12-27 11:50 +0100
    Re: [PATCH 7/9] serial: 8250_pci: use to_pci_dev() Andy Shevchenko <andy.shevchenko@gmail.com> - 2015-12-27 13:40 +0100
      [PATCH 7/9 v2] serial: 8250_pci: use to_pci_dev() Geliang Tang <geliangtang@163.com> - 2015-12-27 15:40 +0100

#1298342 — [PATCH 7/9] serial: 8250_pci: use to_pci_dev()

FromGeliang Tang <geliangtang@163.com>
Date2015-12-27 11:50 +0100
Subject[PATCH 7/9] serial: 8250_pci: use to_pci_dev()
Message-ID<qKh3H-5KU-1@gated-at.bofh.it>
Use to_pci_dev() instead of open-coding it.

Signed-off-by: Geliang Tang <geliangtang@163.com>
---
 drivers/tty/serial/8250/8250_pci.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/tty/serial/8250/8250_pci.c b/drivers/tty/serial/8250/8250_pci.c
index 4097f3f..afdd2c67 100644
--- a/drivers/tty/serial/8250/8250_pci.c
+++ b/drivers/tty/serial/8250/8250_pci.c
@@ -1538,8 +1538,7 @@ static int pci_fintek_rs485_config(struct uart_port *port,
 {
 	u8 setting;
 	u8 *index = (u8 *) port->private_data;
-	struct pci_dev *pci_dev = container_of(port->dev, struct pci_dev,
-						dev);
+	struct pci_dev *pci_dev = to_pci_dev(port->dev);
 
 	pci_read_config_byte(pci_dev, 0x40 + 8 * *index + 7, &setting);
 
-- 
2.5.0


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1298364

FromAndy Shevchenko <andy.shevchenko@gmail.com>
Date2015-12-27 13:40 +0100
Message-ID<qKiMd-6VS-89@gated-at.bofh.it>
In reply to#1298342
On Sun, Dec 27, 2015 at 12:46 PM, Geliang Tang <geliangtang@163.com> wrote:
> Use to_pci_dev() instead of open-coding it.
>
> Signed-off-by: Geliang Tang <geliangtang@163.com>
> ---
>  drivers/tty/serial/8250/8250_pci.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/tty/serial/8250/8250_pci.c b/drivers/tty/serial/8250/8250_pci.c
> index 4097f3f..afdd2c67 100644
> --- a/drivers/tty/serial/8250/8250_pci.c
> +++ b/drivers/tty/serial/8250/8250_pci.c
> @@ -1538,8 +1538,7 @@ static int pci_fintek_rs485_config(struct uart_port *port,
>  {
>         u8 setting;
>         u8 *index = (u8 *) port->private_data;
> -       struct pci_dev *pci_dev = container_of(port->dev, struct pci_dev,
> -                                               dev);
> +       struct pci_dev *pci_dev = to_pci_dev(port->dev);

I would make it first line in this block.
Otherwise,
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

>
>         pci_read_config_byte(pci_dev, 0x40 + 8 * *index + 7, &setting);
>


-- 
With Best Regards,
Andy Shevchenko
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1298402 — [PATCH 7/9 v2] serial: 8250_pci: use to_pci_dev()

FromGeliang Tang <geliangtang@163.com>
Date2015-12-27 15:40 +0100
Subject[PATCH 7/9 v2] serial: 8250_pci: use to_pci_dev()
Message-ID<qKkEh-8dl-9@gated-at.bofh.it>
In reply to#1298364
Use to_pci_dev() instead of open-coding it.

Signed-off-by: Geliang Tang <geliangtang@163.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
Changes in v2:
 - Made it first line in this block.
---
 drivers/tty/serial/8250/8250_pci.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/tty/serial/8250/8250_pci.c b/drivers/tty/serial/8250/8250_pci.c
index 4097f3f..75182c9 100644
--- a/drivers/tty/serial/8250/8250_pci.c
+++ b/drivers/tty/serial/8250/8250_pci.c
@@ -1536,10 +1536,9 @@ pci_brcm_trumanage_setup(struct serial_private *priv,
 static int pci_fintek_rs485_config(struct uart_port *port,
 			       struct serial_rs485 *rs485)
 {
+	struct pci_dev *pci_dev = to_pci_dev(port->dev);
 	u8 setting;
 	u8 *index = (u8 *) port->private_data;
-	struct pci_dev *pci_dev = container_of(port->dev, struct pci_dev,
-						dev);
 
 	pci_read_config_byte(pci_dev, 0x40 + 8 * *index + 7, &setting);
 
-- 
2.5.0


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web