aboutsummaryrefslogtreecommitdiffstats
path: root/net/irda/irda_device.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/irda/irda_device.c')
-rw-r--r--net/irda/irda_device.c34
1 files changed, 13 insertions, 21 deletions
diff --git a/net/irda/irda_device.c b/net/irda/irda_device.c
index 9e0d909390fd..856736656a30 100644
--- a/net/irda/irda_device.c
+++ b/net/irda/irda_device.c
@@ -63,14 +63,14 @@ int __init irda_device_init( void)
63{ 63{
64 dongles = hashbin_new(HB_NOLOCK); 64 dongles = hashbin_new(HB_NOLOCK);
65 if (dongles == NULL) { 65 if (dongles == NULL) {
66 IRDA_WARNING("IrDA: Can't allocate dongles hashbin!\n"); 66 net_warn_ratelimited("IrDA: Can't allocate dongles hashbin!\n");
67 return -ENOMEM; 67 return -ENOMEM;
68 } 68 }
69 spin_lock_init(&dongles->hb_spinlock); 69 spin_lock_init(&dongles->hb_spinlock);
70 70
71 tasks = hashbin_new(HB_LOCK); 71 tasks = hashbin_new(HB_LOCK);
72 if (tasks == NULL) { 72 if (tasks == NULL) {
73 IRDA_WARNING("IrDA: Can't allocate tasks hashbin!\n"); 73 net_warn_ratelimited("IrDA: Can't allocate tasks hashbin!\n");
74 hashbin_delete(dongles, NULL); 74 hashbin_delete(dongles, NULL);
75 return -ENOMEM; 75 return -ENOMEM;
76 } 76 }
@@ -84,14 +84,12 @@ int __init irda_device_init( void)
84static void leftover_dongle(void *arg) 84static void leftover_dongle(void *arg)
85{ 85{
86 struct dongle_reg *reg = arg; 86 struct dongle_reg *reg = arg;
87 IRDA_WARNING("IrDA: Dongle type %x not unregistered\n", 87 net_warn_ratelimited("IrDA: Dongle type %x not unregistered\n",
88 reg->type); 88 reg->type);
89} 89}
90 90
91void irda_device_cleanup(void) 91void irda_device_cleanup(void)
92{ 92{
93 IRDA_DEBUG(4, "%s()\n", __func__);
94
95 hashbin_delete(tasks, (FREE_FUNC) __irda_task_delete); 93 hashbin_delete(tasks, (FREE_FUNC) __irda_task_delete);
96 94
97 hashbin_delete(dongles, leftover_dongle); 95 hashbin_delete(dongles, leftover_dongle);
@@ -107,7 +105,7 @@ void irda_device_set_media_busy(struct net_device *dev, int status)
107{ 105{
108 struct irlap_cb *self; 106 struct irlap_cb *self;
109 107
110 IRDA_DEBUG(4, "%s(%s)\n", __func__, status ? "TRUE" : "FALSE"); 108 pr_debug("%s(%s)\n", __func__, status ? "TRUE" : "FALSE");
111 109
112 self = (struct irlap_cb *) dev->atalk_ptr; 110 self = (struct irlap_cb *) dev->atalk_ptr;
113 111
@@ -127,7 +125,7 @@ void irda_device_set_media_busy(struct net_device *dev, int status)
127 irlap_start_mbusy_timer(self, SMALLBUSY_TIMEOUT); 125 irlap_start_mbusy_timer(self, SMALLBUSY_TIMEOUT);
128 else 126 else
129 irlap_start_mbusy_timer(self, MEDIABUSY_TIMEOUT); 127 irlap_start_mbusy_timer(self, MEDIABUSY_TIMEOUT);
130 IRDA_DEBUG( 4, "Media busy!\n"); 128 pr_debug("Media busy!\n");
131 } else { 129 } else {
132 self->media_busy = FALSE; 130 self->media_busy = FALSE;
133 irlap_stop_mbusy_timer(self); 131 irlap_stop_mbusy_timer(self);
@@ -147,11 +145,9 @@ int irda_device_is_receiving(struct net_device *dev)
147 struct if_irda_req req; 145 struct if_irda_req req;
148 int ret; 146 int ret;
149 147
150 IRDA_DEBUG(2, "%s()\n", __func__);
151
152 if (!dev->netdev_ops->ndo_do_ioctl) { 148 if (!dev->netdev_ops->ndo_do_ioctl) {
153 IRDA_ERROR("%s: do_ioctl not impl. by device driver\n", 149 net_err_ratelimited("%s: do_ioctl not impl. by device driver\n",
154 __func__); 150 __func__);
155 return -1; 151 return -1;
156 } 152 }
157 153
@@ -192,8 +188,6 @@ static int irda_task_kick(struct irda_task *task)
192 int count = 0; 188 int count = 0;
193 int timeout; 189 int timeout;
194 190
195 IRDA_DEBUG(2, "%s()\n", __func__);
196
197 IRDA_ASSERT(task != NULL, return -1;); 191 IRDA_ASSERT(task != NULL, return -1;);
198 IRDA_ASSERT(task->magic == IRDA_TASK_MAGIC, return -1;); 192 IRDA_ASSERT(task->magic == IRDA_TASK_MAGIC, return -1;);
199 193
@@ -201,15 +195,15 @@ static int irda_task_kick(struct irda_task *task)
201 do { 195 do {
202 timeout = task->function(task); 196 timeout = task->function(task);
203 if (count++ > 100) { 197 if (count++ > 100) {
204 IRDA_ERROR("%s: error in task handler!\n", 198 net_err_ratelimited("%s: error in task handler!\n",
205 __func__); 199 __func__);
206 irda_task_delete(task); 200 irda_task_delete(task);
207 return TRUE; 201 return TRUE;
208 } 202 }
209 } while ((timeout == 0) && (task->state != IRDA_TASK_DONE)); 203 } while ((timeout == 0) && (task->state != IRDA_TASK_DONE));
210 204
211 if (timeout < 0) { 205 if (timeout < 0) {
212 IRDA_ERROR("%s: Error executing task!\n", __func__); 206 net_err_ratelimited("%s: Error executing task!\n", __func__);
213 irda_task_delete(task); 207 irda_task_delete(task);
214 return TRUE; 208 return TRUE;
215 } 209 }
@@ -241,8 +235,8 @@ static int irda_task_kick(struct irda_task *task)
241 irda_task_timer_expired); 235 irda_task_timer_expired);
242 finished = FALSE; 236 finished = FALSE;
243 } else { 237 } else {
244 IRDA_DEBUG(0, "%s(), not finished, and no timeout!\n", 238 pr_debug("%s(), not finished, and no timeout!\n",
245 __func__); 239 __func__);
246 finished = FALSE; 240 finished = FALSE;
247 } 241 }
248 242
@@ -259,8 +253,6 @@ static void irda_task_timer_expired(void *data)
259{ 253{
260 struct irda_task *task; 254 struct irda_task *task;
261 255
262 IRDA_DEBUG(2, "%s()\n", __func__);
263
264 task = data; 256 task = data;
265 257
266 irda_task_kick(task); 258 irda_task_kick(task);