From: Geliang Tang Date: Sun, 27 Dec 2015 13:15:45 +0000 (+0800) Subject: platform/chrome: use to_platform_device() X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=48b9b6d4699e23cda45756b6a1fe5d481ba45914;p=linux-beck.git platform/chrome: use to_platform_device() Use to_platform_device() instead of open-coding it. Signed-off-by: Geliang Tang Signed-off-by: Olof Johansson --- diff --git a/drivers/platform/chrome/cros_ec_lightbar.c b/drivers/platform/chrome/cros_ec_lightbar.c index ff7640575c75..a79fb86e1fb9 100644 --- a/drivers/platform/chrome/cros_ec_lightbar.c +++ b/drivers/platform/chrome/cros_ec_lightbar.c @@ -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;