[PATCH v6 1/8] spmi: Print error status with %pe format

Andy Shevchenko andriy.shevchenko at intel.com
Sat Oct 18 12:12:48 PDT 2025


On Thu, Oct 16, 2025 at 12:43:55PM +0200, AngeloGioacchino Del Regno wrote:
> Instead of printing just a number, use the %pe format for error
> status, increasing readability of error prints.

...

>  	err = device_add(&sdev->dev);
>  	if (err < 0) {
> -		dev_err(&sdev->dev, "Can't add %s, status %d\n",
> -			dev_name(&sdev->dev), err);
> +		dev_err(&sdev->dev, "Can't add %s, status %pe\n",
> +			dev_name(&sdev->dev), ERR_PTR(err));

LOL, I only now noticed that the parameter to dev_err() and dev_name() is the
same. For christ's sake, why do we need dev_name()?

>  		goto err_device_add;
>  	}

-- 
With Best Regards,
Andy Shevchenko





More information about the linux-phy mailing list