Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp633697pxb; Tue, 5 Apr 2022 16:41:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwcatsb2e3EI032mCcYUnXkLhUxAgaj032g53xlfAPOnDpZy+xV3duBVp5LCrAf44JsDpns X-Received: by 2002:a63:7b14:0:b0:398:a27:b9c6 with SMTP id w20-20020a637b14000000b003980a27b9c6mr4760464pgc.69.1649202114071; Tue, 05 Apr 2022 16:41:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649202114; cv=none; d=google.com; s=arc-20160816; b=VrNIitetTXHAxueqqObc7SfhOHjmuCZVFkEPmYVCe9GIbHo/n4DfQbQh5XJyJXvokl B60DrqOlNim9qQi5dDGWKA3A+Yah7ravl//hM5s+wqijN3nREfZNRSIXEmieumf6QNu0 UMvJNMRJoVUDtx6hpj2cojnxVtPcdVEnYmr7UDlC+u4cmcs48yNYX4Ohcp+2yUGIbp4t jetgf3ULRmghvFh4SnG0NELAZdTBdH69AJSL3LPfLH7oX+u5muqBTMRkULj3afZtxFdM GyvP+N4VKxxzeE0nXN/o6AJB9olnrdboHCZkEyTxbfMkknbAQ6QdKmCpG7Fi+u9y5RGL NNDA== 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=uk8mzQYPK6hRxrVTkR2htOw04+Yd2q9FLsv83PaJNfQ=; b=JBZ7xCbmpuWTjo7Nff+jD2lmmFG2TVs9j6AJ2uBR1cAY2F0Am3sWSWU/WNobu19qXV 09zrbAu4RS2Aw7lzzuLb5MxS1QWCElvMsD2MZlcso8yrYs53ANqxY/EvF9nLQgdhwlQU YsnTlgGljaNVE9Jk1Ncky9ZG4ApuQk0Z3ZZMOOBMhFeAqhzJZStrqJL0pUIBXcyOE8uk pyph9Xiubo560ZHFLZH46e6b8QaevVyL7mde7mLDdmuowZ56lHonX+DaL4P1Ff2lKVmA AJs8/8rzFQCrT9AD3HCO5M2OPCem4E4eJDVq1RMLWR8UOWxkFlNEYda4sZGBj8UDwzNr Sqjw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@walle.cc header.s=mail2016061301 header.b=Mj1y4B8w; 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 h12-20020a63c00c000000b003816043ef0fsi14850765pgg.260.2022.04.05.16.41.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Apr 2022 16:41:54 -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=Mj1y4B8w; 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 3A35F1E5A49; Tue, 5 Apr 2022 16:26:09 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1388761AbiDEOlE (ORCPT + 99 others); Tue, 5 Apr 2022 10:41:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36286 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243817AbiDEJkb (ORCPT ); Tue, 5 Apr 2022 05:40:31 -0400 Received: from ssl.serverraum.org (ssl.serverraum.org [IPv6:2a01:4f8:151:8464::1:2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 470D5B9192; Tue, 5 Apr 2022 02:25:03 -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 DB5C0221D4; Tue, 5 Apr 2022 11:25:00 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=walle.cc; s=mail2016061301; t=1649150701; 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=uk8mzQYPK6hRxrVTkR2htOw04+Yd2q9FLsv83PaJNfQ=; b=Mj1y4B8wxRiPbBrSLP3Z3gfqL9Mdb+B+0hX6u8Lzk6mE+3gi002hvqLIgAnXZGx83HvG76 Yb9P5aBc+6P3dQ5kX7LAL/Bn8GONRzUVtZZdHsrUixUooOUcSLC3QKUEg6i0/Pf2LlL61C H2eEcVKJ02EM2E7wW5c5n2bw7Ve2/tM= 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 v4 0/2] hwmon: introduce hwmon_sanitize() Date: Tue, 5 Apr 2022 11:24:50 +0200 Message-Id: <20220405092452.4033674-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. changes since v3: - don't return NULL but ERR_PTR(-ENOMEM) - check !dev in devm_ variant 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 | 53 ++++++++++++++++++++++++ drivers/hwmon/intel-m10-bmc-hwmon.c | 11 ++--- include/linux/hwmon.h | 3 ++ 4 files changed, 75 insertions(+), 8 deletions(-) -- 2.30.2