Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 358779
b: refs/heads/master
c: 7272194
h: refs/heads/master
i:
  358777: 9158489
  358775: d8d2d70
v: v3
  • Loading branch information
Mika Westerberg authored and Wolfram Sang committed Jan 28, 2013
1 parent d3ec162 commit b35cf64
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 17a76b4b32aca7c19df6988213dfe2eb4b631431
refs/heads/master: 7272194ed391f9db8bb320c50d715e7e6bba8ff3
10 changes: 10 additions & 0 deletions trunk/drivers/i2c/busses/i2c-designware-platdrv.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
#include <linux/of_i2c.h>
#include <linux/platform_device.h>
#include <linux/pm.h>
#include <linux/pm_runtime.h>
#include <linux/io.h>
#include <linux/slab.h>
#include "i2c-designware-core.h"
Expand Down Expand Up @@ -149,6 +150,10 @@ static int dw_i2c_probe(struct platform_device *pdev)
}
of_i2c_register_devices(adap);

pm_runtime_set_active(&pdev->dev);
pm_runtime_enable(&pdev->dev);
pm_runtime_put(&pdev->dev);

return 0;

err_free_irq:
Expand All @@ -175,6 +180,8 @@ static int dw_i2c_remove(struct platform_device *pdev)
struct resource *mem;

platform_set_drvdata(pdev, NULL);
pm_runtime_get_sync(&pdev->dev);

i2c_del_adapter(&dev->adapter);
put_device(&pdev->dev);

Expand All @@ -186,6 +193,9 @@ static int dw_i2c_remove(struct platform_device *pdev)
free_irq(dev->irq, dev);
kfree(dev);

pm_runtime_put(&pdev->dev);
pm_runtime_disable(&pdev->dev);

mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
release_mem_region(mem->start, resource_size(mem));
return 0;
Expand Down

0 comments on commit b35cf64

Please sign in to comment.