aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hid/hidraw.c
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2010-12-09 22:29:03 -0500
committerJiri Kosina <jkosina@suse.cz>2010-12-10 09:10:38 -0500
commit4291ee305e9bb0699504a66f0e2b7aefcf0512a5 (patch)
tree3996b77eb64d4f3b76a0799f30a5b2ba6cbc9ddb /drivers/hid/hidraw.c
parent5bea7660bba973dc5e8e9d92b11fb1dd5b524ebf (diff)
HID: Add and use hid_<level>: dev_<level> equivalents
Neaten current uses of dev_<level> by adding and using hid specific hid_<level> macros. Convert existing uses of dev_<level> uses to hid_<level>. Convert hid-pidff printk uses to hid_<level>. Remove err_hid and use hid_err instead. Add missing newlines to logging messages where necessary. Coalesce format strings. Add and use pr_fmt(fmt) KBUILD_MODNAME ": " fmt Other miscellaneous changes: Add const struct hid_device * argument to hid-core functions extract() and implement() so hid_<level> can be used by them. Fix bad indentation in hid-core hid_input_field function that calls extract() function above. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid/hidraw.c')
-rw-r--r--drivers/hid/hidraw.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/hid/hidraw.c b/drivers/hid/hidraw.c
index 5aefe73cf795..eb16cd143e2a 100644
--- a/drivers/hid/hidraw.c
+++ b/drivers/hid/hidraw.c
@@ -19,6 +19,8 @@
19 * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. 19 * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
20 */ 20 */
21 21
22#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
23
22#include <linux/fs.h> 24#include <linux/fs.h>
23#include <linux/module.h> 25#include <linux/module.h>
24#include <linux/errno.h> 26#include <linux/errno.h>
@@ -123,15 +125,15 @@ static ssize_t hidraw_write(struct file *file, const char __user *buffer, size_t
123 } 125 }
124 126
125 if (count > HID_MAX_BUFFER_SIZE) { 127 if (count > HID_MAX_BUFFER_SIZE) {
126 printk(KERN_WARNING "hidraw: pid %d passed too large report\n", 128 hid_warn(dev, "pid %d passed too large report\n",
127 task_pid_nr(current)); 129 task_pid_nr(current));
128 ret = -EINVAL; 130 ret = -EINVAL;
129 goto out; 131 goto out;
130 } 132 }
131 133
132 if (count < 2) { 134 if (count < 2) {
133 printk(KERN_WARNING "hidraw: pid %d passed too short report\n", 135 hid_warn(dev, "pid %d passed too short report\n",
134 task_pid_nr(current)); 136 task_pid_nr(current));
135 ret = -EINVAL; 137 ret = -EINVAL;
136 goto out; 138 goto out;
137 } 139 }
@@ -450,7 +452,7 @@ int __init hidraw_init(void)
450 hidraw_major = MAJOR(dev_id); 452 hidraw_major = MAJOR(dev_id);
451 453
452 if (result < 0) { 454 if (result < 0) {
453 printk(KERN_WARNING "hidraw: can't get major number\n"); 455 pr_warn("can't get major number\n");
454 result = 0; 456 result = 0;
455 goto out; 457 goto out;
456 } 458 }