From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.3 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_PASS,URIBL_BLOCKED, USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C8EFEC10F11 for ; Sat, 13 Apr 2019 18:00:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8A14B2084D for ; Sat, 13 Apr 2019 18:00:02 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=lunn.ch header.i=@lunn.ch header.b="Qm64RUUJ" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726981AbfDMSAB (ORCPT ); Sat, 13 Apr 2019 14:00:01 -0400 Received: from vps0.lunn.ch ([185.16.172.187]:60449 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726922AbfDMSAB (ORCPT ); Sat, 13 Apr 2019 14:00:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=/iExlBjtVVp5U4gRUjPwCjvFaPgjjEF+5zP+SjmQ2C0=; b=Qm64RUUJ6K41fN1PLyQOb8d84f 4x9RMRQTUI+3k85ak4h79VP2Prv/DafGd/WAy5J/Y8MgOlWEhccAr3r9LcRnRSsFCZjYMfSiF9gZn qAmYbKgzbb5pKfhyKQOEkxGfsPhSlkD/QTzMTPqjohTtvl4ueaD8BjadnFaMf2u3FBxk=; Received: from andrew by vps0.lunn.ch with local (Exim 4.89) (envelope-from ) id 1hFMwY-0006Ix-1d; Sat, 13 Apr 2019 19:59:58 +0200 Date: Sat, 13 Apr 2019 19:59:58 +0200 From: Andrew Lunn To: Igor Russkikh Cc: "David S . Miller" , "netdev@vger.kernel.org" , Nikita Danilov , Dmitry Bogdanov , Yana Esina Subject: Re: [PATCH netnext 02/16] net: aquantia: implement hwmon api for chip temperature Message-ID: <20190413175958.GP17901@lunn.ch> References: <436ffcfa4cee37fcea6aec12217166d47bfda3d0.1555158087.git.igor.russkikh@aquantia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <436ffcfa4cee37fcea6aec12217166d47bfda3d0.1555158087.git.igor.russkikh@aquantia.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Sat, Apr 13, 2019 at 12:31:45PM +0000, Igor Russkikh wrote: > From: Yana Esina > > Added support for hwmon api, through the use of the sensors utility > > +int aq_drvinfo_init(struct net_device *ndev) > +{ > + struct aq_nic_s *aq_nic = netdev_priv(ndev); > + struct pci_dev *pdev = aq_nic->pdev; > + struct device *dev; > + int err = 0; > + > + dev = > + devm_hwmon_device_register_with_groups(&aq_nic->pdev->dev, > + ndev->name, > + dev_get_drvdata(&pdev->dev), > + aq_dev_groups); > + You should be using devm_hwmon_device_register_with_info(). I'm not sure how good an idea it is use nder->name. systemd is going to rename the device, so you have a sensor called eth0, and the interface called enp3s0. You might be better to use the pci bus address, which is fixed, or add code for the rename notifier, so you can destroy and recreate the hwmon device when the interface is renamed. It would also be good to Cc: the HWMON maintainer. Andrew