projects
/
deliverable
/
linux.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
HID: Add and use hid_<level>: dev_<level> equivalents
[deliverable/linux.git]
/
drivers
/
hid
/
hid-roccat.c
diff --git
a/drivers/hid/hid-roccat.c
b/drivers/hid/hid-roccat.c
index f6e80c7ca61e53c0f9655778306ffc3e82a28b9f..4bc7a93dc1f5a92ef66d4339eb32406c3f297785 100644
(file)
--- a/
drivers/hid/hid-roccat.c
+++ b/
drivers/hid/hid-roccat.c
@@
-21,6
+21,8
@@
* It is inspired by hidraw, but uses only one circular buffer for all readers.
*/
* It is inspired by hidraw, but uses only one circular buffer for all readers.
*/
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
#include <linux/cdev.h>
#include <linux/poll.h>
#include <linux/sched.h>
#include <linux/cdev.h>
#include <linux/poll.h>
#include <linux/sched.h>
@@
-165,27
+167,22
@@
static int roccat_open(struct inode *inode, struct file *file)
mutex_lock(&device->readers_lock);
if (!device) {
mutex_lock(&device->readers_lock);
if (!device) {
- printk(KERN_EMERG "roccat device with minor %d doesn't exist\n",
- minor);
+ pr_emerg("roccat device with minor %d doesn't exist\n", minor);
error = -ENODEV;
goto exit_err;
}
if (!device->open++) {
/* power on device on adding first reader */
error = -ENODEV;
goto exit_err;
}
if (!device->open++) {
/* power on device on adding first reader */
- if (device->hid->ll_driver->power) {
- error = device->hid->ll_driver->power(device->hid,
- PM_HINT_FULLON);
- if (error < 0) {
- --device->open;
- goto exit_err;
- }
+ error = hid_hw_power(device->hid, PM_HINT_FULLON);
+ if (error < 0) {
+ --device->open;
+ goto exit_err;
}
}
- error = device->hid->ll_driver->open(device->hid);
+
+ error = hid_hw_open(device->hid);
if (error < 0) {
if (error < 0) {
- if (device->hid->ll_driver->power)
- device->hid->ll_driver->power(device->hid,
- PM_HINT_NORMAL);
+ hid_hw_power(device->hid, PM_HINT_NORMAL);
--device->open;
goto exit_err;
}
--device->open;
goto exit_err;
}
@@
-218,8
+215,7
@@
static int roccat_release(struct inode *inode, struct file *file)
device = devices[minor];
if (!device) {
mutex_unlock(&devices_lock);
device = devices[minor];
if (!device) {
mutex_unlock(&devices_lock);
- printk(KERN_EMERG "roccat device with minor %d doesn't exist\n",
- minor);
+ pr_emerg("roccat device with minor %d doesn't exist\n", minor);
return -ENODEV;
}
return -ENODEV;
}
@@
-231,10
+227,8
@@
static int roccat_release(struct inode *inode, struct file *file)
if (!--device->open) {
/* removing last reader */
if (device->exist) {
if (!--device->open) {
/* removing last reader */
if (device->exist) {
- if (device->hid->ll_driver->power)
- device->hid->ll_driver->power(device->hid,
- PM_HINT_NORMAL);
- device->hid->ll_driver->close(device->hid);
+ hid_hw_power(device->hid, PM_HINT_NORMAL);
+ hid_hw_close(device->hid);
} else {
kfree(device);
}
} else {
kfree(device);
}
@@
-370,7
+364,7
@@
void roccat_disconnect(int minor)
device_destroy(roccat_class, MKDEV(roccat_major, minor));
if (device->open) {
device_destroy(roccat_class, MKDEV(roccat_major, minor));
if (device->open) {
-
device->hid->ll_driver->
close(device->hid);
+
hid_hw_
close(device->hid);
wake_up_interruptible(&device->wait);
} else {
kfree(device);
wake_up_interruptible(&device->wait);
} else {
kfree(device);
@@
-384,6
+378,7
@@
static const struct file_operations roccat_ops = {
.poll = roccat_poll,
.open = roccat_open,
.release = roccat_release,
.poll = roccat_poll,
.open = roccat_open,
.release = roccat_release,
+ .llseek = noop_llseek,
};
static int __init roccat_init(void)
};
static int __init roccat_init(void)
@@
-397,7
+392,7
@@
static int __init roccat_init(void)
roccat_major = MAJOR(dev_id);
if (retval < 0) {
roccat_major = MAJOR(dev_id);
if (retval < 0) {
- pr
intk(KERN_WARNING "roccat:
can't get major number\n");
+ pr
_warn("
can't get major number\n");
return retval;
}
return retval;
}
This page took
0.025568 seconds
and
5
git commands to generate.