From patchwork Mon Feb 10 05:47:06 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Huisong Li X-Patchwork-Id: 13967235 X-Patchwork-Delegate: kuba@kernel.org Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3A60B188915; Mon, 10 Feb 2025 05:59:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.188 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739167170; cv=none; b=dtrBYB9m86fPkrkt2xtGtbusZwEwIRaBD/fRmi3M8jh9Rd0jqOpZPtG8MugXmzUWe8H2lHDbl5DNI5SVfSEn21ZPaEcUj+DuDylQ9HI0J2aki44CcEbTs1gTS0WcEEPtsbUsVGqJSHL53dbLj/ZgjNUubT2nHZmVamx/LtoTNoU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739167170; c=relaxed/simple; bh=MHb9TyuXgUHeuarU9Yir/7RmkDw32ubVkuACnX19mig=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Re9ZpbbqxcX6hzd+6ucZz6YoVUkdPjc00Xz5zTFgJEb1MF7OASjPpy9I1nsAephRJ+8FdAPhzI7n+AWlLmzrItogC3d8LVDrXQwZFfUiyhh4qa5dI5AoGks1L4xU/TfU1JdJ9hMDQeQlrmCf9Z6ELABjXV24NE7TcJ+MbUklVjk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=45.249.212.188 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.88.194]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4Yrv2Y6hstzWffR; Mon, 10 Feb 2025 13:56:05 +0800 (CST) Received: from dggemv706-chm.china.huawei.com (unknown [10.3.19.33]) by mail.maildlp.com (Postfix) with ESMTPS id 812F21402DB; Mon, 10 Feb 2025 13:59:25 +0800 (CST) Received: from kwepemn100009.china.huawei.com (7.202.194.112) by dggemv706-chm.china.huawei.com (10.3.19.33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Mon, 10 Feb 2025 13:59:25 +0800 Received: from localhost.localdomain (10.28.79.22) by kwepemn100009.china.huawei.com (7.202.194.112) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Mon, 10 Feb 2025 13:59:24 +0800 From: Huisong Li To: , , CC: , , , , , , , , , , , , , Subject: [PATCH v2 1/5] net: aquantia: Use HWMON_CHANNEL_INFO macro to simplify code Date: Mon, 10 Feb 2025 13:47:06 +0800 Message-ID: <20250210054710.12855-2-lihuisong@huawei.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20250210054710.12855-1-lihuisong@huawei.com> References: <20250210054710.12855-1-lihuisong@huawei.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To kwepemn100009.china.huawei.com (7.202.194.112) X-Patchwork-Delegate: kuba@kernel.org Use HWMON_CHANNEL_INFO macro to simplify code. Signed-off-by: Huisong Li --- .../net/ethernet/aquantia/atlantic/aq_drvinfo.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/drivers/net/ethernet/aquantia/atlantic/aq_drvinfo.c b/drivers/net/ethernet/aquantia/atlantic/aq_drvinfo.c index 414b2e448d59..787ea91802e7 100644 --- a/drivers/net/ethernet/aquantia/atlantic/aq_drvinfo.c +++ b/drivers/net/ethernet/aquantia/atlantic/aq_drvinfo.c @@ -113,19 +113,9 @@ static const struct hwmon_ops aq_hwmon_ops = { .read_string = aq_hwmon_read_string, }; -static u32 aq_hwmon_temp_config[] = { - HWMON_T_INPUT | HWMON_T_LABEL, - HWMON_T_INPUT | HWMON_T_LABEL, - 0, -}; - -static const struct hwmon_channel_info aq_hwmon_temp = { - .type = hwmon_temp, - .config = aq_hwmon_temp_config, -}; - static const struct hwmon_channel_info * const aq_hwmon_info[] = { - &aq_hwmon_temp, + HWMON_CHANNEL_INFO(temp, HWMON_T_INPUT | HWMON_T_LABEL, + HWMON_T_INPUT | HWMON_T_LABEL), NULL, }; From patchwork Mon Feb 10 05:47:07 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Huisong Li X-Patchwork-Id: 13967234 X-Patchwork-Delegate: kuba@kernel.org Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9C63B2F2E; Mon, 10 Feb 2025 05:59:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.187 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739167170; cv=none; b=cASsrYriFL0YPUXTj9XEX8cjRnDijInWweIU+dks9//tYMskIGmWgeN2h2ohYPrDjp70Ea78N5g/Il7z9Ol4SfDnIWFkOO116iWxsi6ZT8QvYh37JYG+xH+vByVTu2Z51uhnK7FWL15MMow9PCFyTRXBUwWtgGzVITvh+oTdfxo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739167170; c=relaxed/simple; bh=mWX/fp1URit59PoIjt60VZfGFkJQZLYn2jvxHT7rK+c=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=s7dtXnQpdw9khzzGo+SC9GAnVyC1WAgKMm6PmUp/wNPsCxHl5RVoFnEJmEyHRTwpLWygWb2OWrmAdQvljLmYT7MKy5GKuU4Ur0eCtxbim7AKT4Q2eXLL8o8bPEbhhRFTw3D1BoEp7CT+7oD+m4xdBbNOLuGxT1o+S/tV8gMTSiU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=45.249.212.187 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.88.194]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4Yrv1K4fxSz11Px7; Mon, 10 Feb 2025 13:55:01 +0800 (CST) Received: from dggemv712-chm.china.huawei.com (unknown [10.1.198.32]) by mail.maildlp.com (Postfix) with ESMTPS id 1B3991402DB; Mon, 10 Feb 2025 13:59:26 +0800 (CST) Received: from kwepemn100009.china.huawei.com (7.202.194.112) by dggemv712-chm.china.huawei.com (10.1.198.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Mon, 10 Feb 2025 13:59:25 +0800 Received: from localhost.localdomain (10.28.79.22) by kwepemn100009.china.huawei.com (7.202.194.112) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Mon, 10 Feb 2025 13:59:24 +0800 From: Huisong Li To: , , CC: , , , , , , , , , , , , , Subject: [PATCH v2 2/5] net: nfp: Use HWMON_CHANNEL_INFO macro to simplify code Date: Mon, 10 Feb 2025 13:47:07 +0800 Message-ID: <20250210054710.12855-3-lihuisong@huawei.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20250210054710.12855-1-lihuisong@huawei.com> References: <20250210054710.12855-1-lihuisong@huawei.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To kwepemn100009.china.huawei.com (7.202.194.112) X-Patchwork-Delegate: kuba@kernel.org Use HWMON_CHANNEL_INFO macro to simplify code. Signed-off-by: Huisong Li --- .../net/ethernet/netronome/nfp/nfp_hwmon.c | 40 +++---------------- 1 file changed, 5 insertions(+), 35 deletions(-) diff --git a/drivers/net/ethernet/netronome/nfp/nfp_hwmon.c b/drivers/net/ethernet/netronome/nfp/nfp_hwmon.c index 0d6c59d6d4ae..ea6a288c0d5e 100644 --- a/drivers/net/ethernet/netronome/nfp/nfp_hwmon.c +++ b/drivers/net/ethernet/netronome/nfp/nfp_hwmon.c @@ -83,42 +83,12 @@ nfp_hwmon_is_visible(const void *data, enum hwmon_sensor_types type, u32 attr, return 0; } -static u32 nfp_chip_config[] = { - HWMON_C_REGISTER_TZ, - 0 -}; - -static const struct hwmon_channel_info nfp_chip = { - .type = hwmon_chip, - .config = nfp_chip_config, -}; - -static u32 nfp_temp_config[] = { - HWMON_T_INPUT | HWMON_T_MAX | HWMON_T_CRIT, - 0 -}; - -static const struct hwmon_channel_info nfp_temp = { - .type = hwmon_temp, - .config = nfp_temp_config, -}; - -static u32 nfp_power_config[] = { - HWMON_P_INPUT | HWMON_P_MAX, - HWMON_P_INPUT, - HWMON_P_INPUT, - 0 -}; - -static const struct hwmon_channel_info nfp_power = { - .type = hwmon_power, - .config = nfp_power_config, -}; - static const struct hwmon_channel_info * const nfp_hwmon_info[] = { - &nfp_chip, - &nfp_temp, - &nfp_power, + HWMON_CHANNEL_INFO(chip, HWMON_C_REGISTER_TZ), + HWMON_CHANNEL_INFO(temp, HWMON_T_INPUT | HWMON_T_MAX | HWMON_T_CRIT), + HWMON_CHANNEL_INFO(power, HWMON_P_INPUT | HWMON_P_MAX, + HWMON_P_INPUT, + HWMON_P_INPUT), NULL }; From patchwork Mon Feb 10 05:47:08 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Huisong Li X-Patchwork-Id: 13967233 X-Patchwork-Delegate: kuba@kernel.org Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C7BC5189906; Mon, 10 Feb 2025 05:59:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.188 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739167170; cv=none; b=U7wkJ5Ahg7AOlWn1dFtXYB/aG+nZqtg3uFLXMXu9hFpRrCO0dS77c3Jq6e43WQsU1hh29eyC6phwe7otnmmg4eDAsxZFEvygQeGx4U9O4bEUSQDkb4ssZf/3X6KVFoT8G69X+4ypY1qU1qS+7drxOvgtS8BnBfetunh6cjQLvCw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739167170; c=relaxed/simple; bh=9R4EBb0QHSNQehDQA1zgOuXZJ9e4ixUJtG9sqepfvAs=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=m7+Zsp+WzlSbUl1MUO1Du4gaLXBUFs8+olVpaQ8vfFqo5fG/cE/qpJBl2yMrZdSnBr1L7xxqS0j7lY3ux9xn17Afq50bL3FKEEPiQiPBRrGfDhVSmVimXc+m+g3QxWis09IsiFDX0HgUsKAUx7dqb/7isVYLMzVO6oSWHZ4fAYA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=45.249.212.188 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.163.48]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4Yrv4b38fnzrT3N; Mon, 10 Feb 2025 13:57:51 +0800 (CST) Received: from dggemv711-chm.china.huawei.com (unknown [10.1.198.66]) by mail.maildlp.com (Postfix) with ESMTPS id AF8A1180080; Mon, 10 Feb 2025 13:59:26 +0800 (CST) Received: from kwepemn100009.china.huawei.com (7.202.194.112) by dggemv711-chm.china.huawei.com (10.1.198.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Mon, 10 Feb 2025 13:59:26 +0800 Received: from localhost.localdomain (10.28.79.22) by kwepemn100009.china.huawei.com (7.202.194.112) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Mon, 10 Feb 2025 13:59:25 +0800 From: Huisong Li To: , , CC: , , , , , , , , , , , , , Subject: [PATCH v2 3/5] net: phy: marvell: Use HWMON_CHANNEL_INFO macro to simplify code Date: Mon, 10 Feb 2025 13:47:08 +0800 Message-ID: <20250210054710.12855-4-lihuisong@huawei.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20250210054710.12855-1-lihuisong@huawei.com> References: <20250210054710.12855-1-lihuisong@huawei.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To kwepemn100009.china.huawei.com (7.202.194.112) X-Patchwork-Delegate: kuba@kernel.org Use HWMON_CHANNEL_INFO macro to simplify code. Signed-off-by: Huisong Li --- drivers/net/phy/marvell.c | 24 ++---------------------- 1 file changed, 2 insertions(+), 22 deletions(-) diff --git a/drivers/net/phy/marvell.c b/drivers/net/phy/marvell.c index 44e1927de499..dd254e36ca8a 100644 --- a/drivers/net/phy/marvell.c +++ b/drivers/net/phy/marvell.c @@ -3124,33 +3124,13 @@ static umode_t marvell_hwmon_is_visible(const void *data, } } -static u32 marvell_hwmon_chip_config[] = { - HWMON_C_REGISTER_TZ, - 0 -}; - -static const struct hwmon_channel_info marvell_hwmon_chip = { - .type = hwmon_chip, - .config = marvell_hwmon_chip_config, -}; - /* we can define HWMON_T_CRIT and HWMON_T_MAX_ALARM even though these are not * defined for all PHYs, because the hwmon code checks whether the attributes * exists via the .is_visible method */ -static u32 marvell_hwmon_temp_config[] = { - HWMON_T_INPUT | HWMON_T_CRIT | HWMON_T_MAX_ALARM, - 0 -}; - -static const struct hwmon_channel_info marvell_hwmon_temp = { - .type = hwmon_temp, - .config = marvell_hwmon_temp_config, -}; - static const struct hwmon_channel_info * const marvell_hwmon_info[] = { - &marvell_hwmon_chip, - &marvell_hwmon_temp, + HWMON_CHANNEL_INFO(chip, HWMON_C_REGISTER_TZ), + HWMON_CHANNEL_INFO(temp, HWMON_T_INPUT | HWMON_T_CRIT | HWMON_T_MAX_ALARM), NULL }; From patchwork Mon Feb 10 05:47:09 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Huisong Li X-Patchwork-Id: 13967236 X-Patchwork-Delegate: kuba@kernel.org Received: from szxga04-in.huawei.com (szxga04-in.huawei.com [45.249.212.190]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 05A19188915; Mon, 10 Feb 2025 05:59:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.190 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739167177; cv=none; b=B0aOHhjW58WOtzIXsTEnqSeWdV6dzN5BA/iu4uV1G7hxGtLIvD+UvfrGfxa+Qfz8NG7C7+D8JufIShNrlOoxWSFk9tCpQhsGUYFOBKZfs5vM0ynvc2vWlvA5NuH2WYUR9CZ466jM2pP4RjO3yaby52t7pdWooIIk3Vup7XD/X5M= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739167177; c=relaxed/simple; bh=xKblWWGxTE5azXr82EvnLeeQK5P/EFTNCVtLQSBacDk=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=QoKRdQyNjO8ZgiIa3yJ95Sa9E0tHelVOwegtxTNHDAkKICHnc3gPJ030700GNy1sda3OMCo9kP+0GMJbtyF3xy7b7HAyv6GgFP1r4dQOH/AzqddAr8OhUDjDDItnj0LtjUejdB8QiWmMRjlYGp2EBdyzOUEM/EMbBWf/HIptNtc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=45.249.212.190 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.88.234]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4Yrv28203Jz2FdHM; Mon, 10 Feb 2025 13:55:44 +0800 (CST) Received: from dggemv704-chm.china.huawei.com (unknown [10.3.19.47]) by mail.maildlp.com (Postfix) with ESMTPS id 5990414022F; Mon, 10 Feb 2025 13:59:27 +0800 (CST) Received: from kwepemn100009.china.huawei.com (7.202.194.112) by dggemv704-chm.china.huawei.com (10.3.19.47) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Mon, 10 Feb 2025 13:59:27 +0800 Received: from localhost.localdomain (10.28.79.22) by kwepemn100009.china.huawei.com (7.202.194.112) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Mon, 10 Feb 2025 13:59:26 +0800 From: Huisong Li To: , , CC: , , , , , , , , , , , , , Subject: [PATCH v2 4/5] net: phy: marvell10g: Use HWMON_CHANNEL_INFO macro to simplify code Date: Mon, 10 Feb 2025 13:47:09 +0800 Message-ID: <20250210054710.12855-5-lihuisong@huawei.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20250210054710.12855-1-lihuisong@huawei.com> References: <20250210054710.12855-1-lihuisong@huawei.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To kwepemn100009.china.huawei.com (7.202.194.112) X-Patchwork-Delegate: kuba@kernel.org Use HWMON_CHANNEL_INFO macro to simplify code. Signed-off-by: Huisong Li --- drivers/net/phy/marvell10g.c | 24 ++---------------------- 1 file changed, 2 insertions(+), 22 deletions(-) diff --git a/drivers/net/phy/marvell10g.c b/drivers/net/phy/marvell10g.c index 623bdb8466b8..5354c8895163 100644 --- a/drivers/net/phy/marvell10g.c +++ b/drivers/net/phy/marvell10g.c @@ -230,29 +230,9 @@ static const struct hwmon_ops mv3310_hwmon_ops = { .read = mv3310_hwmon_read, }; -static u32 mv3310_hwmon_chip_config[] = { - HWMON_C_REGISTER_TZ | HWMON_C_UPDATE_INTERVAL, - 0, -}; - -static const struct hwmon_channel_info mv3310_hwmon_chip = { - .type = hwmon_chip, - .config = mv3310_hwmon_chip_config, -}; - -static u32 mv3310_hwmon_temp_config[] = { - HWMON_T_INPUT, - 0, -}; - -static const struct hwmon_channel_info mv3310_hwmon_temp = { - .type = hwmon_temp, - .config = mv3310_hwmon_temp_config, -}; - static const struct hwmon_channel_info * const mv3310_hwmon_info[] = { - &mv3310_hwmon_chip, - &mv3310_hwmon_temp, + HWMON_CHANNEL_INFO(chip, HWMON_C_REGISTER_TZ | HWMON_C_UPDATE_INTERVAL), + HWMON_CHANNEL_INFO(temp, HWMON_T_INPUT), NULL, }; From patchwork Mon Feb 10 05:47:10 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Huisong Li X-Patchwork-Id: 13967237 X-Patchwork-Delegate: kuba@kernel.org Received: from szxga04-in.huawei.com (szxga04-in.huawei.com [45.249.212.190]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 059C5188596; Mon, 10 Feb 2025 05:59:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.190 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739167178; cv=none; b=I76W+cqDofl/MdqIxnRAY7lcNp4xt88ZhUEEN8XNpdeTYv4bXlHKJzB+qt/VngjY7tXa0Gr/2WwtJt72/YT+DkbglFPJEpzqNgHxmLtAbRxReNV7bIHAUQo/NVw1Glcq4+n/8kSsgFqWY+GyFQ7kc6bfp1GyJbcGvfv3xUta45Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739167178; c=relaxed/simple; bh=lDXRb/Tz5n+mdCPvdJI7TgU/tycGAjSob+lVDychdiE=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=cfqalpo0g4HQyYa+d2z65gbJxZpiz8aqAfvC+2Lz2SgOcZrUFV423HU07nP5iJwPmxGHePsalJ1U+QFAzPvtirMmr+jcUyq3zITQqPWP81vEO+25wOsCNIe+1bFBY83U3jRD4iN7tfoZdVP59RQCm0rE4FjYXVhjXPNsc9keKKc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=45.249.212.190 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.88.163]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4Yrv285trDz2FdHN; Mon, 10 Feb 2025 13:55:44 +0800 (CST) Received: from dggemv703-chm.china.huawei.com (unknown [10.3.19.46]) by mail.maildlp.com (Postfix) with ESMTPS id E26A818001B; Mon, 10 Feb 2025 13:59:27 +0800 (CST) Received: from kwepemn100009.china.huawei.com (7.202.194.112) by dggemv703-chm.china.huawei.com (10.3.19.46) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Mon, 10 Feb 2025 13:59:27 +0800 Received: from localhost.localdomain (10.28.79.22) by kwepemn100009.china.huawei.com (7.202.194.112) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Mon, 10 Feb 2025 13:59:26 +0800 From: Huisong Li To: , , CC: , , , , , , , , , , , , , Subject: [PATCH v2 5/5] net: phy: aquantia: Use HWMON_CHANNEL_INFO macro to simplify code Date: Mon, 10 Feb 2025 13:47:10 +0800 Message-ID: <20250210054710.12855-6-lihuisong@huawei.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20250210054710.12855-1-lihuisong@huawei.com> References: <20250210054710.12855-1-lihuisong@huawei.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To kwepemn100009.china.huawei.com (7.202.194.112) X-Patchwork-Delegate: kuba@kernel.org Use HWMON_CHANNEL_INFO macro to simplify code. Signed-off-by: Huisong Li --- drivers/net/phy/aquantia/aquantia_hwmon.c | 32 +++++------------------ 1 file changed, 6 insertions(+), 26 deletions(-) diff --git a/drivers/net/phy/aquantia/aquantia_hwmon.c b/drivers/net/phy/aquantia/aquantia_hwmon.c index 7b3c49c3bf49..1a714b56b765 100644 --- a/drivers/net/phy/aquantia/aquantia_hwmon.c +++ b/drivers/net/phy/aquantia/aquantia_hwmon.c @@ -172,33 +172,13 @@ static const struct hwmon_ops aqr_hwmon_ops = { .write = aqr_hwmon_write, }; -static u32 aqr_hwmon_chip_config[] = { - HWMON_C_REGISTER_TZ, - 0, -}; - -static const struct hwmon_channel_info aqr_hwmon_chip = { - .type = hwmon_chip, - .config = aqr_hwmon_chip_config, -}; - -static u32 aqr_hwmon_temp_config[] = { - HWMON_T_INPUT | - HWMON_T_MAX | HWMON_T_MIN | - HWMON_T_MAX_ALARM | HWMON_T_MIN_ALARM | - HWMON_T_CRIT | HWMON_T_LCRIT | - HWMON_T_CRIT_ALARM | HWMON_T_LCRIT_ALARM, - 0, -}; - -static const struct hwmon_channel_info aqr_hwmon_temp = { - .type = hwmon_temp, - .config = aqr_hwmon_temp_config, -}; - static const struct hwmon_channel_info * const aqr_hwmon_info[] = { - &aqr_hwmon_chip, - &aqr_hwmon_temp, + HWMON_CHANNEL_INFO(chip, HWMON_C_REGISTER_TZ), + HWMON_CHANNEL_INFO(temp, HWMON_T_INPUT | + HWMON_T_MAX | HWMON_T_MIN | + HWMON_T_MAX_ALARM | HWMON_T_MIN_ALARM | + HWMON_T_CRIT | HWMON_T_LCRIT | + HWMON_T_CRIT_ALARM | HWMON_T_LCRIT_ALARM), NULL, };