Source
40
40
};
41
41
42
42
static int cfmuxl_receive(struct cflayer *layr, struct cfpkt *pkt);
43
43
static int cfmuxl_transmit(struct cflayer *layr, struct cfpkt *pkt);
44
44
static void cfmuxl_ctrlcmd(struct cflayer *layr, enum caif_ctrlcmd ctrl,
45
45
int phyid);
46
46
static struct cflayer *get_up(struct cfmuxl *muxl, u16 id);
47
47
48
48
struct cflayer *cfmuxl_create(void)
49
49
{
50
-
struct cfmuxl *this = kmalloc(sizeof(struct cfmuxl), GFP_ATOMIC);
50
+
struct cfmuxl *this = kzalloc(sizeof(struct cfmuxl), GFP_ATOMIC);
51
+
51
52
if (!this)
52
53
return NULL;
53
-
memset(this, 0, sizeof(*this));
54
54
this->layer.receive = cfmuxl_receive;
55
55
this->layer.transmit = cfmuxl_transmit;
56
56
this->layer.ctrlcmd = cfmuxl_ctrlcmd;
57
57
INIT_LIST_HEAD(&this->srvl_list);
58
58
INIT_LIST_HEAD(&this->frml_list);
59
59
spin_lock_init(&this->transmit_lock);
60
60
spin_lock_init(&this->receive_lock);
61
61
snprintf(this->layer.name, CAIF_LAYER_NAME_SZ, "mux");
62
62
return &this->layer;
63
63
}