aboutsummaryrefslogtreecommitdiffstats
path: root/package/kernel
diff options
context:
space:
mode:
authorPetr Štetiar <ynezz@true.cz>2019-06-03 22:05:41 +0200
committerPetr Štetiar <ynezz@true.cz>2019-06-09 14:51:47 +0200
commit33ccfe0e149f19c9d18165fa45b9df4b0c30e881 (patch)
tree2b0a75f314b51423016e6bf78fa3b55cd08e3bc9 /package/kernel
parent0299a4b73e729504dfdc5c4563535db082bdf941 (diff)
downloadupstream-33ccfe0e149f19c9d18165fa45b9df4b0c30e881.tar.gz
upstream-33ccfe0e149f19c9d18165fa45b9df4b0c30e881.tar.bz2
upstream-33ccfe0e149f19c9d18165fa45b9df4b0c30e881.zip
gpio-button-hotplug: use pr_debug and pr_err
pr_debug can be used with dynamic debugging. Tested-by: Kuan-Yi Li <kyli.tw@gmail.com> Signed-off-by: Petr Štetiar <ynezz@true.cz>
Diffstat (limited to 'package/kernel')
-rw-r--r--package/kernel/gpio-button-hotplug/src/gpio-button-hotplug.c23
1 files changed, 6 insertions, 17 deletions
diff --git a/package/kernel/gpio-button-hotplug/src/gpio-button-hotplug.c b/package/kernel/gpio-button-hotplug/src/gpio-button-hotplug.c
index 11c914d4ef..d81898f932 100644
--- a/package/kernel/gpio-button-hotplug/src/gpio-button-hotplug.c
+++ b/package/kernel/gpio-button-hotplug/src/gpio-button-hotplug.c
@@ -29,22 +29,11 @@
#include <linux/of_irq.h>
#include <linux/gpio_keys.h>
-#define DRV_NAME "gpio-keys"
-
#define BH_SKB_SIZE 2048
+#define DRV_NAME "gpio-keys"
#define PFX DRV_NAME ": "
-#undef BH_DEBUG
-
-#ifdef BH_DEBUG
-#define BH_DBG(fmt, args...) printk(KERN_DEBUG "%s: " fmt, DRV_NAME, ##args )
-#else
-#define BH_DBG(fmt, args...) do {} while (0)
-#endif
-
-#define BH_ERR(fmt, args...) printk(KERN_ERR "%s: " fmt, DRV_NAME, ##args )
-
struct bh_priv {
unsigned long seen;
};
@@ -138,7 +127,7 @@ int bh_event_add_var(struct bh_event *event, int argv, const char *format, ...)
s = skb_put(event->skb, len + 1);
strcpy(s, buf);
- BH_DBG("added variable '%s'\n", s);
+ pr_debug(PFX "added variable '%s'\n", s);
return 0;
}
@@ -205,7 +194,7 @@ static void button_hotplug_work(struct work_struct *work)
out_free_skb:
if (ret) {
- BH_ERR("work error %d\n", ret);
+ pr_err(PFX "work error %d\n", ret);
kfree_skb(event->skb);
}
out_free_event:
@@ -217,8 +206,8 @@ static int button_hotplug_create_event(const char *name, unsigned int type,
{
struct bh_event *event;
- BH_DBG("create event, name=%s, seen=%lu, pressed=%d\n",
- name, seen, pressed);
+ pr_debug(PFX "create event, name=%s, seen=%lu, pressed=%d\n",
+ name, seen, pressed);
event = kzalloc(sizeof(*event), GFP_KERNEL);
if (!event)
@@ -255,7 +244,7 @@ static void button_hotplug_event(struct gpio_keys_button_data *data,
unsigned long seen = jiffies;
int btn;
- BH_DBG("event type=%u, code=%u, value=%d\n", type, data->b->code, value);
+ pr_debug(PFX "event type=%u, code=%u, value=%d\n", type, data->b->code, value);
if ((type != EV_KEY) && (type != EV_SW))
return;