Skip to content

Commit 011881b

Browse files
JiangJiasjwrdegoede
authored andcommitted
platform/x86: barco-p50-gpio: Add check for platform_driver_register
As platform_driver_register() could fail, it should be better to deal with the return value in order to maintain the code consisitency. Fixes: 86af1d0 ("platform/x86: Support for EC-connected GPIOs for identify LED/button on Barco P50 board") Signed-off-by: Jiasheng Jiang <[email protected]> Acked-by: Peter Korsgaard <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Hans de Goede <[email protected]>
1 parent 552f3b8 commit 011881b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

drivers/platform/x86/barco-p50-gpio.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -405,11 +405,14 @@ MODULE_DEVICE_TABLE(dmi, dmi_ids);
405405
static int __init p50_module_init(void)
406406
{
407407
struct resource res = DEFINE_RES_IO(P50_GPIO_IO_PORT_BASE, P50_PORT_CMD + 1);
408+
int ret;
408409

409410
if (!dmi_first_match(dmi_ids))
410411
return -ENODEV;
411412

412-
platform_driver_register(&p50_gpio_driver);
413+
ret = platform_driver_register(&p50_gpio_driver);
414+
if (ret)
415+
return ret;
413416

414417
gpio_pdev = platform_device_register_simple(DRIVER_NAME, PLATFORM_DEVID_NONE, &res, 1);
415418
if (IS_ERR(gpio_pdev)) {

0 commit comments

Comments
 (0)