Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp3516713pxb; Mon, 4 Apr 2022 19:34:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwkqV1pFT8LM2yuwN2jRVSbhcARpzfNu/i8Fcu1etAqMLf92rlVAMPp+JPEBClLQCpqgn5A X-Received: by 2002:a17:902:f683:b0:153:ee22:18b7 with SMTP id l3-20020a170902f68300b00153ee2218b7mr1225130plg.159.1649126078163; Mon, 04 Apr 2022 19:34:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649126078; cv=none; d=google.com; s=arc-20160816; b=aeu4qpQaE2Z6OmGhFOa+buE0aMWS2Jj59AyrlJjjVzA/xVJLlnsmuZvmFufX/KE6Ta Ejgr8+5SUOl1EFnLV1V+oJj46gJr7BcTAatPaKkSrNJ+tVP+zaMmDpAtyaSA0WiRA5PE kz67RV1F0n1X8YJoxvtsSIn5hJM/PzFY603PU9Ko8H67o8Tr6n2GQsRwh6P30/23BtbZ dBicfpJLgXseIpAvGqqc24bJsw3i2F4Dgx9fIuv9B+kyYH2ntI5GLXImjikdU/7/srJV 8rPr+8sguTlsqE1G3u4wbopvflEkALr66E/nHe96KazodfJIcwqRCkrB9IvWp2hL5j+r jtXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=poOZKw8hZUUNnStW9clwSX8LRDw0XYQR4H0YmtmNls4=; b=SgOJ8rYyJX6Wmh+veXD+gQjgjEqPfKp5eb9U6wInbzWxc9Bu41IrXvgqAI0vm/wedx qWeabg3BoA4eVaA0MFoe9lSis9MHwnwPtwe4BFUq4aSzN6KhY5LAxz9lc2vS3kHaEPYQ HqWtDswX0Kb3ctjM534wtSHvxK7t4BnAmY+lcRIzBPSWBkvy29JbDia9vYLd8A2bvYga T2VWb4sevG+sHyueQBUfNF7o6CldAMF4G/xpKM80UGz1h5uUCpKTzKded/GkTaMMBWUl zAFUUqr8xE5nZmExahsn1fX7ODlIAKC267HH7DVFsfjwr7saBgtvPBY/rV/18K/4SlWl Vaiw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@walle.cc header.s=mail2016061301 header.b=c1K1O2A4; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id k202-20020a6284d3000000b004fabb7eb4d0si11075779pfd.295.2022.04.04.19.34.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Apr 2022 19:34:38 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@walle.cc header.s=mail2016061301 header.b=c1K1O2A4; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id D16F73AB88B; Mon, 4 Apr 2022 17:58:15 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1381076AbiDDWH4 (ORCPT + 99 others); Mon, 4 Apr 2022 18:07:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42342 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1380039AbiDDSpp (ORCPT ); Mon, 4 Apr 2022 14:45:45 -0400 Received: from ssl.serverraum.org (ssl.serverraum.org [176.9.125.105]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 706CBA1A2; Mon, 4 Apr 2022 11:43:48 -0700 (PDT) Received: from mwalle01.kontron.local. (unknown [213.135.10.150]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by ssl.serverraum.org (Postfix) with ESMTPSA id BE559221D4; Mon, 4 Apr 2022 20:43:45 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=walle.cc; s=mail2016061301; t=1649097826; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=poOZKw8hZUUNnStW9clwSX8LRDw0XYQR4H0YmtmNls4=; b=c1K1O2A45bQVK1v+SUa/w3i8v4mo4JH24bZs9KAztcIWIcBga5R7LRy8gA2cUDgCJrQhy6 RzYLV4aGJi7UP8G5xQZWuM2LqvMjSBwTG4QJ/1X1QkW/xN+CowOvYRjA+Mql+gz+9uSLmr FxChOMLMZB+U7rf+znz48fJJWig/C0w= From: Michael Walle To: Xu Yilun , Tom Rix , Jean Delvare , Guenter Roeck , Andrew Lunn , Heiner Kallweit , Russell King , "David S . Miller" , Jakub Kicinski , Paolo Abeni Cc: linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, David Laight , Michael Walle Subject: [PATCH v3 0/2] hwmon: introduce hwmon_sanitize() Date: Mon, 4 Apr 2022 20:43:38 +0200 Message-Id: <20220404184340.3973329-1-michael@walle.cc> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org During development of the support for the temperature sensor on the GPY PHY, I've noticed that there is ususually a loop over the name to replace any invalid characters. Instead of open coding it in the drivers provide a convenience function. The last patch is marked as RFC, it should probably be reposted/applied to the kernel release after next (?). changes since v2: - doc update - dropped last three patches, the net patches will be submitted seperately changes since v1: - split patches - add hwmon-kernel-api.rst documentation - move the strdup into the hwmon core - also provide a resource managed variant Michael Walle (2): hwmon: introduce hwmon_sanitize_name() hwmon: intel-m10-bmc-hwmon: use devm_hwmon_sanitize_name() Documentation/hwmon/hwmon-kernel-api.rst | 16 ++++++++ drivers/hwmon/hwmon.c | 50 ++++++++++++++++++++++++ drivers/hwmon/intel-m10-bmc-hwmon.c | 7 +--- include/linux/hwmon.h | 3 ++ 4 files changed, 70 insertions(+), 6 deletions(-) -- 2.30.2