Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1658769pxk; Sat, 26 Sep 2020 00:05:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx9xG2ga9hFgA5FCFC09pp/o+TedA1vcDo0NCGZ0T/Lgqsj9uVQnzw6KUMNSVjdcPfKDzaP X-Received: by 2002:a17:906:9718:: with SMTP id k24mr5940435ejx.365.1601103910009; Sat, 26 Sep 2020 00:05:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601103910; cv=none; d=google.com; s=arc-20160816; b=P5C5MZIyfaD51DomS+qAh+/z/vVtQWFNLSCdxe3XfqY9hP6R6x6GcXgS58hZT4cKoj T/SJmBM2YusTc3nb+zDYP/bMa9mUV04PxQrWpYAuyIBfjxXbTX/sfZNyd7Ml/RCo3OuK /Z9QyNjJf1/IFnPQkx+STCqLpCkQ72GltJKWiYLU6tPBSTtHK63IL1LAMH+iLjsEvIPN Mh7EcgwJuUrUWH5NBiVxY1ioZl7dsOqRpLS292swXAv1XT/QwbtVGDSJw/Ka8/0SDafo LmZOSt0ZjuNNXdQpd285znwjENonyD3w/jmRKQGR5TjP3lZdNjuGYLsyioeAxyKKU/Fe dSjw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from; bh=S/oRdq+jE0Q14JhG0QFhSWWg7iZL3T7tYbCPCqdK2k8=; b=uUoKfelYeZqYh4Fja3r/mgLKLOkbwqtAcmVi3ivbWryoYo/ndAnRBgVwDRl1tQ4dZK BUUKdL0HWJt9vtZ7PciST3uTK8pxRgU/+EQyoefrequwxqkeFFbr/632UBXpX3Vx6Zc7 muxTMMIGbnr/VbeOcRl0oouW0PcSS+B0kJcrnCDQys4oeLbABwJ+HaH7/umHIQDmMYxa OlfSqsJb/+KgkmUrmEPszlZRGPWPuqRR9YHJjiuj++iwJGEezzluPp4dDYESkD6apDxN u/O10Ub6nK3Vfv4X+k30p1pmkH8v4cZpYYn79cRRMSA6vLrApPrA9xdnJ99XICsrXF0u mqgA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p15si3644983eds.494.2020.09.26.00.04.46; Sat, 26 Sep 2020 00:05:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726587AbgIZHDt (ORCPT + 99 others); Sat, 26 Sep 2020 03:03:49 -0400 Received: from m17618.mail.qiye.163.com ([59.111.176.18]:35455 "EHLO m17618.mail.qiye.163.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726210AbgIZHDt (ORCPT ); Sat, 26 Sep 2020 03:03:49 -0400 Received: from vivo-HP-ProDesk-680-G4-PCI-MT.vivo.xyz (unknown [58.251.74.231]) by m17618.mail.qiye.163.com (Hmail) with ESMTPA id 9256D4E1559; Sat, 26 Sep 2020 15:03:46 +0800 (CST) From: Wang Qing To: Benson Leung , Enric Balletbo i Serra , Guenter Roeck , linux-kernel@vger.kernel.org Cc: Wang Qing Subject: [PATCH] chrome: Use kobj_to_dev() instead Date: Sat, 26 Sep 2020 15:03:37 +0800 Message-Id: <1601103820-14002-1-git-send-email-wangqing@vivo.com> X-Mailer: git-send-email 2.7.4 X-HM-Spam-Status: e1kfGhgUHx5ZQUtXWQgYFAkeWUFZS1VLWVdZKFlBSE83V1ktWUFJV1kPCR oVCBIfWUFZT08YQkJMQ00aGEhKVkpNS0pKS0hDSU1DSEpVEwETFhoSFyQUDg9ZV1kWGg8SFR0UWU FZT0tIVUpKS0hKTFVLWQY+ X-HM-Sender-Digest: e1kMHhlZQR0aFwgeV1kSHx4VD1lBWUc6MRQ6PQw6TD8vPAECSjczHh8a DhIaCS5VSlVKTUtKSktIQ0lMT05KVTMWGhIXVQwaFRwKEhUcOw0SDRRVGBQWRVlXWRILWUFZTkNV SU5KVUxPVUlISllXWQgBWUFJTEpDNwY+ X-HM-Tid: 0a74c9398f4b9376kuws9256d4e1559 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use kobj_to_dev() instead of container_of(). Signed-off-by: Wang Qing --- drivers/platform/chrome/cros_ec_sysfs.c | 2 +- drivers/platform/chrome/cros_ec_vbc.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/platform/chrome/cros_ec_sysfs.c b/drivers/platform/chrome/cros_ec_sysfs.c index d45ea5d..a643ea8 --- a/drivers/platform/chrome/cros_ec_sysfs.c +++ b/drivers/platform/chrome/cros_ec_sysfs.c @@ -326,7 +326,7 @@ static struct attribute *__ec_attrs[] = { static umode_t cros_ec_ctrl_visible(struct kobject *kobj, struct attribute *a, int n) { - 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); if (a == &dev_attr_kb_wake_angle.attr && !ec->has_kb_wake_angle) diff --git a/drivers/platform/chrome/cros_ec_vbc.c b/drivers/platform/chrome/cros_ec_vbc.c index 46482d1..f3a70a3 --- a/drivers/platform/chrome/cros_ec_vbc.c +++ b/drivers/platform/chrome/cros_ec_vbc.c @@ -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; -- 2.7.4