Re: [PATCH net-next v4] eth: fbnic: Add hardware monitoring support via HWMON interface

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Oct 08, 2024 at 07:32:12AM -0700, Sanman Pradhan wrote:
> From: Sanman Pradhan <sanmanpradhan@xxxxxxxx>
> 
> This patch adds support for hardware monitoring to the fbnic driver,
> allowing for temperature and voltage sensor data to be exposed to
> userspace via the HWMON interface. The driver registers a HWMON device
> and provides callbacks for reading sensor data, enabling system
> admins to monitor the health and operating conditions of fbnic.
> 
> Signed-off-by: Sanman Pradhan <sanmanpradhan@xxxxxxxx>

...

> diff --git a/drivers/net/ethernet/meta/fbnic/fbnic_pci.c b/drivers/net/ethernet/meta/fbnic/fbnic_pci.c
> index a4809fe0fc24..10b9573d829e 100644
> --- a/drivers/net/ethernet/meta/fbnic/fbnic_pci.c
> +++ b/drivers/net/ethernet/meta/fbnic/fbnic_pci.c
> @@ -289,9 +289,11 @@ static int fbnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
> 
>  	fbnic_devlink_register(fbd);
> 
> +	fbnic_hwmon_register(fbd);
> +
>  	if (!fbd->dsn) {
>  		dev_warn(&pdev->dev, "Reading serial number failed\n");
> -		goto init_failure_mode;
> +		goto hwmon_unregister;
>  	}
> 
>  	netdev = fbnic_netdev_alloc(fbd);

Hi Sanman,

The code immediately after the hunk above is:

	if (!netdev) {
		dev_err(&pdev->dev, "Netdev allocation failed\n");
		goto init_failure_mode;
	}

I think it's error-path needs to be update to goto hwmon_unregister
rather than init_failure_mode.

> @@ -310,6 +312,8 @@ static int fbnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
> 
>  ifm_free_netdev:
>  	fbnic_netdev_free(fbd);
> +hwmon_unregister:
> +	fbnic_hwmon_unregister(fbd);
>  init_failure_mode:
>  	dev_init_failure_modewarn(&pdev->dev, "Probe error encountered, entering init failure mode. Normal networking functionality will not be available.\n");
>  	 /* Always return 0 even on error so devlink is registered to allow

...

-- 
pw-bot: cr




[Index of Archives]     [LM Sensors]     [Linux Sound]     [ALSA Users]     [ALSA Devel]     [Linux Audio Users]     [Linux Media]     [Kernel]     [Gimp]     [Yosemite News]     [Linux Media]

  Powered by Linux