From patchwork Fri Jul 7 12:29:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Crawford X-Patchwork-Id: 13304863 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D15C0EB64D9 for ; Fri, 7 Jul 2023 12:30:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231627AbjGGMat (ORCPT ); Fri, 7 Jul 2023 08:30:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59526 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229800AbjGGMas (ORCPT ); Fri, 7 Jul 2023 08:30:48 -0400 Received: from ipmail06.adl3.internode.on.net (ipmail06.adl3.internode.on.net [150.101.137.16]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 724CA2110 for ; Fri, 7 Jul 2023 05:30:46 -0700 (PDT) IronPort-SDR: 64a80565_eSGktz7CQE9zToUTfECkm5nbvorF8qy2Ntdq42XxjiYVYuL KR+q2SqeXg+BIY08vD5wNaoSjqRVhSA/qGWecHw== X-SMTP-MATCH: 0 X-IPAS-Result: A2AYAgASBahkjPQc8jxaHAEBAQEBAQcBARIBAQQEAQFJgUaCM4JRth8PAQ8BAUQEAQGFBgKGFSY4EwECBAEBAQEDAgMBAQEBAQEDAQEGAQEBAQEBBgQUAQEBAUBFhWgNhgUCAQMnCwENAQE3AQ8ZOFcGARKCfoJdqWMzgQGCCQEBBoJlrjGBXwmBQowggRmDO3pCP4FOhH6LBo4ghV0FAjKNFIEnb4EeN2d6AgkCEWeBCAhfgW4+Ag1UCwtjgRyCTgICEToUU18ZHQMHA4EFEC8HBDImBgkYLyUGUQcXFiQJExVBBINYCoELPxUOEYJXI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OdWHGgzUj5IuyBlo3ko8/gdSebzVfH2adqAWqTdpy X-IronPort-Anti-Spam-Filtered: true Received: from 60-242-28-244.static.tpgi.com.au (HELO bits.crawford.emu.id.au) ([60.242.28.244]) by ipmail06.adl3.internode.on.net with ESMTP; 07 Jul 2023 22:00:29 +0930 Received: from agc.crawford.emu.id.au (agc.crawford.emu.id.au [IPv6:fdd2:7aad:d478:1:0:0:cb10:cc07]) (authenticated bits=0) by bits.crawford.emu.id.au (8.17.1/8.17.1) with ESMTPSA id 367CU7bL2026771 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Fri, 7 Jul 2023 22:30:25 +1000 Authentication-Results: bits.crawford.emu.id.au; arc=none smtp.remote-ip=fdd2:7aad:d478:1::cb10:cc07 DKIM-Filter: OpenDKIM Filter v2.11.0 bits.crawford.emu.id.au 367CU7bL2026771 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=crawford.emu.id.au; s=s1; t=1688733025; bh=KaTcNhtT+ISNshmuM37/JCO1IUVbv9wjlBS2DrUHwH4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=O6nwapHxfnyyDcH3r0nzTBVNpqPIuWtD/C/IFMBAcbZgmGkgelDJij5EZJRRngH4E g0NE52EkEBIpMQ3Mo4PdqAWhY7aiUkg6S8tE3ct/XOxyMmbgnrutEMd3mi6wzXcO0+ ESj9w+MN7h1B/n1a07VEqAItEizG9rR/CnogCHmIU1mguUZxkVXpfS3qG5Nyl+h6BH 2fSSUkSB/K/bjS7wxPeHbQYXA/F2DoEtqY4cG/+Jy0Ln3SAQndu8W/vTXFzAC7L78z jJZrW94lkqS+ys0BbDQ5CCOPe2aDZzV1yU3+11b0aJ7Ft3isF6QJB5gqIdStkhlImN TiAgBccp6yGGw== From: Frank Crawford To: Jean Delvare , Guenter Roeck Cc: linux-hwmon@vger.kernel.org, Frank Crawford Subject: [PATCH v2 2/3] hwmon: (it87) Improve temperature reporting support Date: Fri, 7 Jul 2023 22:29:51 +1000 Message-ID: <20230707123005.956415-3-frank@crawford.emu.id.au> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230707123005.956415-1-frank@crawford.emu.id.au> References: <20230707123005.956415-1-frank@crawford.emu.id.au> MIME-Version: 1.0 X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.6.4 (bits.crawford.emu.id.au [IPv6:fdd2:7aad:d478:1:0:0:cb10:cc01]); Fri, 07 Jul 2023 22:30:25 +1000 (AEST) X-Virus-Scanned: clamav-milter 1.0.1 at bits.crawford.emu.id.au X-Virus-Status: Clean Precedence: bulk List-ID: X-Mailing-List: linux-hwmon@vger.kernel.org Add test if thermistor sensor type attribute should be visible, i.e. test if the attribute is defined. Signed-off-by: Frank Crawford --- v2: * Split single patch into multi-patch set following review. --- drivers/hwmon/it87.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/hwmon/it87.c b/drivers/hwmon/it87.c index 7a1224ddc8b1..fb62f2a7017a 100644 --- a/drivers/hwmon/it87.c +++ b/drivers/hwmon/it87.c @@ -2330,6 +2330,14 @@ static umode_t it87_temp_is_visible(struct kobject *kobj, if (!(data->has_temp & BIT(i))) return 0; + if (a == 3) { + int type = get_temp_type(data, i); + + if (type == 0) + return 0; + return attr->mode; + } + if (a == 5 && !has_temp_offset(data)) return 0;