Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp255050ybg; Fri, 12 Jun 2020 00:09:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxyUjtUE4CsERB7AM/ySG6GJb+bFHtZlxb/UKJd1ky2IsSgbxcUQzxSDWUG9ACSWtwhyjnR X-Received: by 2002:a05:6402:1592:: with SMTP id c18mr10935513edv.40.1591945765002; Fri, 12 Jun 2020 00:09:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591945764; cv=none; d=google.com; s=arc-20160816; b=OK5nLjNjaI65AgyFakBTmngA0Q+e7P9SepI+9GYVc2UMBFxhuUdHR0yG0qZW9AK79m sDSUwhcO53wfY/6fBd12HQg07/J1lO6MkI+nfYyOsJdDQrkyZ8CiIoWTq/D+W3RL3Y/5 dAAmjWN5KQbV6uKX/PoVubItlMrEe8kaMukM+Q/bcvyiyL2S5FZWU9B8C50NN2mcCeAI Gg0fg6xmtC9eu27wFlfqVaJHKncaohWNnzMjnvVTVzj4yZOje84uhH/6iowIE7PkneoM cJgnX6grUSKGgkdpp5XYxElMtKUh7es7+zI9QiKQM2QwM7PczowNlCjrQBBr6VeGOAdb Yjlg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=wRLjQ7Q4BwyWTGWNXBBR6aMZo6+Qdr50+BLbZ/SCgUA=; b=QzM2N14UWzvwG9YiwKu3cUBRiwD2IgW0I58Q6RBUSrkj3yQ5T3R3Sk5FdOGgehT4EA b1WuP0W1Bo08EGPE4vID2jK0RLDAC+Zzrn+UnOYL5Nq+VZF52Cwuxz/QcVShELr/KqyW Rz2FRVxw5B+xpLrnFf4jZYjm3i8uzt1ylcH0n0geOWRXx4T9fJLpPrI/8O6g4cek9yIk iU0kPL3yUkspBOkhuppChx9x4bhJ7xqvAgiMh/9MtI2cYr4/p3qXGspdJ5lmThW3tHzb c2EXqZexFqyrxy3pNMjCN3JtPD6lji3sm/Yy4QM+wyJ6oPIGVPrJRSYzFwPop3gSNuZL uDOA== 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 me26si3393233ejb.444.2020.06.12.00.09.02; Fri, 12 Jun 2020 00:09:24 -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 S1726468AbgFLHFM (ORCPT + 99 others); Fri, 12 Jun 2020 03:05:12 -0400 Received: from m17617.mail.qiye.163.com ([59.111.176.17]:46516 "EHLO m17617.mail.qiye.163.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726287AbgFLHFL (ORCPT ); Fri, 12 Jun 2020 03:05:11 -0400 X-Greylist: delayed 533 seconds by postgrey-1.27 at vger.kernel.org; Fri, 12 Jun 2020 03:05:11 EDT Received: from vivo-HP-ProDesk-680-G4-PCI-MT.vivo.xyz (unknown [58.251.74.227]) by m17617.mail.qiye.163.com (Hmail) with ESMTPA id 0A2A2261424; Fri, 12 Jun 2020 14:56:14 +0800 (CST) From: Wang Qing To: Sebastian Reichel , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Wang Qing Subject: [PATCH] drivers\power\supply: use kobj_to_dev Date: Fri, 12 Jun 2020 14:55:54 +0800 Message-Id: <1591944954-14411-1-git-send-email-wangqing@vivo.com> X-Mailer: git-send-email 2.7.4 X-HM-Spam-Status: e1kfGhgUHx5ZQUpXWQgYFAkeWUFZS1VLWVdZKFlBSE83V1ktWUFJV1kPCR oVCBIfWUFZGkJIShgYHhoeH0kYVkpOQkpCT09CTE9ISk5VEwETFhoSFyQUDg9ZV1kWGg8SFR0UWU FZT0tIVUpKS0hKQ1VKS0tZBg++ X-HM-Sender-Digest: e1kMHhlZQR0aFwgeV1kSHx4VD1lBWUc6MCo6Izo5Cjg4AQs8UU0cGR1R Ez1PCQhVSlVKTkJKQk9PQkxPTU1IVTMWGhIXVQwaFRwKEhUcOw0SDRRVGBQWRVlXWRILWUFZTkNV SU5KVUxPVUlJTFlXWQgBWUFKTk9JNwY+ X-HM-Tid: 0a72a7508f5f9375kuws0a2a2261424 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use kobj_to_dev() API instead of container_of(). Signed-off-by: Wang Qing --- drivers/power/supply/power_supply_sysfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) mode change 100644 => 100755 drivers/power/supply/power_supply_sysfs.c diff --git a/drivers/power/supply/power_supply_sysfs.c b/drivers/power/supply/power_supply_sysfs.c index bc79560..af0cad2 --- a/drivers/power/supply/power_supply_sysfs.c +++ b/drivers/power/supply/power_supply_sysfs.c @@ -343,7 +343,7 @@ static umode_t power_supply_attr_is_visible(struct kobject *kobj, struct attribute *attr, int attrno) { - struct device *dev = container_of(kobj, struct device, kobj); + struct device *dev = kobj_to_dev(kobj); struct power_supply *psy = dev_get_drvdata(dev); umode_t mode = S_IRUSR | S_IRGRP | S_IROTH; int i; -- 2.7.4