platform/chrome: Use kobj_to_dev() instead of container_of()
[sfrench/cifs-2.6.git] / drivers / platform / chrome / cros_ec_vbc.c
index 46482d12cffedfdf5d0205c53397eff418363a8b..f3a70a312b438f5be463281907e385a637d8fa1a 100644 (file)
@@ -17,7 +17,7 @@ static ssize_t vboot_context_read(struct file *filp, struct kobject *kobj,
                                  struct bin_attribute *att, char *buf,
                                  loff_t pos, size_t count)
 {
-       struct device *dev = container_of(kobj, struct device, kobj);
+       struct device *dev = kobj_to_dev(kobj);
        struct cros_ec_dev *ec = to_cros_ec_dev(dev);
        struct cros_ec_device *ecdev = ec->ec_dev;
        struct ec_params_vbnvcontext *params;
@@ -57,7 +57,7 @@ static ssize_t vboot_context_write(struct file *filp, struct kobject *kobj,
                                   struct bin_attribute *attr, char *buf,
                                   loff_t pos, size_t count)
 {
-       struct device *dev = container_of(kobj, struct device, kobj);
+       struct device *dev = kobj_to_dev(kobj);
        struct cros_ec_dev *ec = to_cros_ec_dev(dev);
        struct cros_ec_device *ecdev = ec->ec_dev;
        struct ec_params_vbnvcontext *params;