aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/isdn/gigaset/common.c
diff options
context:
space:
mode:
authorTilman Schmidt <tilman@imap.cc>2010-02-22 08:09:52 -0500
committerDavid S. Miller <davem@davemloft.net>2010-02-26 04:24:23 -0500
commit1528b18f7ec2b907711f37667c68e10d9296c882 (patch)
tree00c887ea15474334898ae1f89a05706be49079ed /drivers/isdn/gigaset/common.c
parent63e055d1c6e3a5f6d370cc841d621d5fa4d5d834 (diff)
gigaset: reduce syslog clutter
Improve readability of the Gigaset driver's kernel messages by removing a few unnecessary messages and limiting the emission of some debug messages more narrowly. Impact: logging Signed-off-by: Tilman Schmidt <tilman@imap.cc> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/isdn/gigaset/common.c')
-rw-r--r--drivers/isdn/gigaset/common.c49
1 files changed, 20 insertions, 29 deletions
diff --git a/drivers/isdn/gigaset/common.c b/drivers/isdn/gigaset/common.c
index 664b0c519c3e..85de3399a2f2 100644
--- a/drivers/isdn/gigaset/common.c
+++ b/drivers/isdn/gigaset/common.c
@@ -149,10 +149,8 @@ static int test_timeout(struct at_state_t *at_state)
149 return 0; 149 return 0;
150 } 150 }
151 151
152 if (!gigaset_add_event(at_state->cs, at_state, EV_TIMEOUT, NULL, 152 gigaset_add_event(at_state->cs, at_state, EV_TIMEOUT, NULL,
153 at_state->timer_index, NULL)) 153 at_state->timer_index, NULL);
154 dev_err(at_state->cs->dev, "%s: out of memory\n",
155 __func__);
156 return 1; 154 return 1;
157} 155}
158 156
@@ -180,7 +178,7 @@ static void timer_tick(unsigned long data)
180 if (cs->running) { 178 if (cs->running) {
181 mod_timer(&cs->timer, jiffies + msecs_to_jiffies(GIG_TICK)); 179 mod_timer(&cs->timer, jiffies + msecs_to_jiffies(GIG_TICK));
182 if (timeout) { 180 if (timeout) {
183 gig_dbg(DEBUG_CMD, "scheduling timeout"); 181 gig_dbg(DEBUG_EVENT, "scheduling timeout");
184 tasklet_schedule(&cs->event_tasklet); 182 tasklet_schedule(&cs->event_tasklet);
185 } 183 }
186 } 184 }
@@ -194,14 +192,14 @@ int gigaset_get_channel(struct bc_state *bcs)
194 192
195 spin_lock_irqsave(&bcs->cs->lock, flags); 193 spin_lock_irqsave(&bcs->cs->lock, flags);
196 if (bcs->use_count || !try_module_get(bcs->cs->driver->owner)) { 194 if (bcs->use_count || !try_module_get(bcs->cs->driver->owner)) {
197 gig_dbg(DEBUG_ANY, "could not allocate channel %d", 195 gig_dbg(DEBUG_CHANNEL, "could not allocate channel %d",
198 bcs->channel); 196 bcs->channel);
199 spin_unlock_irqrestore(&bcs->cs->lock, flags); 197 spin_unlock_irqrestore(&bcs->cs->lock, flags);
200 return 0; 198 return 0;
201 } 199 }
202 ++bcs->use_count; 200 ++bcs->use_count;
203 bcs->busy = 1; 201 bcs->busy = 1;
204 gig_dbg(DEBUG_ANY, "allocated channel %d", bcs->channel); 202 gig_dbg(DEBUG_CHANNEL, "allocated channel %d", bcs->channel);
205 spin_unlock_irqrestore(&bcs->cs->lock, flags); 203 spin_unlock_irqrestore(&bcs->cs->lock, flags);
206 return 1; 204 return 1;
207} 205}
@@ -213,7 +211,7 @@ struct bc_state *gigaset_get_free_channel(struct cardstate *cs)
213 211
214 spin_lock_irqsave(&cs->lock, flags); 212 spin_lock_irqsave(&cs->lock, flags);
215 if (!try_module_get(cs->driver->owner)) { 213 if (!try_module_get(cs->driver->owner)) {
216 gig_dbg(DEBUG_ANY, 214 gig_dbg(DEBUG_CHANNEL,
217 "could not get module for allocating channel"); 215 "could not get module for allocating channel");
218 spin_unlock_irqrestore(&cs->lock, flags); 216 spin_unlock_irqrestore(&cs->lock, flags);
219 return NULL; 217 return NULL;
@@ -223,12 +221,12 @@ struct bc_state *gigaset_get_free_channel(struct cardstate *cs)
223 ++cs->bcs[i].use_count; 221 ++cs->bcs[i].use_count;
224 cs->bcs[i].busy = 1; 222 cs->bcs[i].busy = 1;
225 spin_unlock_irqrestore(&cs->lock, flags); 223 spin_unlock_irqrestore(&cs->lock, flags);
226 gig_dbg(DEBUG_ANY, "allocated channel %d", i); 224 gig_dbg(DEBUG_CHANNEL, "allocated channel %d", i);
227 return cs->bcs + i; 225 return cs->bcs + i;
228 } 226 }
229 module_put(cs->driver->owner); 227 module_put(cs->driver->owner);
230 spin_unlock_irqrestore(&cs->lock, flags); 228 spin_unlock_irqrestore(&cs->lock, flags);
231 gig_dbg(DEBUG_ANY, "no free channel"); 229 gig_dbg(DEBUG_CHANNEL, "no free channel");
232 return NULL; 230 return NULL;
233} 231}
234 232
@@ -238,14 +236,15 @@ void gigaset_free_channel(struct bc_state *bcs)
238 236
239 spin_lock_irqsave(&bcs->cs->lock, flags); 237 spin_lock_irqsave(&bcs->cs->lock, flags);
240 if (!bcs->busy) { 238 if (!bcs->busy) {
241 gig_dbg(DEBUG_ANY, "could not free channel %d", bcs->channel); 239 gig_dbg(DEBUG_CHANNEL, "could not free channel %d",
240 bcs->channel);
242 spin_unlock_irqrestore(&bcs->cs->lock, flags); 241 spin_unlock_irqrestore(&bcs->cs->lock, flags);
243 return; 242 return;
244 } 243 }
245 --bcs->use_count; 244 --bcs->use_count;
246 bcs->busy = 0; 245 bcs->busy = 0;
247 module_put(bcs->cs->driver->owner); 246 module_put(bcs->cs->driver->owner);
248 gig_dbg(DEBUG_ANY, "freed channel %d", bcs->channel); 247 gig_dbg(DEBUG_CHANNEL, "freed channel %d", bcs->channel);
249 spin_unlock_irqrestore(&bcs->cs->lock, flags); 248 spin_unlock_irqrestore(&bcs->cs->lock, flags);
250} 249}
251 250
@@ -258,14 +257,15 @@ int gigaset_get_channels(struct cardstate *cs)
258 for (i = 0; i < cs->channels; ++i) 257 for (i = 0; i < cs->channels; ++i)
259 if (cs->bcs[i].use_count) { 258 if (cs->bcs[i].use_count) {
260 spin_unlock_irqrestore(&cs->lock, flags); 259 spin_unlock_irqrestore(&cs->lock, flags);
261 gig_dbg(DEBUG_ANY, "could not allocate all channels"); 260 gig_dbg(DEBUG_CHANNEL,
261 "could not allocate all channels");
262 return 0; 262 return 0;
263 } 263 }
264 for (i = 0; i < cs->channels; ++i) 264 for (i = 0; i < cs->channels; ++i)
265 ++cs->bcs[i].use_count; 265 ++cs->bcs[i].use_count;
266 spin_unlock_irqrestore(&cs->lock, flags); 266 spin_unlock_irqrestore(&cs->lock, flags);
267 267
268 gig_dbg(DEBUG_ANY, "allocated all channels"); 268 gig_dbg(DEBUG_CHANNEL, "allocated all channels");
269 269
270 return 1; 270 return 1;
271} 271}
@@ -275,7 +275,7 @@ void gigaset_free_channels(struct cardstate *cs)
275 unsigned long flags; 275 unsigned long flags;
276 int i; 276 int i;
277 277
278 gig_dbg(DEBUG_ANY, "unblocking all channels"); 278 gig_dbg(DEBUG_CHANNEL, "unblocking all channels");
279 spin_lock_irqsave(&cs->lock, flags); 279 spin_lock_irqsave(&cs->lock, flags);
280 for (i = 0; i < cs->channels; ++i) 280 for (i = 0; i < cs->channels; ++i)
281 --cs->bcs[i].use_count; 281 --cs->bcs[i].use_count;
@@ -287,7 +287,7 @@ void gigaset_block_channels(struct cardstate *cs)
287 unsigned long flags; 287 unsigned long flags;
288 int i; 288 int i;
289 289
290 gig_dbg(DEBUG_ANY, "blocking all channels"); 290 gig_dbg(DEBUG_CHANNEL, "blocking all channels");
291 spin_lock_irqsave(&cs->lock, flags); 291 spin_lock_irqsave(&cs->lock, flags);
292 for (i = 0; i < cs->channels; ++i) 292 for (i = 0; i < cs->channels; ++i)
293 ++cs->bcs[i].use_count; 293 ++cs->bcs[i].use_count;
@@ -338,6 +338,8 @@ struct event_t *gigaset_add_event(struct cardstate *cs,
338 unsigned next, tail; 338 unsigned next, tail;
339 struct event_t *event = NULL; 339 struct event_t *event = NULL;
340 340
341 gig_dbg(DEBUG_EVENT, "queueing event %d", type);
342
341 spin_lock_irqsave(&cs->ev_lock, flags); 343 spin_lock_irqsave(&cs->ev_lock, flags);
342 344
343 tail = cs->ev_tail; 345 tail = cs->ev_tail;
@@ -934,11 +936,8 @@ int gigaset_start(struct cardstate *cs)
934 936
935 if (!gigaset_add_event(cs, &cs->at_state, EV_START, NULL, 0, NULL)) { 937 if (!gigaset_add_event(cs, &cs->at_state, EV_START, NULL, 0, NULL)) {
936 cs->waiting = 0; 938 cs->waiting = 0;
937 dev_err(cs->dev, "%s: out of memory\n", __func__);
938 goto error; 939 goto error;
939 } 940 }
940
941 gig_dbg(DEBUG_CMD, "scheduling START");
942 gigaset_schedule_event(cs); 941 gigaset_schedule_event(cs);
943 942
944 wait_event(cs->waitqueue, !cs->waiting); 943 wait_event(cs->waitqueue, !cs->waiting);
@@ -973,12 +972,8 @@ int gigaset_shutdown(struct cardstate *cs)
973 972
974 cs->waiting = 1; 973 cs->waiting = 1;
975 974
976 if (!gigaset_add_event(cs, &cs->at_state, EV_SHUTDOWN, NULL, 0, NULL)) { 975 if (!gigaset_add_event(cs, &cs->at_state, EV_SHUTDOWN, NULL, 0, NULL))
977 dev_err(cs->dev, "%s: out of memory\n", __func__);
978 goto exit; 976 goto exit;
979 }
980
981 gig_dbg(DEBUG_CMD, "scheduling SHUTDOWN");
982 gigaset_schedule_event(cs); 977 gigaset_schedule_event(cs);
983 978
984 wait_event(cs->waitqueue, !cs->waiting); 979 wait_event(cs->waitqueue, !cs->waiting);
@@ -1004,12 +999,8 @@ void gigaset_stop(struct cardstate *cs)
1004 999
1005 cs->waiting = 1; 1000 cs->waiting = 1;
1006 1001
1007 if (!gigaset_add_event(cs, &cs->at_state, EV_STOP, NULL, 0, NULL)) { 1002 if (!gigaset_add_event(cs, &cs->at_state, EV_STOP, NULL, 0, NULL))
1008 dev_err(cs->dev, "%s: out of memory\n", __func__);
1009 goto exit; 1003 goto exit;
1010 }
1011
1012 gig_dbg(DEBUG_CMD, "scheduling STOP");
1013 gigaset_schedule_event(cs); 1004 gigaset_schedule_event(cs);
1014 1005
1015 wait_event(cs->waitqueue, !cs->waiting); 1006 wait_event(cs->waitqueue, !cs->waiting);