From patchwork Tue May 28 18:15:41 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Vasut X-Patchwork-Id: 10965601 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id EA0D96C5 for ; Tue, 28 May 2019 18:16:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D9F15285E1 for ; Tue, 28 May 2019 18:16:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CDC0B28643; Tue, 28 May 2019 18:16:18 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E6402285E1 for ; Tue, 28 May 2019 18:16:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727789AbfE1SQQ (ORCPT ); Tue, 28 May 2019 14:16:16 -0400 Received: from mail-out.m-online.net ([212.18.0.10]:59919 "EHLO mail-out.m-online.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727473AbfE1SQQ (ORCPT ); Tue, 28 May 2019 14:16:16 -0400 Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 45D28r5NhYz1rYXY; Tue, 28 May 2019 20:16:12 +0200 (CEST) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 45D28r4chQz1qqkK; Tue, 28 May 2019 20:16:12 +0200 (CEST) X-Virus-Scanned: amavisd-new at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new, port 10024) with ESMTP id MIGZjLMzH4Vl; Tue, 28 May 2019 20:16:11 +0200 (CEST) X-Auth-Info: nt9nDC7iCui/4G2q3jKtIpOA88xJ8ExQvUWMBppV31Y= Received: from kurokawa.lan (ip-86-49-110-70.net.upcbroadband.cz [86.49.110.70]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPSA; Tue, 28 May 2019 20:16:11 +0200 (CEST) From: Marek Vasut To: netdev@vger.kernel.org Cc: Marek Vasut , Andrew Lunn , Florian Fainelli , Guenter Roeck , Heiner Kallweit , Jean Delvare , linux-hwmon@vger.kernel.org Subject: [PATCH] net: phy: tja11xx: Switch to HWMON_CHANNEL_INFO() Date: Tue, 28 May 2019 20:15:41 +0200 Message-Id: <20190528181541.1946-1-marex@denx.de> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Sender: linux-hwmon-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-hwmon@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The HWMON_CHANNEL_INFO macro simplifies the code, reduces the likelihood of errors, and makes the code easier to read. Signed-off-by: Marek Vasut Cc: Andrew Lunn Cc: Florian Fainelli Cc: Guenter Roeck Cc: Heiner Kallweit Cc: Jean Delvare Cc: linux-hwmon@vger.kernel.org Reviewed-by: Guenter Roeck --- drivers/net/phy/nxp-tja11xx.c | 24 ++---------------------- 1 file changed, 2 insertions(+), 22 deletions(-) diff --git a/drivers/net/phy/nxp-tja11xx.c b/drivers/net/phy/nxp-tja11xx.c index 11b8701e78fd..b705d0bd798b 100644 --- a/drivers/net/phy/nxp-tja11xx.c +++ b/drivers/net/phy/nxp-tja11xx.c @@ -311,29 +311,9 @@ static umode_t tja11xx_hwmon_is_visible(const void *data, return 0; } -static u32 tja11xx_hwmon_in_config[] = { - HWMON_I_LCRIT_ALARM, - 0 -}; - -static const struct hwmon_channel_info tja11xx_hwmon_in = { - .type = hwmon_in, - .config = tja11xx_hwmon_in_config, -}; - -static u32 tja11xx_hwmon_temp_config[] = { - HWMON_T_CRIT_ALARM, - 0 -}; - -static const struct hwmon_channel_info tja11xx_hwmon_temp = { - .type = hwmon_temp, - .config = tja11xx_hwmon_temp_config, -}; - static const struct hwmon_channel_info *tja11xx_hwmon_info[] = { - &tja11xx_hwmon_in, - &tja11xx_hwmon_temp, + HWMON_CHANNEL_INFO(in, HWMON_I_LCRIT_ALARM), + HWMON_CHANNEL_INFO(temp, HWMON_T_CRIT_ALARM), NULL };