From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 280C7C3279B for ; Tue, 10 Jul 2018 15:40:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CC0DC208E8 for ; Tue, 10 Jul 2018 15:40:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CC0DC208E8 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934352AbeGJPky (ORCPT ); Tue, 10 Jul 2018 11:40:54 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:49170 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934327AbeGJPkv (ORCPT ); Tue, 10 Jul 2018 11:40:51 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 5BD65168F; Tue, 10 Jul 2018 08:40:51 -0700 (PDT) Received: from approximate.cambridge.arm.com (approximate.cambridge.arm.com [10.1.206.75]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 721083F589; Tue, 10 Jul 2018 08:40:50 -0700 (PDT) From: Marc Zyngier To: Zhang Rui , Eduardo Valentin Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/2] thermal_hwmon: Pass the originating device down to hwmon_device_register_with_info Date: Tue, 10 Jul 2018 16:40:35 +0100 Message-Id: <20180710154035.26828-3-marc.zyngier@arm.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180710154035.26828-1-marc.zyngier@arm.com> References: <20180710154035.26828-1-marc.zyngier@arm.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When registering the hwmon device, we pass NULL as the device. While this doesn't result in any immediate breakage, it leaves the hwmon device at the root of the virtual devices, rather than attached to the thermal zone hierarchy. Instead, let's pass the actual device, which is part of the thermal_zone_device structure. This also avoids the rather unpleasant ""NULL device *" which can be generated by dev_{err,info} in the hwmon subsystem. Signed-off-by: Marc Zyngier --- drivers/thermal/thermal_hwmon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/thermal/thermal_hwmon.c b/drivers/thermal/thermal_hwmon.c index 0bd47007c57f..40c69a533b24 100644 --- a/drivers/thermal/thermal_hwmon.c +++ b/drivers/thermal/thermal_hwmon.c @@ -143,7 +143,7 @@ int thermal_add_hwmon_sysfs(struct thermal_zone_device *tz) INIT_LIST_HEAD(&hwmon->tz_list); strlcpy(hwmon->type, tz->type, THERMAL_NAME_LENGTH); strreplace(hwmon->type, '-', '_'); - hwmon->device = hwmon_device_register_with_info(NULL, hwmon->type, + hwmon->device = hwmon_device_register_with_info(&tz->device, hwmon->type, hwmon, NULL, NULL); if (IS_ERR(hwmon->device)) { result = PTR_ERR(hwmon->device); -- 2.18.0