From: Andrew Lunn <andrew@lunn.ch>
To: Igor Russkikh <Igor.Russkikh@aquantia.com>
Cc: "David S . Miller" <davem@davemloft.net>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
Nikita Danilov <Nikita.Danilov@aquantia.com>,
Dmitry Bogdanov <Dmitry.Bogdanov@aquantia.com>,
Yana Esina <yana.esina@aquantia.com>
Subject: Re: [PATCH netnext 02/16] net: aquantia: implement hwmon api for chip temperature
Date: Sat, 13 Apr 2019 19:59:58 +0200 [thread overview]
Message-ID: <20190413175958.GP17901@lunn.ch> (raw)
In-Reply-To: <436ffcfa4cee37fcea6aec12217166d47bfda3d0.1555158087.git.igor.russkikh@aquantia.com>
On Sat, Apr 13, 2019 at 12:31:45PM +0000, Igor Russkikh wrote:
> From: Yana Esina <yana.esina@aquantia.com>
>
> 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
next prev parent reply other threads:[~2019-04-13 18:00 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-13 12:31 [PATCH netnext 00/16] net: atlantic: Aquantia driver updates 2019-04 Igor Russkikh
2019-04-13 12:31 ` [PATCH netnext 01/16] net: aquantia: add infrastructure to readout chip temperature Igor Russkikh
2019-04-13 17:51 ` Andrew Lunn
2019-04-13 18:14 ` Andrew Lunn
2019-04-13 18:16 ` Igor Russkikh
2019-04-13 12:31 ` [PATCH netnext 02/16] net: aquantia: implement hwmon api for " Igor Russkikh
2019-04-13 17:59 ` Andrew Lunn [this message]
2019-04-13 18:27 ` Igor Russkikh
2019-04-13 18:42 ` Andrew Lunn
2019-04-22 13:51 ` Igor Russkikh
2019-04-13 12:31 ` [PATCH netnext 03/16] net: aquantia: add link interrupt fields Igor Russkikh
2019-04-13 12:31 ` [PATCH netnext 04/16] net: aquantia: link interrupt handling functions Igor Russkikh
2019-04-13 13:37 ` Heiner Kallweit
2019-04-13 18:10 ` Andrew Lunn
2019-04-13 18:22 ` Igor Russkikh
2019-04-13 18:26 ` Heiner Kallweit
2019-04-13 12:31 ` [PATCH netnext 05/16] net: aquantia: create global service workqueue Igor Russkikh
2019-04-13 12:31 ` [PATCH netnext 06/16] net: aquantia: link status irq handling Igor Russkikh
2019-04-13 12:31 ` [PATCH netnext 07/16] net: aquantia: improve ifup link detection Igor Russkikh
2019-04-13 12:32 ` [PATCH netnext 08/16] net: aquantia: use macros for better visibility Igor Russkikh
2019-04-13 12:32 ` [PATCH netnext 09/16] net: aquantia: user correct MSI irq type Igor Russkikh
2019-04-13 12:32 ` [PATCH netnext 10/16] net: aquantia: introduce fwreq mutex Igor Russkikh
2019-04-13 12:32 ` [PATCH netnext 11/16] net: aquantia: extract timer cb into work job Igor Russkikh
2019-04-13 12:32 ` [PATCH netnext 12/16] net: aquantia: wrap fw ops by mutex Igor Russkikh
2019-04-13 18:24 ` Andrew Lunn
2019-04-13 12:32 ` [PATCH netnext 13/16] net: aquantia: fetch up to date statistics on ethtool request Igor Russkikh
2019-04-13 12:32 ` [PATCH netnext 14/16] net: aquantia: get total counters from DMA block Igor Russkikh
2019-04-13 12:32 ` [PATCH netnext 15/16] net: aquantia: fixups on 64bit dma counters Igor Russkikh
2019-04-13 12:32 ` [PATCH netnext 16/16] net: aquantia: remove outdated device ids Igor Russkikh
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190413175958.GP17901@lunn.ch \
--to=andrew@lunn.ch \
--cc=Dmitry.Bogdanov@aquantia.com \
--cc=Igor.Russkikh@aquantia.com \
--cc=Nikita.Danilov@aquantia.com \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
--cc=yana.esina@aquantia.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).