aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pcmcia/pcmcia_ioctl.c
diff options
context:
space:
mode:
authorDominik Brodowski <linux@dominikbrodowski.net>2009-10-23 06:51:28 -0400
committerDominik Brodowski <linux@dominikbrodowski.net>2009-11-08 12:23:12 -0500
commitd50dbec3ce52e1608636b8a624d087da9ced8cde (patch)
tree536cced7021883bcc3a7f82e94c42cd4c614ba43 /drivers/pcmcia/pcmcia_ioctl.c
parent18a7a19b37838789452e0bd2855a51475628b971 (diff)
pcmcia: use dynamic debug instead of custom infrastructure
Use the generic "dynamic debug" infrastructure instead of CONIG_PCMCIA_DEBUG in the PCMCIA core (pcmcia.ko and pcmcia_core.ko). To enable debugging, enable CONFIG_DYNAMIC_DEBUG, mount debugfs and $ echo -n 'module pcmcia_core +p' > /sys/kernel/debug/dynamic_debug/control for the complete module "pcmcia_core", for example. For more detailled instructions, please see Documentation/dynamic-debug-howto.txt Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Diffstat (limited to 'drivers/pcmcia/pcmcia_ioctl.c')
-rw-r--r--drivers/pcmcia/pcmcia_ioctl.c31
1 files changed, 10 insertions, 21 deletions
diff --git a/drivers/pcmcia/pcmcia_ioctl.c b/drivers/pcmcia/pcmcia_ioctl.c
index 30cf71d2ee23..056fd131c89c 100644
--- a/drivers/pcmcia/pcmcia_ioctl.c
+++ b/drivers/pcmcia/pcmcia_ioctl.c
@@ -58,17 +58,6 @@ typedef struct user_info_t {
58} user_info_t; 58} user_info_t;
59 59
60 60
61#ifdef CONFIG_PCMCIA_DEBUG
62extern int ds_pc_debug;
63
64#define ds_dbg(lvl, fmt, arg...) do { \
65 if (ds_pc_debug >= lvl) \
66 printk(KERN_DEBUG "ds: " fmt , ## arg); \
67} while (0)
68#else
69#define ds_dbg(lvl, fmt, arg...) do { } while (0)
70#endif
71
72static struct pcmcia_device *get_pcmcia_device(struct pcmcia_socket *s, 61static struct pcmcia_device *get_pcmcia_device(struct pcmcia_socket *s,
73 unsigned int function) 62 unsigned int function)
74{ 63{
@@ -431,7 +420,7 @@ static int bind_request(struct pcmcia_socket *s, bind_info_t *bind_info)
431 if (!s) 420 if (!s)
432 return -EINVAL; 421 return -EINVAL;
433 422
434 ds_dbg(2, "bind_request(%d, '%s')\n", s->sock, 423 pr_debug("bind_request(%d, '%s')\n", s->sock,
435 (char *)bind_info->dev_info); 424 (char *)bind_info->dev_info);
436 425
437 p_drv = get_pcmcia_driver(&bind_info->dev_info); 426 p_drv = get_pcmcia_driver(&bind_info->dev_info);
@@ -623,7 +612,7 @@ static int ds_open(struct inode *inode, struct file *file)
623 static int warning_printed = 0; 612 static int warning_printed = 0;
624 int ret = 0; 613 int ret = 0;
625 614
626 ds_dbg(0, "ds_open(socket %d)\n", i); 615 pr_debug("ds_open(socket %d)\n", i);
627 616
628 lock_kernel(); 617 lock_kernel();
629 s = pcmcia_get_socket_by_nr(i); 618 s = pcmcia_get_socket_by_nr(i);
@@ -685,7 +674,7 @@ static int ds_release(struct inode *inode, struct file *file)
685 struct pcmcia_socket *s; 674 struct pcmcia_socket *s;
686 user_info_t *user, **link; 675 user_info_t *user, **link;
687 676
688 ds_dbg(0, "ds_release(socket %d)\n", iminor(inode)); 677 pr_debug("ds_release(socket %d)\n", iminor(inode));
689 678
690 user = file->private_data; 679 user = file->private_data;
691 if (CHECK_USER(user)) 680 if (CHECK_USER(user))
@@ -719,7 +708,7 @@ static ssize_t ds_read(struct file *file, char __user *buf,
719 user_info_t *user; 708 user_info_t *user;
720 int ret; 709 int ret;
721 710
722 ds_dbg(2, "ds_read(socket %d)\n", iminor(file->f_path.dentry->d_inode)); 711 pr_debug("ds_read(socket %d)\n", iminor(file->f_path.dentry->d_inode));
723 712
724 if (count < 4) 713 if (count < 4)
725 return -EINVAL; 714 return -EINVAL;
@@ -744,7 +733,7 @@ static ssize_t ds_read(struct file *file, char __user *buf,
744static ssize_t ds_write(struct file *file, const char __user *buf, 733static ssize_t ds_write(struct file *file, const char __user *buf,
745 size_t count, loff_t *ppos) 734 size_t count, loff_t *ppos)
746{ 735{
747 ds_dbg(2, "ds_write(socket %d)\n", iminor(file->f_path.dentry->d_inode)); 736 pr_debug("ds_write(socket %d)\n", iminor(file->f_path.dentry->d_inode));
748 737
749 if (count != 4) 738 if (count != 4)
750 return -EINVAL; 739 return -EINVAL;
@@ -762,7 +751,7 @@ static u_int ds_poll(struct file *file, poll_table *wait)
762 struct pcmcia_socket *s; 751 struct pcmcia_socket *s;
763 user_info_t *user; 752 user_info_t *user;
764 753
765 ds_dbg(2, "ds_poll(socket %d)\n", iminor(file->f_path.dentry->d_inode)); 754 pr_debug("ds_poll(socket %d)\n", iminor(file->f_path.dentry->d_inode));
766 755
767 user = file->private_data; 756 user = file->private_data;
768 if (CHECK_USER(user)) 757 if (CHECK_USER(user))
@@ -790,7 +779,7 @@ static int ds_ioctl(struct inode * inode, struct file * file,
790 ds_ioctl_arg_t *buf; 779 ds_ioctl_arg_t *buf;
791 user_info_t *user; 780 user_info_t *user;
792 781
793 ds_dbg(2, "ds_ioctl(socket %d, %#x, %#lx)\n", iminor(inode), cmd, arg); 782 pr_debug("ds_ioctl(socket %d, %#x, %#lx)\n", iminor(inode), cmd, arg);
794 783
795 user = file->private_data; 784 user = file->private_data;
796 if (CHECK_USER(user)) 785 if (CHECK_USER(user))
@@ -809,13 +798,13 @@ static int ds_ioctl(struct inode * inode, struct file * file,
809 798
810 if (cmd & IOC_IN) { 799 if (cmd & IOC_IN) {
811 if (!access_ok(VERIFY_READ, uarg, size)) { 800 if (!access_ok(VERIFY_READ, uarg, size)) {
812 ds_dbg(3, "ds_ioctl(): verify_read = %d\n", -EFAULT); 801 pr_debug("ds_ioctl(): verify_read = %d\n", -EFAULT);
813 return -EFAULT; 802 return -EFAULT;
814 } 803 }
815 } 804 }
816 if (cmd & IOC_OUT) { 805 if (cmd & IOC_OUT) {
817 if (!access_ok(VERIFY_WRITE, uarg, size)) { 806 if (!access_ok(VERIFY_WRITE, uarg, size)) {
818 ds_dbg(3, "ds_ioctl(): verify_write = %d\n", -EFAULT); 807 pr_debug("ds_ioctl(): verify_write = %d\n", -EFAULT);
819 return -EFAULT; 808 return -EFAULT;
820 } 809 }
821 } 810 }
@@ -962,7 +951,7 @@ static int ds_ioctl(struct inode * inode, struct file * file,
962 } 951 }
963 952
964 if ((err == 0) && (ret != 0)) { 953 if ((err == 0) && (ret != 0)) {
965 ds_dbg(2, "ds_ioctl: ret = %d\n", ret); 954 pr_debug("ds_ioctl: ret = %d\n", ret);
966 switch (ret) { 955 switch (ret) {
967 case -ENODEV: 956 case -ENODEV:
968 case -EINVAL: 957 case -EINVAL: