Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 319167
b: refs/heads/master
c: 6a7b3c3
h: refs/heads/master
i:
  319165: 68d5bb1
  319163: f7aa1ac
  319159: ae2e5a7
  319151: b2a425e
  319135: 974f21e
  319103: 0ed1403
v: v3
  • Loading branch information
Rafael J. Wysocki authored and Wolfram Sang committed Jul 12, 2012
1 parent cb00d89 commit d3981f8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4aacc4b1b13cecef90d9ccbf9cf3fb4cc99807a0
refs/heads/master: 6a7b3c3c465cef29d92dfc3fbbff0d958aa8be04
18 changes: 10 additions & 8 deletions trunk/drivers/i2c/busses/i2c-tegra.c
Original file line number Diff line number Diff line change
Expand Up @@ -713,9 +713,9 @@ static int __devexit tegra_i2c_remove(struct platform_device *pdev)
}

#ifdef CONFIG_PM
static int tegra_i2c_suspend(struct platform_device *pdev, pm_message_t state)
static int tegra_i2c_suspend(struct device *dev)
{
struct tegra_i2c_dev *i2c_dev = platform_get_drvdata(pdev);
struct tegra_i2c_dev *i2c_dev = dev_get_drvdata(dev);

i2c_lock_adapter(&i2c_dev->adapter);
i2c_dev->is_suspended = true;
Expand All @@ -724,9 +724,9 @@ static int tegra_i2c_suspend(struct platform_device *pdev, pm_message_t state)
return 0;
}

static int tegra_i2c_resume(struct platform_device *pdev)
static int tegra_i2c_resume(struct device *dev)
{
struct tegra_i2c_dev *i2c_dev = platform_get_drvdata(pdev);
struct tegra_i2c_dev *i2c_dev = dev_get_drvdata(dev);
int ret;

i2c_lock_adapter(&i2c_dev->adapter);
Expand All @@ -744,6 +744,11 @@ static int tegra_i2c_resume(struct platform_device *pdev)

return 0;
}

static SIMPLE_DEV_PM_OPS(tegra_i2c_pm, tegra_i2c_suspend, tegra_i2c_resume);
#define TEGRA_I2C_PM (&tegra_i2c_pm)
#else
#define TEGRA_I2C_PM NULL
#endif

#if defined(CONFIG_OF)
Expand All @@ -759,14 +764,11 @@ MODULE_DEVICE_TABLE(of, tegra_i2c_of_match);
static struct platform_driver tegra_i2c_driver = {
.probe = tegra_i2c_probe,
.remove = __devexit_p(tegra_i2c_remove),
#ifdef CONFIG_PM
.suspend = tegra_i2c_suspend,
.resume = tegra_i2c_resume,
#endif
.driver = {
.name = "tegra-i2c",
.owner = THIS_MODULE,
.of_match_table = of_match_ptr(tegra_i2c_of_match),
.pm = TEGRA_I2C_PM,
},
};

Expand Down

0 comments on commit d3981f8

Please sign in to comment.