Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp4932249iog; Wed, 22 Jun 2022 08:32:55 -0700 (PDT) X-Google-Smtp-Source: AGRyM1t5OacIBeTDYsKyL/Z9UMkOEVDov7W6sRAFXD1rAVlHa/ggxQC62pUfzMgxDlP9WpAL0rpD X-Received: by 2002:a65:6bd6:0:b0:39d:4f85:9ecf with SMTP id e22-20020a656bd6000000b0039d4f859ecfmr3449540pgw.336.1655911974821; Wed, 22 Jun 2022 08:32:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655911974; cv=none; d=google.com; s=arc-20160816; b=gxwRO9s16MFhXIuarqkSpJqqI9ptLERW5t9+SpUHvpJsPH54x0oisNbad9T1/H2cGX 2R1H7BJPMXSug2/4+5eGQYDWoPKI9m9yZtW6CVvUCqhOfz5gv+ig+sz4ETcKp2VljgpM RNKsaLqfPLsfL2hJ1cUqtcaVe9BM51k6vqYnO1Jnv3QuOyMPVXNNyaQ/rm1t4wpHvOWQ WChifXvk+Icc6tFum1HZvDtLFLirqxS6JS7vEONfi05iwhLbn6cDyLlQSdmEM2KUI4LK wE2HJn6jKAcmWXHxmJBrGYv+W+8YhKM50V5YdBSp0onbLlhT/KRyJ7gjxDJR4+14kbfo +uHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:sender:dkim-signature; bh=JsXlyqBaPp3xCgQddd3jvwlzgLQX53awFd5+l4wF4us=; b=Iek5UwygXBJo0F6FVocdMgB3JnT9yYUJJ7Ds9mIGR1e8jfwRKgRU4dJNaGjzGHZK4z fuzIHqGxteqwcqup+hnYuN8kYJvcj3lA9VuQ5wqf3g3p92oG6kaqTk4BhA1jNqv+KnG8 R08oDBy2Ndd6ezLZM1DSXmwtbJuR3/zTGXnn8fZoD30Hhi7Bp8in8wWFLvQla8UWE1RZ TCZ0ZF4+CHe/4/ccL0YNMjRqpe4q71YUXb8M0j8qoLYD/e4N/A2odH/k7KOKxvmalHnL A5PTxjM5usPCeiJY7A0sEfg705Gz9m/5bRePu+jD4Awt1JW/P4fjbRyHagKrFYQ0CHh/ AZJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=XicE5zXO; 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 mw15-20020a17090b4d0f00b001e684469067si24822857pjb.45.2022.06.22.08.32.41; Wed, 22 Jun 2022 08:32:54 -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=@gmail.com header.s=20210112 header.b=XicE5zXO; 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 S1358806AbiFVPAx (ORCPT + 99 others); Wed, 22 Jun 2022 11:00:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60120 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243581AbiFVPAl (ORCPT ); Wed, 22 Jun 2022 11:00:41 -0400 Received: from mail-pj1-x1029.google.com (mail-pj1-x1029.google.com [IPv6:2607:f8b0:4864:20::1029]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0C8C33CA58; Wed, 22 Jun 2022 08:00:40 -0700 (PDT) Received: by mail-pj1-x1029.google.com with SMTP id x1-20020a17090abc8100b001ec7f8a51f5so12959623pjr.0; Wed, 22 Jun 2022 08:00:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=JsXlyqBaPp3xCgQddd3jvwlzgLQX53awFd5+l4wF4us=; b=XicE5zXOG/2frJTDCOIvWvarGdV9iCuf5WuWdhJ0xXUVeeCZVbCunlCROKPvZb0L8d QGSXduTbpjGQAZSO+wXS2p5IGQKqLlUEz3o12ZvaFOXua+H5Od6VT3HhFC+oJ1x8+5BW efXXKLQzslXhwtRYiTs0VFQew8VK/rSYr17EocEHxuNdpMYzPjGuafb0isnaNpnphGJ7 rbhS3G+7dNfyP97Dpv5gMhBX5BZYYiWADdhJRm3Z6iXeeo4pYvuC/opx1SqpN9nFM7Pc pYql5z9OYimaCzdvNF4BCWNB4SMXHb/ezjpC2JiesFw++M+vp7UghufAwyIDjG0pAMLA a2Nw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to; bh=JsXlyqBaPp3xCgQddd3jvwlzgLQX53awFd5+l4wF4us=; b=uVwg0MvFkLNmvSH4lAcdA/L6llMzujzYr6j2rXdLuUkmvNK3FpPQaBMVZH2u/Pcizf WF2OJqYk7Uot5s9s83yHVS9ZHjuKAsIilrqdRl3c60n69qf//MXY4Rx7QEGAnCti/xiz AOIxtTKYPFV3JIl04N2eLq0WuOCa2Gx21+DB5SJ8ZsH1SJp7CuNZ8oDQ/JVZWTrg5VKN ghgULifABkd5vO2OXuUOjXk4kVCnfrE1kCWJnqO2vz7NGNwKaEq4arRNPw1SWIlAhw7d cjx7hpfCTCIVw0jBW6Y912cAIY7Yusq88Uc+5PG0Ex5TZ7x+EuSrmZhFUOzB2uDw01lP z8NA== X-Gm-Message-State: AJIora/CFwBSiVM4bTlEm4+3QZZvcJgzziw7/NIBURnSL81osS3x3NSY BCf+vZzSOt097Yiklgj687o= X-Received: by 2002:a17:903:240e:b0:168:ea13:f9e0 with SMTP id e14-20020a170903240e00b00168ea13f9e0mr34925985plo.6.1655910039574; Wed, 22 Jun 2022 08:00:39 -0700 (PDT) Received: from server.roeck-us.net ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id b21-20020a170902d89500b0015e8d4eb2cdsm12838968plz.279.2022.06.22.08.00.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Jun 2022 08:00:38 -0700 (PDT) Sender: Guenter Roeck Date: Wed, 22 Jun 2022 08:00:37 -0700 From: Guenter Roeck To: Michael Walle Cc: Andrew Lunn , Heiner Kallweit , Russell King , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH net-next 2/2] net: phy: nxp-tja11xx: use devm_hwmon_sanitize_name() Message-ID: <20220622150037.GB1861763@roeck-us.net> References: <20220622123543.3463209-1-michael@walle.cc> <20220622123543.3463209-3-michael@walle.cc> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220622123543.3463209-3-michael@walle.cc> X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,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 On Wed, Jun 22, 2022 at 02:35:43PM +0200, Michael Walle wrote: > Instead of open-coding the bad characters replacement in the hwmon name, > use the new devm_hwmon_sanitize_name(). > > Signed-off-by: Michael Walle Acked-by: Guenter Roeck > --- > drivers/net/phy/nxp-tja11xx.c | 11 +++-------- > 1 file changed, 3 insertions(+), 8 deletions(-) > > diff --git a/drivers/net/phy/nxp-tja11xx.c b/drivers/net/phy/nxp-tja11xx.c > index 9944cc501806..2a8195c50d14 100644 > --- a/drivers/net/phy/nxp-tja11xx.c > +++ b/drivers/net/phy/nxp-tja11xx.c > @@ -444,15 +444,10 @@ static int tja11xx_hwmon_register(struct phy_device *phydev, > struct tja11xx_priv *priv) > { > struct device *dev = &phydev->mdio.dev; > - int i; > - > - priv->hwmon_name = devm_kstrdup(dev, dev_name(dev), GFP_KERNEL); > - if (!priv->hwmon_name) > - return -ENOMEM; > > - for (i = 0; priv->hwmon_name[i]; i++) > - if (hwmon_is_bad_char(priv->hwmon_name[i])) > - priv->hwmon_name[i] = '_'; > + priv->hwmon_name = devm_hwmon_sanitize_name(dev, dev_name(dev)); > + if (IS_ERR(priv->hwmon_name)) > + return PTR_ERR(priv->hwmon_name); > > priv->hwmon_dev = > devm_hwmon_device_register_with_info(dev, priv->hwmon_name, > -- > 2.30.2 >