File tree Expand file tree Collapse file tree 1 file changed +9
-12
lines changed Expand file tree Collapse file tree 1 file changed +9
-12
lines changed Original file line number Diff line number Diff line change @@ -523,18 +523,15 @@ static int gpio_keys_setup_key(struct platform_device *pdev,
523
523
NULL , GPIOD_IN , desc );
524
524
if (IS_ERR (bdata -> gpiod )) {
525
525
error = PTR_ERR (bdata -> gpiod );
526
- if (error == - ENOENT ) {
527
- /*
528
- * GPIO is optional, we may be dealing with
529
- * purely interrupt-driven setup.
530
- */
531
- bdata -> gpiod = NULL ;
532
- } else {
533
- if (error != - EPROBE_DEFER )
534
- dev_err (dev , "failed to get gpio: %d\n" ,
535
- error );
536
- return error ;
537
- }
526
+ if (error != - ENOENT )
527
+ return dev_err_probe (dev , error ,
528
+ "failed to get gpio\n" );
529
+
530
+ /*
531
+ * GPIO is optional, we may be dealing with
532
+ * purely interrupt-driven setup.
533
+ */
534
+ bdata -> gpiod = NULL ;
538
535
}
539
536
} else if (gpio_is_valid (button -> gpio )) {
540
537
/*
You can’t perform that action at this time.
0 commit comments