#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;
};
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;
}
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:
{
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)
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;