linux-serial.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Weifeng Liu <weifeng.liu.z@gmail.com>
Cc: platform-driver-x86@vger.kernel.org,
	linux-serial@vger.kernel.org,
	Maximilian Luz <luzmaximilian@gmail.com>,
	Hans de Goede <hdegoede@redhat.com>
Subject: Re: [PATCH v2 2/2] platform/surface: aggregator: Log critical errors during SAM probing
Date: Fri, 3 May 2024 19:36:36 +0300	[thread overview]
Message-ID: <ZjUSlNKVvtROHNnl@smile.fi.intel.com> (raw)
In-Reply-To: <20240503030900.1334763-3-weifeng.liu.z@gmail.com>

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@linux.intel.com>

-- 
With Best Regards,
Andy Shevchenko



      reply	other threads:[~2024-05-03 16:36 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-03  3:08 [PATCH v2 0/2] Defer probing of SAM if serdev device is not ready Weifeng Liu
2024-05-03  3:08 ` [PATCH v2 1/2] platform/surface: aggregator: Defer probing when serdev " Weifeng Liu
2024-05-03 17:03   ` Andy Shevchenko
2024-05-04  4:17     ` Weifeng Liu
2024-05-03  3:08 ` [PATCH v2 2/2] platform/surface: aggregator: Log critical errors during SAM probing Weifeng Liu
2024-05-03 16:36   ` Andy Shevchenko [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZjUSlNKVvtROHNnl@smile.fi.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=hdegoede@redhat.com \
    --cc=linux-serial@vger.kernel.org \
    --cc=luzmaximilian@gmail.com \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=weifeng.liu.z@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).