diff options
author | Chuhong Yuan <hslester96@gmail.com> | 2019-07-23 14:11:10 +0300 |
---|---|---|
committer | Wolfram Sang <wsa@the-dreams.de> | 2019-08-01 15:55:22 +0300 |
commit | 7735eeebd2be26d6d3fa151c85d839d62d710d93 (patch) | |
tree | 38734dd58c47ebb8dc9b3c01ed86577bf404bace /drivers/i2c/busses/i2c-designware-pcidrv.c | |
parent | 5667b5b59f45bd0bebadfae9ed55745b4cff2198 (diff) | |
download | linux-7735eeebd2be26d6d3fa151c85d839d62d710d93.tar.xz |
i2c: busses: Use dev_get_drvdata where possible
Instead of using to_pci_dev + pci_get_drvdata,
use dev_get_drvdata to make code simpler.
Signed-off-by: Chuhong Yuan <hslester96@gmail.com>
Reviewed-by: Jean Delvare <jdelvare@suse.de>
Acked-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Diffstat (limited to 'drivers/i2c/busses/i2c-designware-pcidrv.c')
-rw-r--r-- | drivers/i2c/busses/i2c-designware-pcidrv.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/i2c/busses/i2c-designware-pcidrv.c b/drivers/i2c/busses/i2c-designware-pcidrv.c index 76810deb2de6..7d2e6959679c 100644 --- a/drivers/i2c/busses/i2c-designware-pcidrv.c +++ b/drivers/i2c/busses/i2c-designware-pcidrv.c @@ -173,8 +173,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 = to_pci_dev(dev); - struct dw_i2c_dev *i_dev = pci_get_drvdata(pdev); + struct dw_i2c_dev *i_dev = dev_get_drvdata(dev); i_dev->suspended = true; i_dev->disable(i_dev); @@ -184,8 +183,7 @@ static int i2c_dw_pci_suspend(struct device *dev) static int i2c_dw_pci_resume(struct device *dev) { - struct pci_dev *pdev = to_pci_dev(dev); - struct dw_i2c_dev *i_dev = pci_get_drvdata(pdev); + struct dw_i2c_dev *i_dev = dev_get_drvdata(dev); int ret; ret = i_dev->init(i_dev); |