Skip to content

Commit

Permalink
i2c: designware: use to_pci_dev()
Browse files Browse the repository at this point in the history
Use to_pci_dev() instead of open-coding it.

Signed-off-by: Geliang Tang <geliangtang@163.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
  • Loading branch information
Geliang Tang authored and Wolfram Sang committed Jan 3, 2016
1 parent e2e5a2c commit 238c44a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/i2c/busses/i2c-designware-pcidrv.c
Original file line number Diff line number Diff line change
Expand Up @@ -162,15 +162,15 @@ 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;
}

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));
}
Expand Down

0 comments on commit 238c44a

Please sign in to comment.