Use to_pci_dev() instead of open-coding it.

Signed-off-by: Geliang Tang <geliangt...@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-i2c" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to