[linux-yocto] [PATCH 01/17] i2c: designware: use to_pci_dev()
weifeng.voon at intel.com
weifeng.voon at intel.com
Thu Mar 24 18:37:57 PDT 2016
From: Geliang Tang <geliangtang at 163.com>
Use to_pci_dev() instead of open-coding it.
Signed-off-by: Geliang Tang <geliangtang at 163.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko at linux.intel.com>
Signed-off-by: Wolfram Sang <wsa at the-dreams.de>
(cherry picked from commit 238c44a70c0637765709c78eeaddb2a3d3674b88)
Signed-off-by: Voon, Weifeng <weifeng.voon at 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
More information about the linux-yocto
mailing list