caif: Bugfix not all services uses flow-ctrl.
Flow control is not used by all CAIF services.
The usage of flow control is now part of the gerneal
initialization function for CAIF Services.
Signed-off-by: Sjur Braendeland@stericsson.com
Signed-off-by: David S. Miller <davem@davemloft.net>
diff --git a/net/caif/cfrfml.c b/net/caif/cfrfml.c
index fd27b17..689cbfd 100644
--- a/net/caif/cfrfml.c
+++ b/net/caif/cfrfml.c
@@ -23,30 +23,26 @@
static int cfrfml_receive(struct cflayer *layr, struct cfpkt *pkt);
static int cfrfml_transmit(struct cflayer *layr, struct cfpkt *pkt);
-static int cfservl_modemcmd(struct cflayer *layr, enum caif_modemcmd ctrl);
struct cflayer *cfrfml_create(u8 channel_id, struct dev_info *dev_info)
{
struct cfsrvl *rfm = kmalloc(sizeof(struct cfsrvl), GFP_ATOMIC);
+
if (!rfm) {
pr_warning("CAIF: %s(): Out of memory\n", __func__);
return NULL;
}
+
caif_assert(offsetof(struct cfsrvl, layer) == 0);
+
memset(rfm, 0, sizeof(struct cfsrvl));
- cfsrvl_init(rfm, channel_id, dev_info);
- rfm->layer.modemcmd = cfservl_modemcmd;
+ cfsrvl_init(rfm, channel_id, dev_info, false);
rfm->layer.receive = cfrfml_receive;
rfm->layer.transmit = cfrfml_transmit;
snprintf(rfm->layer.name, CAIF_LAYER_NAME_SZ, "rfm%d", channel_id);
return &rfm->layer;
}
-static int cfservl_modemcmd(struct cflayer *layr, enum caif_modemcmd ctrl)
-{
- return -EPROTO;
-}
-
static int cfrfml_receive(struct cflayer *layr, struct cfpkt *pkt)
{
u8 tmp;