Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1086109ybt; Wed, 8 Jul 2020 20:57:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJztfAjiJR9eib/bd4yqKpdqG7ykSLi/W842oSsy1xaW2d0csFJDVfZyUTxXOLxDSGrMv+Lt X-Received: by 2002:aa7:db57:: with SMTP id n23mr69309193edt.235.1594267072230; Wed, 08 Jul 2020 20:57:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594267072; cv=none; d=google.com; s=arc-20160816; b=b0V1bSg8SxGzCyt2RCvx5mS+Mhh1NlIT9LYvQDRYOngNx3Q08RfebeFRzAxSs9mLQJ wxOgX7w8Pj0a5Ikb3eK5eTyTYQocdVn9JTmsLgGAcFR8vgHbjtXBJwPFVEIELziqeyR/ v4CcTGjVx/qgv+tVq9Fgtz9v/R4WfkC/CY1+2evBAFlKh9MtKFYa0XOrsLr0UxszbVDP m/KAhLUt8W9DDncBX9eXM6lcWPUl0x/pO0TZVDksc0w1/5ztsFSFhvLh7hPtL9DVY50e oEilWtjXWemZ6ukikQlZxMFMUeew0DVmfBvnuTl2wAIfLqK2khyWuGs0ql2DzTzBoSja OK1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=Qm/JxEpovdn9sehDKiu6ZVZhr1jNksodPD2EEyVI8ng=; b=tFOpfFKGJAxPXhHmoyhBdTeVQxAGoeSnsqCoCwCaVryXYloZ/RfIzfGeQ5QMVD4diM mYQP8R2aoxukD3nrXV7kFTB5kK7bD+TiX+r6jphSoZDVRUFNSE6ssuh/hpP0XrJ92hgN iHB+TL6ANOB9BNNMCEddm+Ag28ZBJym1WyXdQQ/2PiXCaUzSqQ1V51OKAq76NHl5RXFT tKF5HXZmcKv/+Bd8DF5eAhmrf2YDhSehoz7y4nU2/Jx/rTijpThjLAvOcU5vYemgVGNM If5xuM5Ctc+vjaGxf9zClrOG0ispJgIS2xhHuupiTEVwZ4gtsNGg6vOZ2lKUa/hyLTsk 6POQ== 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 bc21si1371243edb.51.2020.07.08.20.57.29; Wed, 08 Jul 2020 20:57:52 -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 S1726321AbgGIDzp (ORCPT + 99 others); Wed, 8 Jul 2020 23:55:45 -0400 Received: from mail.loongson.cn ([114.242.206.163]:49392 "EHLO loongson.cn" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726263AbgGIDzj (ORCPT ); Wed, 8 Jul 2020 23:55:39 -0400 Received: from linux.localdomain (unknown [113.200.148.30]) by mail.loongson.cn (Coremail) with SMTP id AQAAf9CxqdQplQZfXJUAAA--.714S5; Thu, 09 Jul 2020 11:55:34 +0800 (CST) From: Zhi Li To: chenhc@lemote.com, jiaxun.yang@flygoat.com, tsbogend@alpha.franken.de, lixuefeng@loongson.cn Cc: linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 3/3] MIPS: Loongson: Fix boot warning about hwmon_device_register() Date: Thu, 9 Jul 2020 11:55:21 +0800 Message-Id: <1594266921-28971-4-git-send-email-lizhi01@loongson.cn> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1594266921-28971-1-git-send-email-lizhi01@loongson.cn> References: <1594266921-28971-1-git-send-email-lizhi01@loongson.cn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IYs7 xG6r1j6r1xMIIF0xvEx4A2jsIE14v26r4j6F4UMIIF0xvEx4A2jsIEc7CjxVAFwI0_Gr0_ Gr1UYxBIdaVFxhVjvjDU0xZFpf9x0pRyGQkUUUUU= X-CM-SenderInfo: xol2xxqqr6z05rqj20fqof0/ Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Replace hwmon_device_register() with hwmon_device_register_with_info() to fix the following boot warning : [ 9.029924] Loongson Hwmon Enter... [ 9.106850] (NULL device *): hwmon_device_register() is deprecated. Please convert the driver to use hwmon_device_register_with_info(). Signed-off-by: Zhi Li --- drivers/platform/mips/cpu_hwmon.c | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/drivers/platform/mips/cpu_hwmon.c b/drivers/platform/mips/cpu_hwmon.c index c9f35e5..386389f 100644 --- a/drivers/platform/mips/cpu_hwmon.c +++ b/drivers/platform/mips/cpu_hwmon.c @@ -55,9 +55,7 @@ int loongson3_cpu_temp(int cpu) static int nr_packages; static struct device *cpu_hwmon_dev; -static ssize_t get_hwmon_name(struct device *dev, - struct device_attribute *attr, char *buf); -static SENSOR_DEVICE_ATTR(name, 0444, get_hwmon_name, NULL, 0); +static SENSOR_DEVICE_ATTR(name, 0444, NULL, NULL, 0); static struct attribute *cpu_hwmon_attributes[] = { &sensor_dev_attr_name.dev_attr.attr, @@ -69,13 +67,6 @@ static struct attribute_group cpu_hwmon_attribute_group = { .attrs = cpu_hwmon_attributes, }; -/* Hwmon device get name */ -static ssize_t get_hwmon_name(struct device *dev, - struct device_attribute *attr, char *buf) -{ - return sprintf(buf, "cpu-hwmon\n"); -} - static ssize_t get_cpu_temp(struct device *dev, struct device_attribute *attr, char *buf); static ssize_t cpu_temp_label(struct device *dev, @@ -176,7 +167,7 @@ static int __init loongson_hwmon_init(void) csr_temp_enable = csr_readl(LOONGSON_CSR_FEATURES) & LOONGSON_CSRF_TEMP; - cpu_hwmon_dev = hwmon_device_register(NULL); + cpu_hwmon_dev = hwmon_device_register_with_info(NULL, "cpu_hwmon", NULL, NULL, NULL); if (IS_ERR(cpu_hwmon_dev)) { ret = PTR_ERR(cpu_hwmon_dev); pr_err("hwmon_device_register fail!\n"); @@ -186,13 +177,6 @@ static int __init loongson_hwmon_init(void) nr_packages = loongson_sysconf.nr_cpus / loongson_sysconf.cores_per_package; - ret = sysfs_create_group(&cpu_hwmon_dev->kobj, - &cpu_hwmon_attribute_group); - if (ret) { - pr_err("fail to create loongson hwmon!\n"); - goto fail_sysfs_create_group_hwmon; - } - ret = create_sysfs_cputemp_files(&cpu_hwmon_dev->kobj); if (ret) { pr_err("fail to create cpu temperature interface!\n"); @@ -207,8 +191,6 @@ static int __init loongson_hwmon_init(void) fail_create_sysfs_cputemp_files: sysfs_remove_group(&cpu_hwmon_dev->kobj, &cpu_hwmon_attribute_group); - -fail_sysfs_create_group_hwmon: hwmon_device_unregister(cpu_hwmon_dev); fail_hwmon_device_register: -- 2.1.0