input: sh_keysc suspend can use to_platform_device()
authorMagnus Damm <damm@igel.co.jp>
Wed, 11 Mar 2009 08:04:23 +0000 (08:04 +0000)
committerPaul Mundt <lethal@linux-sh.org>
Wed, 11 Mar 2009 08:19:42 +0000 (17:19 +0900)
This patch changes sh_keysc to use to_platform_device()
for suspend. Thanks to Trilok Soni for this suggestion.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Reviewed-by: Trilok Soni <soni.trilok@gmail.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
drivers/input/keyboard/sh_keysc.c

index bf92178644ab27ff92fdc5a86e89f3691d68305a..e1480fb11de3cfd4c1e62744eaf4a4b2bbe2e003 100644 (file)
@@ -257,13 +257,10 @@ static int __devexit sh_keysc_remove(struct platform_device *pdev)
 
 static int sh_keysc_suspend(struct device *dev)
 {
-       struct platform_device *pdev;
-       struct sh_keysc_priv *priv;
+       struct platform_device *pdev = to_platform_device(dev);
+       struct sh_keysc_priv *priv = platform_get_drvdata(pdev);
        unsigned short value;
 
-       pdev = container_of(dev, struct platform_device, dev);
-       priv = platform_get_drvdata(pdev);
-
        value = ioread16(priv->iomem_base + KYCR1_OFFS);
 
        if (device_may_wakeup(dev))