@@ -658,9 +658,10 @@ static int __devexit tegra_kbc_remove(struct platform_device *pdev)
return 0;
}
-#ifdef CONFIG_PM
-static int tegra_kbc_suspend(struct platform_device *pdev, pm_message_t state)
+#ifdef CONFIG_PM_SLEEP
+static int tegra_kbc_suspend(struct device *dev)
{
+ struct platform_device *pdev = to_platform_device(dev);
struct tegra_kbc *kbc = platform_get_drvdata(pdev);
if (device_may_wakeup(&pdev->dev)) {
@@ -679,8 +680,9 @@ static int tegra_kbc_suspend(struct platform_device *pdev, pm_message_t state)
return 0;
}
-static int tegra_kbc_resume(struct platform_device *pdev)
+static int tegra_kbc_resume(struct device *dev)
{
+ struct platform_device *pdev = to_platform_device(dev);
struct tegra_kbc *kbc = platform_get_drvdata(pdev);
int err = 0;
@@ -698,17 +700,16 @@ static int tegra_kbc_resume(struct platform_device *pdev)
}
#endif
+static SIMPLE_DEV_PM_OPS(tegra_kbc_pm_ops, tegra_kbc_suspend, tegra_kbc_resume);
+
static struct platform_driver tegra_kbc_driver = {
.probe = tegra_kbc_probe,
.remove = __devexit_p(tegra_kbc_remove),
-#ifdef CONFIG_PM
- .suspend = tegra_kbc_suspend,
- .resume = tegra_kbc_resume,
-#endif
.driver = {
.name = "tegra-kbc",
.owner = THIS_MODULE,
- }
+ .pm = &tegra_kbc_pm_ops,
+ },
};
static void __exit tegra_kbc_exit(void)