2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2025-01-08 21:53:54 +08:00

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>
This commit is contained in:
Chuhong Yuan 2019-07-23 19:11:10 +08:00 committed by Wolfram Sang
parent 5667b5b59f
commit 7735eeebd2
2 changed files with 3 additions and 6 deletions

View File

@ -173,8 +173,7 @@ static struct dw_pci_controller dw_pci_controllers[] = {
#ifdef CONFIG_PM #ifdef CONFIG_PM
static int i2c_dw_pci_suspend(struct device *dev) static int i2c_dw_pci_suspend(struct device *dev)
{ {
struct pci_dev *pdev = to_pci_dev(dev); struct dw_i2c_dev *i_dev = dev_get_drvdata(dev);
struct dw_i2c_dev *i_dev = pci_get_drvdata(pdev);
i_dev->suspended = true; i_dev->suspended = true;
i_dev->disable(i_dev); 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) static int i2c_dw_pci_resume(struct device *dev)
{ {
struct pci_dev *pdev = to_pci_dev(dev); struct dw_i2c_dev *i_dev = dev_get_drvdata(dev);
struct dw_i2c_dev *i_dev = pci_get_drvdata(pdev);
int ret; int ret;
ret = i_dev->init(i_dev); ret = i_dev->init(i_dev);

View File

@ -1912,8 +1912,7 @@ static int i801_suspend(struct device *dev)
static int i801_resume(struct device *dev) static int i801_resume(struct device *dev)
{ {
struct pci_dev *pci_dev = to_pci_dev(dev); struct i801_priv *priv = dev_get_drvdata(dev);
struct i801_priv *priv = pci_get_drvdata(pci_dev);
i801_enable_host_notify(&priv->adapter); i801_enable_host_notify(&priv->adapter);