summaryrefslogtreecommitdiffstats
path: root/drivers/isdn/capi
diff options
context:
space:
mode:
authorTilman Schmidt <tilman@imap.cc>2010-05-23 01:02:08 +0000
committerDavid S. Miller <davem@davemloft.net>2010-05-23 23:57:44 -0700
commit85a83560afa69862639fb2d6f670b4440a003335 (patch)
treee05b3b907a204fc99f1a5115ed7ab03ce67a9d4d /drivers/isdn/capi
parenta5e93151e4390e4d27bee27ddb73f78f58260594 (diff)
downloadop-kernel-dev-85a83560afa69862639fb2d6f670b4440a003335.zip
op-kernel-dev-85a83560afa69862639fb2d6f670b4440a003335.tar.gz
isdn/capi: make reset_ctr op truly optional
The CAPI controller operation reset_ctr is marked as optional, and not all drivers do implement it. Add a check to the kernel CAPI whether it exists before trying to call it. Signed-off-by: Tilman Schmidt <tilman@imap.cc> Acked-by: Karsten Keil <isdn@linux-pingi.de> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/isdn/capi')
-rw-r--r--drivers/isdn/capi/kcapi.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/isdn/capi/kcapi.c b/drivers/isdn/capi/kcapi.c
index bd00dce..bde3c88 100644
--- a/drivers/isdn/capi/kcapi.c
+++ b/drivers/isdn/capi/kcapi.c
@@ -1147,6 +1147,12 @@ load_unlock_out:
if (ctr->state == CAPI_CTR_DETECTED)
goto reset_unlock_out;
+ if (ctr->reset_ctr == NULL) {
+ printk(KERN_DEBUG "kcapi: reset: no reset function\n");
+ retval = -ESRCH;
+ goto reset_unlock_out;
+ }
+
ctr->reset_ctr(ctr);
retval = wait_on_ctr_state(ctr, CAPI_CTR_DETECTED);
OpenPOWER on IntegriCloud