From patchwork Mon Jun 15 09:07:35 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?546L5pOO?= X-Patchwork-Id: 11604385 X-Patchwork-Delegate: rui.zhang@intel.com Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 028CF90 for ; Mon, 15 Jun 2020 09:07:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E856420679 for ; Mon, 15 Jun 2020 09:07:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729018AbgFOJHs (ORCPT ); Mon, 15 Jun 2020 05:07:48 -0400 Received: from m17617.mail.qiye.163.com ([59.111.176.17]:21415 "EHLO m17617.mail.qiye.163.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728852AbgFOJHr (ORCPT ); Mon, 15 Jun 2020 05:07:47 -0400 Received: from vivo-HP-ProDesk-680-G4-PCI-MT.vivo.xyz (unknown [58.251.74.226]) by m17617.mail.qiye.163.com (Hmail) with ESMTPA id 5016E262647; Mon, 15 Jun 2020 17:07:44 +0800 (CST) From: Wang Qing To: Zhang Rui , Daniel Lezcano , Amit Kucheria , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Wang Qing Subject: [PATCH] drivers/thermal: Use kobj_to_dev() instead Date: Mon, 15 Jun 2020 17:07:35 +0800 Message-Id: <1592212056-31955-1-git-send-email-wangqing@vivo.com> X-Mailer: git-send-email 2.7.4 X-HM-Spam-Status: e1kfGhgUHx5ZQUpXWQgYFAkeWUFZS1VLWVdZKFlBSE83V1ktWUFJV1kPCR oVCBIfWUFZGUpMHR8aGkgZGEJMVkpOQklJSklLTU9OTEhVEwETFhoSFyQUDg9ZV1kWGg8SFR0UWU FZT0tIVUpKS0hKTFVKS0tZBg++ X-HM-Sender-Digest: e1kMHhlZQR0aFwgeV1kSHx4VD1lBWUc6MFE6CCo*EDg0AQgVMw8KHBoU LS9PCS9VSlVKTkJJSUpJS01PQkJMVTMWGhIXVQwaFRwKEhUcOw0SDRRVGBQWRVlXWRILWUFZTkNV SU5KVUxPVUlJTVlXWQgBWUFJS0lNNwY+ X-HM-Tid: 0a72b73c090c9375kuws5016e262647 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Use kobj_to_dev() instead of container_of() Signed-off-by: Wang Qing Acked-by: Amit Kucheria --- drivers/thermal/thermal_sysfs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) mode change 100644 => 100755 drivers/thermal/thermal_sysfs.c diff --git a/drivers/thermal/thermal_sysfs.c b/drivers/thermal/thermal_sysfs.c index aa99edb..3e92ff9 --- a/drivers/thermal/thermal_sysfs.c +++ b/drivers/thermal/thermal_sysfs.c @@ -438,7 +438,7 @@ static umode_t thermal_zone_mode_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 thermal_zone_device *tz; tz = container_of(dev, struct thermal_zone_device, device); @@ -464,7 +464,7 @@ static umode_t thermal_zone_passive_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 thermal_zone_device *tz; enum thermal_trip_type trip_type; int count, passive = 0;