mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Peter Korsgaard <peter@korsgaard.com>
To: Jiasheng Jiang <jiasheng@iscas.ac.cn>
Cc: santoshkumar.yadav@barco.com, peter.korsgaard@barco.com,
	hdegoede@redhat.com, markgross@kernel.org,
	platform-driver-x86@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] platform/x86: barco-p50-gpio: Add check for platform_driver_register
Date: Mon, 30 May 2022 23:20:15 +0200	[thread overview]
Message-ID: <87bkve4t0w.fsf@dell.be.48ers.dk> (raw)
In-Reply-To: <20220526090345.1444172-1-jiasheng@iscas.ac.cn> (Jiasheng Jiang's message of "Thu, 26 May 2022 17:03:45 +0800")

>>>>> "Jiasheng" == Jiasheng Jiang <jiasheng@iscas.ac.cn> writes:

 > As platform_driver_register() could fail, it should be better
 > to deal with the return value in order to maintain the code
 > consisitency.

 > Fixes: 86af1d02d458 ("platform/x86: Support for EC-connected GPIOs for
 > identify LED/button on Barco P50 board")

 > Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn>

Acked-by: Peter Korsgaard <peter.korsgaard@barco.com>


> ---
 >  drivers/platform/x86/barco-p50-gpio.c | 5 ++++-
 >  1 file changed, 4 insertions(+), 1 deletion(-)

 > diff --git a/drivers/platform/x86/barco-p50-gpio.c b/drivers/platform/x86/barco-p50-gpio.c
 > index 05534287bc26..8dd672339485 100644
 > --- a/drivers/platform/x86/barco-p50-gpio.c
 > +++ b/drivers/platform/x86/barco-p50-gpio.c
 > @@ -405,11 +405,14 @@ MODULE_DEVICE_TABLE(dmi, dmi_ids);
 >  static int __init p50_module_init(void)
 >  {
 >  	struct resource res = DEFINE_RES_IO(P50_GPIO_IO_PORT_BASE, P50_PORT_CMD + 1);
 > +	int ret;
 
 >  	if (!dmi_first_match(dmi_ids))
 >  		return -ENODEV;
 
 > -	platform_driver_register(&p50_gpio_driver);
 > +	ret = platform_driver_register(&p50_gpio_driver);
 > +	if (ret)
 > +		return ret;
 
 >  	gpio_pdev = platform_device_register_simple(DRIVER_NAME, PLATFORM_DEVID_NONE, &res, 1);
 >  	if (IS_ERR(gpio_pdev)) {
 > -- 

 > 2.25.1


-- 
Bye, Peter Korsgaard

  reply	other threads:[~2022-05-30 21:20 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-26  9:03 Jiasheng Jiang
2022-05-30 21:20 ` Peter Korsgaard [this message]
2022-06-10 18:48 ` Hans de Goede

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=87bkve4t0w.fsf@dell.be.48ers.dk \
    --to=peter@korsgaard.com \
    --cc=hdegoede@redhat.com \
    --cc=jiasheng@iscas.ac.cn \
    --cc=linux-kernel@vger.kernel.org \
    --cc=markgross@kernel.org \
    --cc=peter.korsgaard@barco.com \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=santoshkumar.yadav@barco.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

all inboxes | Powered by JetHome®