* via an ELAN U132 adapter.
*
*/
+
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
#include <linux/kernel.h>
#include <linux/errno.h>
#include <linux/init.h>
interface = usb_find_interface(&ftdi_elan_driver, subminor);
if (!interface) {
- printk(KERN_ERR "can't find device for minor %d\n", subminor);
+ pr_err("can't find device for minor %d\n", subminor);
return -ENODEV;
} else {
struct usb_ftdi *ftdi = usb_get_intfdata(interface);
struct usb_ftdi *ftdi;
ftdi = kzalloc(sizeof(struct usb_ftdi), GFP_KERNEL);
- if (!ftdi) {
- printk(KERN_ERR "Out of memory\n");
+ if (!ftdi)
return -ENOMEM;
- }
mutex_lock(&ftdi_module_lock);
list_add_tail(&ftdi->ftdi_list, &ftdi_static_list);
static int __init ftdi_elan_init(void)
{
int result;
- printk(KERN_INFO "driver %s\n", ftdi_elan_driver.name);
+ pr_info("driver %s\n", ftdi_elan_driver.name);
mutex_init(&ftdi_module_lock);
INIT_LIST_HEAD(&ftdi_static_list);
status_queue = create_singlethread_workqueue("ftdi-status-control");
destroy_workqueue(status_queue);
destroy_workqueue(command_queue);
destroy_workqueue(respond_queue);
- printk(KERN_ERR "usb_register failed. Error number %d\n",
- result);
+ pr_err("usb_register failed. Error number %d\n", result);
}
return result;
err_command_queue:
destroy_workqueue(status_queue);
err_status_queue:
- printk(KERN_ERR "%s couldn't create workqueue\n", ftdi_elan_driver.name);
+ pr_err("%s couldn't create workqueue\n", ftdi_elan_driver.name);
return -ENOMEM;
}
struct usb_ftdi *ftdi;
struct usb_ftdi *temp;
usb_deregister(&ftdi_elan_driver);
- printk(KERN_INFO "ftdi_u132 driver deregistered\n");
+ pr_info("ftdi_u132 driver deregistered\n");
list_for_each_entry_safe(ftdi, temp, &ftdi_static_list, ftdi_list) {
ftdi_status_cancel_work(ftdi);
ftdi_command_cancel_work(ftdi);