]> git.baikalelectronics.ru Git - kernel.git/commitdiff
platform/chrome: use to_platform_device()
authorGeliang Tang <geliangtang@163.com>
Sun, 27 Dec 2015 13:15:45 +0000 (21:15 +0800)
committerOlof Johansson <olof@lixom.net>
Wed, 11 May 2016 18:55:47 +0000 (11:55 -0700)
Use to_platform_device() instead of open-coding it.

Signed-off-by: Geliang Tang <geliangtang@163.com>
Signed-off-by: Olof Johansson <olof@lixom.net>
drivers/platform/chrome/cros_ec_lightbar.c

index ff7640575c751dfbc401486eee0f982c3527b1ff..a79fb86e1fb9914dfc536040a9784db5eb0d4379 100644 (file)
@@ -412,8 +412,7 @@ static umode_t cros_ec_lightbar_attrs_are_visible(struct kobject *kobj,
        struct device *dev = container_of(kobj, struct device, kobj);
        struct cros_ec_dev *ec = container_of(dev,
                                              struct cros_ec_dev, class_dev);
-       struct platform_device *pdev = container_of(ec->dev,
-                                                  struct platform_device, dev);
+       struct platform_device *pdev = to_platform_device(ec->dev);
        if (pdev->id != 0)
                return 0;