Skip to content

Commit

Permalink
platform/chrome: use to_platform_device()
Browse files Browse the repository at this point in the history
Use to_platform_device() instead of open-coding it.

Signed-off-by: Geliang Tang <[email protected]>
Signed-off-by: Olof Johansson <[email protected]>
  • Loading branch information
geliangtang authored and olofj committed May 11, 2016
1 parent f929efb commit 48b9b6d
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/platform/chrome/cros_ec_lightbar.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 48b9b6d

Please sign in to comment.