summaryrefslogtreecommitdiff
path: root/drivers/isdn/divert
diff options
context:
space:
mode:
authorGeliang Tang <geliangtang@gmail.com>2017-03-23 21:15:57 +0800
committerDavid S. Miller <davem@davemloft.net>2017-03-24 12:33:42 -0700
commitaff55a3638a2d13de5cf0b0c45993378282cbe91 (patch)
treef410bca6f54d51817634f5a8fa92304ac69a1b4e /drivers/isdn/divert
parent9096643856919eba4ea7dd462e3528bc6d230f4f (diff)
isdn: use setup_timer
Use setup_timer() instead of init_timer() to simplify the code. Signed-off-by: Geliang Tang <geliangtang@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/isdn/divert')
-rw-r--r--drivers/isdn/divert/isdn_divert.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/isdn/divert/isdn_divert.c b/drivers/isdn/divert/isdn_divert.c
index 50749a70c5ca..060d357f107f 100644
--- a/drivers/isdn/divert/isdn_divert.c
+++ b/drivers/isdn/divert/isdn_divert.c
@@ -157,10 +157,8 @@ int cf_command(int drvid, int mode,
/* allocate mem for information struct */
if (!(cs = kmalloc(sizeof(struct call_struc), GFP_ATOMIC)))
return (-ENOMEM); /* no memory */
- init_timer(&cs->timer);
+ setup_timer(&cs->timer, deflect_timer_expire, (ulong)cs);
cs->info[0] = '\0';
- cs->timer.function = deflect_timer_expire;
- cs->timer.data = (ulong) cs; /* pointer to own structure */
cs->ics.driver = drvid;
cs->ics.command = ISDN_CMD_PROT_IO; /* protocol specific io */
cs->ics.arg = DSS1_CMD_INVOKE; /* invoke supplementary service */
@@ -452,10 +450,9 @@ static int isdn_divert_icall(isdn_ctrl *ic)
return (0); /* no external deflection needed */
if (!(cs = kmalloc(sizeof(struct call_struc), GFP_ATOMIC)))
return (0); /* no memory */
- init_timer(&cs->timer);
+ setup_timer(&cs->timer, deflect_timer_expire,
+ (ulong)cs);
cs->info[0] = '\0';
- cs->timer.function = deflect_timer_expire;
- cs->timer.data = (ulong) cs; /* pointer to own structure */
cs->ics = *ic; /* copy incoming data */
if (!cs->ics.parm.setup.phone[0]) strcpy(cs->ics.parm.setup.phone, "0");