gpio-button-hotplug: use dev_err_probe main
authorRosen Penev <rosenp@gmail.com>
Sat, 7 Sep 2024 21:11:19 +0000 (14:11 -0700)
committerRobert Marko <robimarko@gmail.com>
Mon, 23 Sep 2024 16:22:07 +0000 (18:22 +0200)
Avoids having to handle EPROBE_DEFER manually.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/16456
Signed-off-by: Robert Marko <robimarko@gmail.com>
package/kernel/gpio-button-hotplug/Makefile
package/kernel/gpio-button-hotplug/src/gpio-button-hotplug.c

index 04cbb69ada9001241258f646e1a0800d608d2a3a..5b4085887d4828dc06e9d808918ea071d9e295b7 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 include $(INCLUDE_DIR)/kernel.mk
 
 PKG_NAME:=gpio-button-hotplug
-PKG_RELEASE:=3
+PKG_RELEASE:=4
 PKG_LICENSE:=GPL-2.0
 
 include $(INCLUDE_DIR)/package.mk
index 17748219e8ccc3ce4b1774c46651b5d09f33b1ea..de100777f240e432fe243fe7c23ed621a337b499 100644 (file)
@@ -525,10 +525,9 @@ static int gpio_keys_button_probe(struct platform_device *pdev,
                                        button->active_low ? GPIOF_ACTIVE_LOW :
                                        0), desc);
                                if (error) {
-                                       if (error != -EPROBE_DEFER) {
-                                               dev_err(dev, "unable to claim gpio %d, err=%d\n",
-                                                       button->gpio, error);
-                                       }
+                                       dev_err_probe(dev, error,
+                                                     "unable to claim gpio %d",
+                                                     button->gpio);
                                        goto out;
                                }