On Sat, Apr 13, 2019 at 12:31:45PM +0000, Igor Russkikh wrote: > From: Yana Esina <yana.es...@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