Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp1492759pxb; Wed, 30 Mar 2022 04:59:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy9ycluNbNMhvfpxUbqLFnXlkyLB7PqzCxMmCuzaZQ3rVQ3LGpEPGeGYj8VK/vCAL6vKiwr X-Received: by 2002:a17:906:5006:b0:6ce:3762:c72e with SMTP id s6-20020a170906500600b006ce3762c72emr39125051ejj.30.1648641593727; Wed, 30 Mar 2022 04:59:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648641593; cv=none; d=google.com; s=arc-20160816; b=C46sPFQeK4212hra9smib1hDbdWsKTsCBgYs2nbcYJnpbpjpuXaiec7TOkJZcxRk7C txhnMKBTcoKrlZolGqVHSaqfF2lgyEZBAmmJCh5Nzfepj7e0u0zU/FzL8oNhvGavY1Bm LWNofkj6AgR1gkIF7yM/BHbsMuiWsK0CXZYoB1onYbRA+XgypcoNO8Gbdp4XG+vuQL1Z WVXPUj61EYqJx33fBXzQ8XCS2fBCN4LhmZzXo0XIwLX9hjgoN/MlzXz66SX+x5mMntzT xPM/yY1CXSLTr7cWgvi1QuhsGmjin8jcNEakimiKy1rp9qAPLXU6oiln1+tOJ/qyK33C sSHQ== 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=t6Pu735TGprjeUwEKpTa7O8OdAXFGppdshHVqteN2gw=; b=xgkunzo3FhCA4UvNc+2SERAsSn2DY5LgJpWzAIcgn4FcPEW3PRFieauoAM2d7AvxIQ ShrEJYDJgDBT4/MGEmx0kk4RJbDKTcV+AqhVrDBswlvZZeCDQCgtTVZnDLhJVjM81bM+ Gh1v3l418v4Be5OfFRhx4i9mxHvptRffmsxCorhRp60cTtvLuWyzHBGmYrlSxk3JoALF je8BqnE9P7kylS9oRPJXQ8FFtPAf50Wenr4wJ3+smpibrmflvfZnnFxZOs46QabqWV5p UiJwDHua7VjqgvagaKTZLyDDHtueER0TOpKFBmlSW1EXROXMi6pmKLKLwsjF0HVPiSuA t68g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@walle.cc header.s=mail2016061301 header.b=p0QdfHQj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z12-20020a05640240cc00b00419a223685bsi22829483edb.519.2022.03.30.04.59.25; Wed, 30 Mar 2022 04:59:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@walle.cc header.s=mail2016061301 header.b=p0QdfHQj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239430AbiC2QKG (ORCPT + 99 others); Tue, 29 Mar 2022 12:10:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43634 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239354AbiC2QJc (ORCPT ); Tue, 29 Mar 2022 12:09:32 -0400 Received: from ssl.serverraum.org (ssl.serverraum.org [176.9.125.105]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9282F25EC90; Tue, 29 Mar 2022 09:07:46 -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 77276221D4; Tue, 29 Mar 2022 18:07:41 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=walle.cc; s=mail2016061301; t=1648570064; 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=t6Pu735TGprjeUwEKpTa7O8OdAXFGppdshHVqteN2gw=; b=p0QdfHQjmUB4GbWudN19R+uzjuqI/DvM+q425uz70IhFQQkBm08PeRjzHXw2yJPyrPaL1H RLm8ta1iUmqI8DtVDaFMxSgIHt+Q4FXzhq2q7MV4McveKyPZucvJVVH9Q8aQ28dVJGFPBd 41AWyupxLGsnCBFS61l1BZ51nBjadtE= 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, Michael Walle Subject: [PATCH v2 0/5] hwmon: introduce hwmon_sanitize() Date: Tue, 29 Mar 2022 18:07:25 +0200 Message-Id: <20220329160730.3265481-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=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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 v1: - split patches - add hwmon-kernel-api.rst documentation - move the strdup into the hwmon core - also provide a resource managed variant Michael Walle (5): hwmon: introduce hwmon_sanitize_name() hwmon: intel-m10-bmc-hwmon: use devm_hwmon_sanitize_name() net: sfp: use hwmon_sanitize_name() net: phy: nxp-tja11xx: use devm_hwmon_sanitize_name() hwmon: move hwmon_is_bad_char() into core Documentation/hwmon/hwmon-kernel-api.rst | 9 +++- drivers/hwmon/hwmon.c | 69 ++++++++++++++++++++++++ drivers/hwmon/intel-m10-bmc-hwmon.c | 7 +-- drivers/net/phy/nxp-tja11xx.c | 7 +-- drivers/net/phy/sfp.c | 8 +-- include/linux/hwmon.h | 24 +-------- 6 files changed, 83 insertions(+), 41 deletions(-) -- 2.30.2