[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190413175958.GP17901@lunn.ch>
Date: Sat, 13 Apr 2019 19:59:58 +0200
From: Andrew Lunn <andrew@...n.ch>
To: Igor Russkikh <Igor.Russkikh@...antia.com>
Cc: "David S . Miller" <davem@...emloft.net>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
Nikita Danilov <Nikita.Danilov@...antia.com>,
Dmitry Bogdanov <Dmitry.Bogdanov@...antia.com>,
Yana Esina <yana.esina@...antia.com>
Subject: Re: [PATCH netnext 02/16] net: aquantia: implement hwmon api for
chip temperature
On Sat, Apr 13, 2019 at 12:31:45PM +0000, Igor Russkikh wrote:
> From: Yana Esina <yana.esina@...antia.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
Powered by blists - more mailing lists