summaryrefslogtreecommitdiffstats
path: root/net/caif/cfsrvl.c
diff options
context:
space:
mode:
authorSjur Braendeland <sjur.brandeland@stericsson.com>2010-04-28 10:54:36 +0200
committerDavid S. Miller <davem@davemloft.net>2010-04-28 21:55:12 +0200
commit5b2086567503f9b55136642031ec0067319f58e0 (patch)
tree00c4264ed7a8a989b398166c2c5f98175f5c28a5 /net/caif/cfsrvl.c
parentcaif: Rename functions in cfcnfg and caif_dev (diff)
downloadlinux-5b2086567503f9b55136642031ec0067319f58e0.tar.xz
linux-5b2086567503f9b55136642031ec0067319f58e0.zip
caif: Add reference counting to service layer
Changes: o Added functions cfsrvl_get and cfsrvl_put. o Added support release_client to use by socket and net device. o Increase reference counting for in-flight packets from cfmuxl Signed-off-by: Sjur Braendeland <sjur.brandeland@stericsson.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/caif/cfsrvl.c')
-rw-r--r--net/caif/cfsrvl.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/net/caif/cfsrvl.c b/net/caif/cfsrvl.c
index d470c51c6431..aff31f34528f 100644
--- a/net/caif/cfsrvl.c
+++ b/net/caif/cfsrvl.c
@@ -158,6 +158,13 @@ void cfsrvl_init(struct cfsrvl *service,
service->layer.ctrlcmd = cfservl_ctrlcmd;
service->layer.modemcmd = cfservl_modemcmd;
service->dev_info = *dev_info;
+ kref_init(&service->ref);
+}
+
+void cfsrvl_release(struct kref *kref)
+{
+ struct cfsrvl *service = container_of(kref, struct cfsrvl, ref);
+ kfree(service);
}
bool cfsrvl_ready(struct cfsrvl *service, int *err)