linux-i2c.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 3/9] i2c: designware: use to_pci_dev()
       [not found] <baf4e17c993f197cc31f8a0e5736ee8a558ba44c.1451211133.git.geliangtang@163.com>
@ 2015-12-27 10:45 ` Geliang Tang
  2015-12-27 12:40   ` Andy Shevchenko
  2016-01-03 18:54   ` Wolfram Sang
  0 siblings, 2 replies; 3+ messages in thread
From: Geliang Tang @ 2015-12-27 10:45 UTC (permalink / raw)
  To: Andy Shevchenko, Jarkko Nikula, Mika Westerberg, Wolfram Sang
  Cc: Geliang Tang, linux-i2c, linux-kernel

Use to_pci_dev() instead of open-coding it.

Signed-off-by: Geliang Tang <geliangtang@163.com>
---
 drivers/i2c/busses/i2c-designware-pcidrv.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/i2c/busses/i2c-designware-pcidrv.c b/drivers/i2c/busses/i2c-designware-pcidrv.c
index 1543d35d..7368be0 100644
--- a/drivers/i2c/busses/i2c-designware-pcidrv.c
+++ b/drivers/i2c/busses/i2c-designware-pcidrv.c
@@ -162,7 +162,7 @@ static struct dw_pci_controller dw_pci_controllers[] = {
 #ifdef CONFIG_PM
 static int i2c_dw_pci_suspend(struct device *dev)
 {
-	struct pci_dev *pdev = container_of(dev, struct pci_dev, dev);
+	struct pci_dev *pdev = to_pci_dev(dev);
 
 	i2c_dw_disable(pci_get_drvdata(pdev));
 	return 0;
@@ -170,7 +170,7 @@ static int i2c_dw_pci_suspend(struct device *dev)
 
 static int i2c_dw_pci_resume(struct device *dev)
 {
-	struct pci_dev *pdev = container_of(dev, struct pci_dev, dev);
+	struct pci_dev *pdev = to_pci_dev(dev);
 
 	return i2c_dw_init(pci_get_drvdata(pdev));
 }
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 3/9] i2c: designware: use to_pci_dev()
  2015-12-27 10:45 ` [PATCH 3/9] i2c: designware: use to_pci_dev() Geliang Tang
@ 2015-12-27 12:40   ` Andy Shevchenko
  2016-01-03 18:54   ` Wolfram Sang
  1 sibling, 0 replies; 3+ messages in thread
From: Andy Shevchenko @ 2015-12-27 12:40 UTC (permalink / raw)
  To: Geliang Tang
  Cc: Andy Shevchenko, Jarkko Nikula, Mika Westerberg, Wolfram Sang,
	linux-i2c, linux-kernel@vger.kernel.org

On Sun, Dec 27, 2015 at 12:45 PM, Geliang Tang <geliangtang@163.com> wrote:
> Use to_pci_dev() instead of open-coding it.
>

Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

> Signed-off-by: Geliang Tang <geliangtang@163.com>
> ---
>  drivers/i2c/busses/i2c-designware-pcidrv.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/i2c/busses/i2c-designware-pcidrv.c b/drivers/i2c/busses/i2c-designware-pcidrv.c
> index 1543d35d..7368be0 100644
> --- a/drivers/i2c/busses/i2c-designware-pcidrv.c
> +++ b/drivers/i2c/busses/i2c-designware-pcidrv.c
> @@ -162,7 +162,7 @@ static struct dw_pci_controller dw_pci_controllers[] = {
>  #ifdef CONFIG_PM
>  static int i2c_dw_pci_suspend(struct device *dev)
>  {
> -       struct pci_dev *pdev = container_of(dev, struct pci_dev, dev);
> +       struct pci_dev *pdev = to_pci_dev(dev);
>
>         i2c_dw_disable(pci_get_drvdata(pdev));
>         return 0;
> @@ -170,7 +170,7 @@ static int i2c_dw_pci_suspend(struct device *dev)
>
>  static int i2c_dw_pci_resume(struct device *dev)
>  {
> -       struct pci_dev *pdev = container_of(dev, struct pci_dev, dev);
> +       struct pci_dev *pdev = to_pci_dev(dev);
>
>         return i2c_dw_init(pci_get_drvdata(pdev));
>  }
> --
> 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/



-- 
With Best Regards,
Andy Shevchenko

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 3/9] i2c: designware: use to_pci_dev()
  2015-12-27 10:45 ` [PATCH 3/9] i2c: designware: use to_pci_dev() Geliang Tang
  2015-12-27 12:40   ` Andy Shevchenko
@ 2016-01-03 18:54   ` Wolfram Sang
  1 sibling, 0 replies; 3+ messages in thread
From: Wolfram Sang @ 2016-01-03 18:54 UTC (permalink / raw)
  To: Geliang Tang
  Cc: Andy Shevchenko, Jarkko Nikula, Mika Westerberg, linux-i2c,
	linux-kernel

[-- Attachment #1: Type: text/plain, Size: 201 bytes --]

On Sun, Dec 27, 2015 at 06:45:59PM +0800, Geliang Tang wrote:
> Use to_pci_dev() instead of open-coding it.
> 
> Signed-off-by: Geliang Tang <geliangtang@163.com>

Applied to for-next, thanks!


[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-01-03 18:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <baf4e17c993f197cc31f8a0e5736ee8a558ba44c.1451211133.git.geliangtang@163.com>
2015-12-27 10:45 ` [PATCH 3/9] i2c: designware: use to_pci_dev() Geliang Tang
2015-12-27 12:40   ` Andy Shevchenko
2016-01-03 18:54   ` Wolfram Sang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).