Re: [PATCH v2 2/2] platform/surface: aggregator: Log critical errors during SAM probing

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

 



On Fri, May 03, 2024 at 11:08:47AM +0800, Weifeng Liu wrote:
> Emits messages upon errors during probing of SAM.  Hopefully this could
> provide useful context to user for the purpose of diagnosis when
> something miserable happen.

...

>  	acpi_status astatus;
>  	int status;
>  
> -	if (gpiod_count(&serdev->dev, NULL) < 0)
> -		return -ENODEV;
> +	status = gpiod_count(&serdev->dev, NULL);
> +	if (status < 0)
> +		return dev_err_probe(&serdev->dev, status, "no GPIO found\n");

Note, with

	struct device *dev = &serdev->dev;

this and other lines become shorter and you may join some of them...

...

> +		status = dev_err_probe(&serdev->dev, -ENXIO,
> +				       "failed to setup serdev\n");

...like here:

		status = dev_err_probe(dev, -ENXIO, "failed to setup serdev\n");

...

> +		dev_err_probe(&serdev->dev, status,
> +			      "failed to get firmware version\n");

...or here.

...

With the above being addressed,
Reviewed-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>

-- 
With Best Regards,
Andy Shevchenko






[Index of Archives]     [Linux Kernel Development]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux