Re: [PATCH] Input: synaptics-rmi4: Use %pe for error codes.

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

 



On Sat, Apr 29, 2023 at 08:41:19PM +0200, Michał Mirosław wrote:
> Make the error messages a bit easier to understand by showing
> error names where that's enabled.
> 
> Signed-off-by: Michał Mirosław <mirq-linux@xxxxxxxxxxxx>
> ---
>  drivers/input/rmi4/rmi_driver.c | 66 +++++++++++++++++----------------
>  1 file changed, 34 insertions(+), 32 deletions(-)
> 
> diff --git a/drivers/input/rmi4/rmi_driver.c b/drivers/input/rmi4/rmi_driver.c
> index 258d5fe3d395..82d85c02a873 100644
> --- a/drivers/input/rmi4/rmi_driver.c
> +++ b/drivers/input/rmi4/rmi_driver.c
> @@ -69,8 +69,8 @@ static int reset_one_function(struct rmi_function *fn)
>  	if (fh->reset) {
>  		retval = fh->reset(fn);
>  		if (retval < 0)
> -			dev_err(&fn->dev, "Reset failed with code %d.\n",
> -				retval);
> +			dev_err(&fn->dev, "Reset failed: %pe\n",
> +				ERR_PTR(retval));

If this is desired we should have a format option for
non-err-ptr-encoded errors.

Thanks.

-- 
Dmitry



[Index of Archives]     [Linux Media Devel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Linux Wireless Networking]     [Linux Omap]

  Powered by Linux