aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/isdn/gigaset
diff options
context:
space:
mode:
authorTilman Schmidt <tilman@imap.cc>2012-04-25 09:02:20 -0400
committerDavid S. Miller <davem@davemloft.net>2012-05-07 22:37:56 -0400
commit7643ffbd02ac46f880f64bed24a85d453b501418 (patch)
treeb32aef5eb4e317d782cb78c2db24c175c64f9d99 /drivers/isdn/gigaset
parentf86936ff3826558307bf99f0db3220ac8b7ffd8f (diff)
isdn/gigaset: internal function name cleanup
Functions clear_at_state and free_strings did the same thing; drop one of them, keeping the more descriptive name. Drop a redundant call. Rename function dealloc_at_states to dealloc_temp_at_states to clarify its purpose. Signed-off-by: Tilman Schmidt <tilman@imap.cc> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/isdn/gigaset')
-rw-r--r--drivers/isdn/gigaset/common.c16
1 files changed, 5 insertions, 11 deletions
diff --git a/drivers/isdn/gigaset/common.c b/drivers/isdn/gigaset/common.c
index 76792707f995..6c306d4551dc 100644
--- a/drivers/isdn/gigaset/common.c
+++ b/drivers/isdn/gigaset/common.c
@@ -362,7 +362,7 @@ struct event_t *gigaset_add_event(struct cardstate *cs,
362} 362}
363EXPORT_SYMBOL_GPL(gigaset_add_event); 363EXPORT_SYMBOL_GPL(gigaset_add_event);
364 364
365static void free_strings(struct at_state_t *at_state) 365static void clear_at_state(struct at_state_t *at_state)
366{ 366{
367 int i; 367 int i;
368 368
@@ -372,18 +372,13 @@ static void free_strings(struct at_state_t *at_state)
372 } 372 }
373} 373}
374 374
375static void clear_at_state(struct at_state_t *at_state) 375static void dealloc_temp_at_states(struct cardstate *cs)
376{
377 free_strings(at_state);
378}
379
380static void dealloc_at_states(struct cardstate *cs)
381{ 376{
382 struct at_state_t *cur, *next; 377 struct at_state_t *cur, *next;
383 378
384 list_for_each_entry_safe(cur, next, &cs->temp_at_states, list) { 379 list_for_each_entry_safe(cur, next, &cs->temp_at_states, list) {
385 list_del(&cur->list); 380 list_del(&cur->list);
386 free_strings(cur); 381 clear_at_state(cur);
387 kfree(cur); 382 kfree(cur);
388 } 383 }
389} 384}
@@ -512,7 +507,7 @@ void gigaset_freecs(struct cardstate *cs)
512 case 1: /* error when registering to LL */ 507 case 1: /* error when registering to LL */
513 gig_dbg(DEBUG_INIT, "clearing at_state"); 508 gig_dbg(DEBUG_INIT, "clearing at_state");
514 clear_at_state(&cs->at_state); 509 clear_at_state(&cs->at_state);
515 dealloc_at_states(cs); 510 dealloc_temp_at_states(cs);
516 511
517 /* fall through */ 512 /* fall through */
518 case 0: /* error in basic setup */ 513 case 0: /* error in basic setup */
@@ -848,8 +843,7 @@ static void cleanup_cs(struct cardstate *cs)
848 cs->mstate = MS_UNINITIALIZED; 843 cs->mstate = MS_UNINITIALIZED;
849 844
850 clear_at_state(&cs->at_state); 845 clear_at_state(&cs->at_state);
851 dealloc_at_states(cs); 846 dealloc_temp_at_states(cs);
852 free_strings(&cs->at_state);
853 gigaset_at_init(&cs->at_state, NULL, cs, 0); 847 gigaset_at_init(&cs->at_state, NULL, cs, 0);
854 848
855 cs->inbuf->inputstate = INS_command; 849 cs->inbuf->inputstate = INS_command;