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>

authored by

Tilman Schmidt and committed by
David S. Miller
85a83560 a5e93151

+6
+6
drivers/isdn/capi/kcapi.c
··· 1147 1147 if (ctr->state == CAPI_CTR_DETECTED) 1148 1148 goto reset_unlock_out; 1149 1149 1150 + if (ctr->reset_ctr == NULL) { 1151 + printk(KERN_DEBUG "kcapi: reset: no reset function\n"); 1152 + retval = -ESRCH; 1153 + goto reset_unlock_out; 1154 + } 1155 + 1150 1156 ctr->reset_ctr(ctr); 1151 1157 1152 1158 retval = wait_on_ctr_state(ctr, CAPI_CTR_DETECTED);