From: Geliang Tang <geliangt...@163.com>

Use to_pci_dev() instead of open-coding it.

Signed-off-by: Geliang Tang <geliangt...@163.com>
Reviewed-by: Andy Shevchenko <andriy.shevche...@linux.intel.com>
Signed-off-by: Wolfram Sang <w...@the-dreams.de>
(cherry picked from commit 238c44a70c0637765709c78eeaddb2a3d3674b88)
Signed-off-by: Voon, Weifeng <weifeng.v...@intel.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 6643d2d..07d7008 100644
--- a/drivers/i2c/busses/i2c-designware-pcidrv.c
+++ b/drivers/i2c/busses/i2c-designware-pcidrv.c
@@ -166,7 +166,7 @@ static struct i2c_algorithm i2c_dw_algo = {
 #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;
@@ -174,7 +174,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));
 }
-- 
1.9.1

-- 
_______________________________________________
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto

Reply via email to