Commit b31fa5ba authored by Joe Perches's avatar Joe Perches Committed by David S. Miller

net/caif: Use pr_fmt

This patch standardizes caif message logging prefixes.

Add #define pr_fmt(fmt) KBUILD_MODNAME ":%s(): " fmt, __func__
Add missing "\n"s to some logging messages
Convert pr_warning to pr_warn

This changes the logging message prefix from CAIF: to caif:
for all uses but caif_socket.c and chnl_net.c.  Those now use
their filename without extension.
Signed-off-by: default avatarJoe Perches <joe@perches.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent a0ece285
...@@ -9,6 +9,8 @@ ...@@ -9,6 +9,8 @@
* and Sakari Ailus <sakari.ailus@nokia.com> * and Sakari Ailus <sakari.ailus@nokia.com>
*/ */
#define pr_fmt(fmt) KBUILD_MODNAME ":%s(): " fmt, __func__
#include <linux/version.h> #include <linux/version.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/kernel.h> #include <linux/kernel.h>
...@@ -214,7 +216,7 @@ static int caif_device_notify(struct notifier_block *me, unsigned long what, ...@@ -214,7 +216,7 @@ static int caif_device_notify(struct notifier_block *me, unsigned long what,
switch (what) { switch (what) {
case NETDEV_REGISTER: case NETDEV_REGISTER:
pr_info("CAIF: %s():register %s\n", __func__, dev->name); pr_info("register %s\n", dev->name);
caifd = caif_device_alloc(dev); caifd = caif_device_alloc(dev);
if (caifd == NULL) if (caifd == NULL)
break; break;
...@@ -225,14 +227,13 @@ static int caif_device_notify(struct notifier_block *me, unsigned long what, ...@@ -225,14 +227,13 @@ static int caif_device_notify(struct notifier_block *me, unsigned long what,
break; break;
case NETDEV_UP: case NETDEV_UP:
pr_info("CAIF: %s(): up %s\n", __func__, dev->name); pr_info("up %s\n", dev->name);
caifd = caif_get(dev); caifd = caif_get(dev);
if (caifd == NULL) if (caifd == NULL)
break; break;
caifdev = netdev_priv(dev); caifdev = netdev_priv(dev);
if (atomic_read(&caifd->state) == NETDEV_UP) { if (atomic_read(&caifd->state) == NETDEV_UP) {
pr_info("CAIF: %s():%s already up\n", pr_info("%s already up\n", dev->name);
__func__, dev->name);
break; break;
} }
atomic_set(&caifd->state, what); atomic_set(&caifd->state, what);
...@@ -273,7 +274,7 @@ static int caif_device_notify(struct notifier_block *me, unsigned long what, ...@@ -273,7 +274,7 @@ static int caif_device_notify(struct notifier_block *me, unsigned long what,
caifd = caif_get(dev); caifd = caif_get(dev);
if (caifd == NULL) if (caifd == NULL)
break; break;
pr_info("CAIF: %s():going down %s\n", __func__, dev->name); pr_info("going down %s\n", dev->name);
if (atomic_read(&caifd->state) == NETDEV_GOING_DOWN || if (atomic_read(&caifd->state) == NETDEV_GOING_DOWN ||
atomic_read(&caifd->state) == NETDEV_DOWN) atomic_read(&caifd->state) == NETDEV_DOWN)
...@@ -295,11 +296,10 @@ static int caif_device_notify(struct notifier_block *me, unsigned long what, ...@@ -295,11 +296,10 @@ static int caif_device_notify(struct notifier_block *me, unsigned long what,
caifd = caif_get(dev); caifd = caif_get(dev);
if (caifd == NULL) if (caifd == NULL)
break; break;
pr_info("CAIF: %s(): down %s\n", __func__, dev->name); pr_info("down %s\n", dev->name);
if (atomic_read(&caifd->in_use)) if (atomic_read(&caifd->in_use))
pr_warning("CAIF: %s(): " pr_warn("Unregistering an active CAIF device: %s\n",
"Unregistering an active CAIF device: %s\n", dev->name);
__func__, dev->name);
cfcnfg_del_phy_layer(get_caif_conf(), &caifd->layer); cfcnfg_del_phy_layer(get_caif_conf(), &caifd->layer);
dev_put(dev); dev_put(dev);
atomic_set(&caifd->state, what); atomic_set(&caifd->state, what);
...@@ -307,7 +307,7 @@ static int caif_device_notify(struct notifier_block *me, unsigned long what, ...@@ -307,7 +307,7 @@ static int caif_device_notify(struct notifier_block *me, unsigned long what,
case NETDEV_UNREGISTER: case NETDEV_UNREGISTER:
caifd = caif_get(dev); caifd = caif_get(dev);
pr_info("CAIF: %s(): unregister %s\n", __func__, dev->name); pr_info("unregister %s\n", dev->name);
atomic_set(&caifd->state, what); atomic_set(&caifd->state, what);
caif_device_destroy(dev); caif_device_destroy(dev);
break; break;
...@@ -391,7 +391,7 @@ static int __init caif_device_init(void) ...@@ -391,7 +391,7 @@ static int __init caif_device_init(void)
int result; int result;
cfg = cfcnfg_create(); cfg = cfcnfg_create();
if (!cfg) { if (!cfg) {
pr_warning("CAIF: %s(): can't create cfcnfg.\n", __func__); pr_warn("can't create cfcnfg\n");
goto err_cfcnfg_create_failed; goto err_cfcnfg_create_failed;
} }
result = register_pernet_device(&caif_net_ops); result = register_pernet_device(&caif_net_ops);
......
...@@ -4,6 +4,8 @@ ...@@ -4,6 +4,8 @@
* License terms: GNU General Public License (GPL) version 2 * License terms: GNU General Public License (GPL) version 2
*/ */
#define pr_fmt(fmt) KBUILD_MODNAME ":%s(): " fmt, __func__
#include <linux/fs.h> #include <linux/fs.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/module.h> #include <linux/module.h>
...@@ -157,8 +159,8 @@ static int caif_queue_rcv_skb(struct sock *sk, struct sk_buff *skb) ...@@ -157,8 +159,8 @@ static int caif_queue_rcv_skb(struct sock *sk, struct sk_buff *skb)
if (atomic_read(&sk->sk_rmem_alloc) + skb->truesize >= if (atomic_read(&sk->sk_rmem_alloc) + skb->truesize >=
(unsigned)sk->sk_rcvbuf && rx_flow_is_on(cf_sk)) { (unsigned)sk->sk_rcvbuf && rx_flow_is_on(cf_sk)) {
trace_printk("CAIF: %s():" trace_printk("CAIF: %s(): "
" sending flow OFF (queue len = %d %d)\n", "sending flow OFF (queue len = %d %d)\n",
__func__, __func__,
atomic_read(&cf_sk->sk.sk_rmem_alloc), atomic_read(&cf_sk->sk.sk_rmem_alloc),
sk_rcvbuf_lowwater(cf_sk)); sk_rcvbuf_lowwater(cf_sk));
...@@ -172,8 +174,8 @@ static int caif_queue_rcv_skb(struct sock *sk, struct sk_buff *skb) ...@@ -172,8 +174,8 @@ static int caif_queue_rcv_skb(struct sock *sk, struct sk_buff *skb)
return err; return err;
if (!sk_rmem_schedule(sk, skb->truesize) && rx_flow_is_on(cf_sk)) { if (!sk_rmem_schedule(sk, skb->truesize) && rx_flow_is_on(cf_sk)) {
set_rx_flow_off(cf_sk); set_rx_flow_off(cf_sk);
trace_printk("CAIF: %s():" trace_printk("CAIF: %s(): "
" sending flow OFF due to rmem_schedule\n", "sending flow OFF due to rmem_schedule\n",
__func__); __func__);
dbfs_atomic_inc(&cnt.num_rx_flow_off); dbfs_atomic_inc(&cnt.num_rx_flow_off);
caif_flow_ctrl(sk, CAIF_MODEMCMD_FLOW_OFF_REQ); caif_flow_ctrl(sk, CAIF_MODEMCMD_FLOW_OFF_REQ);
...@@ -275,8 +277,7 @@ static void caif_ctrl_cb(struct cflayer *layr, ...@@ -275,8 +277,7 @@ static void caif_ctrl_cb(struct cflayer *layr,
break; break;
default: default:
pr_debug("CAIF: %s(): Unexpected flow command %d\n", pr_debug("Unexpected flow command %d\n", flow);
__func__, flow);
} }
} }
...@@ -536,8 +537,7 @@ static int transmit_skb(struct sk_buff *skb, struct caifsock *cf_sk, ...@@ -536,8 +537,7 @@ static int transmit_skb(struct sk_buff *skb, struct caifsock *cf_sk,
/* Slight paranoia, probably not needed. */ /* Slight paranoia, probably not needed. */
if (unlikely(loopcnt++ > 1000)) { if (unlikely(loopcnt++ > 1000)) {
pr_warning("CAIF: %s(): transmit retries failed," pr_warn("transmit retries failed, error = %d\n", ret);
" error = %d\n", __func__, ret);
break; break;
} }
...@@ -902,8 +902,7 @@ static int caif_connect(struct socket *sock, struct sockaddr *uaddr, ...@@ -902,8 +902,7 @@ static int caif_connect(struct socket *sock, struct sockaddr *uaddr,
cf_sk->maxframe = dev->mtu - (headroom + tailroom); cf_sk->maxframe = dev->mtu - (headroom + tailroom);
dev_put(dev); dev_put(dev);
if (cf_sk->maxframe < 1) { if (cf_sk->maxframe < 1) {
pr_warning("CAIF: %s(): CAIF Interface MTU too small (%d)\n", pr_warn("CAIF Interface MTU too small (%d)\n", dev->mtu);
__func__, dev->mtu);
err = -ENODEV; err = -ENODEV;
goto out; goto out;
} }
......
...@@ -3,6 +3,9 @@ ...@@ -3,6 +3,9 @@
* Author: Sjur Brendeland/sjur.brandeland@stericsson.com * Author: Sjur Brendeland/sjur.brandeland@stericsson.com
* License terms: GNU General Public License (GPL) version 2 * License terms: GNU General Public License (GPL) version 2
*/ */
#define pr_fmt(fmt) KBUILD_MODNAME ":%s(): " fmt, __func__
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/stddef.h> #include <linux/stddef.h>
#include <linux/slab.h> #include <linux/slab.h>
...@@ -78,7 +81,7 @@ struct cfcnfg *cfcnfg_create(void) ...@@ -78,7 +81,7 @@ struct cfcnfg *cfcnfg_create(void)
/* Initiate this layer */ /* Initiate this layer */
this = kzalloc(sizeof(struct cfcnfg), GFP_ATOMIC); this = kzalloc(sizeof(struct cfcnfg), GFP_ATOMIC);
if (!this) { if (!this) {
pr_warning("CAIF: %s(): Out of memory\n", __func__); pr_warn("Out of memory\n");
return NULL; return NULL;
} }
this->mux = cfmuxl_create(); this->mux = cfmuxl_create();
...@@ -106,7 +109,7 @@ struct cfcnfg *cfcnfg_create(void) ...@@ -106,7 +109,7 @@ struct cfcnfg *cfcnfg_create(void)
layer_set_up(this->ctrl, this); layer_set_up(this->ctrl, this);
return this; return this;
out_of_mem: out_of_mem:
pr_warning("CAIF: %s(): Out of memory\n", __func__); pr_warn("Out of memory\n");
kfree(this->mux); kfree(this->mux);
kfree(this->ctrl); kfree(this->ctrl);
kfree(this); kfree(this);
...@@ -194,7 +197,7 @@ int cfcnfg_disconn_adapt_layer(struct cfcnfg *cnfg, struct cflayer *adap_layer) ...@@ -194,7 +197,7 @@ int cfcnfg_disconn_adapt_layer(struct cfcnfg *cnfg, struct cflayer *adap_layer)
caif_assert(adap_layer != NULL); caif_assert(adap_layer != NULL);
channel_id = adap_layer->id; channel_id = adap_layer->id;
if (adap_layer->dn == NULL || channel_id == 0) { if (adap_layer->dn == NULL || channel_id == 0) {
pr_err("CAIF: %s():adap_layer->id is 0\n", __func__); pr_err("adap_layer->id is 0\n");
ret = -ENOTCONN; ret = -ENOTCONN;
goto end; goto end;
} }
...@@ -204,9 +207,8 @@ int cfcnfg_disconn_adapt_layer(struct cfcnfg *cnfg, struct cflayer *adap_layer) ...@@ -204,9 +207,8 @@ int cfcnfg_disconn_adapt_layer(struct cfcnfg *cnfg, struct cflayer *adap_layer)
layer_set_up(servl, NULL); layer_set_up(servl, NULL);
ret = cfctrl_linkdown_req(cnfg->ctrl, channel_id, adap_layer); ret = cfctrl_linkdown_req(cnfg->ctrl, channel_id, adap_layer);
if (servl == NULL) { if (servl == NULL) {
pr_err("CAIF: %s(): PROTOCOL ERROR " pr_err("PROTOCOL ERROR - Error removing service_layer Channel_Id(%d)",
"- Error removing service_layer Channel_Id(%d)", channel_id);
__func__, channel_id);
ret = -EINVAL; ret = -EINVAL;
goto end; goto end;
} }
...@@ -216,18 +218,14 @@ int cfcnfg_disconn_adapt_layer(struct cfcnfg *cnfg, struct cflayer *adap_layer) ...@@ -216,18 +218,14 @@ int cfcnfg_disconn_adapt_layer(struct cfcnfg *cnfg, struct cflayer *adap_layer)
phyinfo = cfcnfg_get_phyinfo(cnfg, phyid); phyinfo = cfcnfg_get_phyinfo(cnfg, phyid);
if (phyinfo == NULL) { if (phyinfo == NULL) {
pr_warning("CAIF: %s(): " pr_warn("No interface to send disconnect to\n");
"No interface to send disconnect to\n",
__func__);
ret = -ENODEV; ret = -ENODEV;
goto end; goto end;
} }
if (phyinfo->id != phyid || if (phyinfo->id != phyid ||
phyinfo->phy_layer->id != phyid || phyinfo->phy_layer->id != phyid ||
phyinfo->frm_layer->id != phyid) { phyinfo->frm_layer->id != phyid) {
pr_err("CAIF: %s(): " pr_err("Inconsistency in phy registration\n");
"Inconsistency in phy registration\n",
__func__);
ret = -EINVAL; ret = -EINVAL;
goto end; goto end;
} }
...@@ -276,21 +274,20 @@ int cfcnfg_add_adaptation_layer(struct cfcnfg *cnfg, ...@@ -276,21 +274,20 @@ int cfcnfg_add_adaptation_layer(struct cfcnfg *cnfg,
{ {
struct cflayer *frml; struct cflayer *frml;
if (adap_layer == NULL) { if (adap_layer == NULL) {
pr_err("CAIF: %s(): adap_layer is zero", __func__); pr_err("adap_layer is zero\n");
return -EINVAL; return -EINVAL;
} }
if (adap_layer->receive == NULL) { if (adap_layer->receive == NULL) {
pr_err("CAIF: %s(): adap_layer->receive is NULL", __func__); pr_err("adap_layer->receive is NULL\n");
return -EINVAL; return -EINVAL;
} }
if (adap_layer->ctrlcmd == NULL) { if (adap_layer->ctrlcmd == NULL) {
pr_err("CAIF: %s(): adap_layer->ctrlcmd == NULL", __func__); pr_err("adap_layer->ctrlcmd == NULL\n");
return -EINVAL; return -EINVAL;
} }
frml = cnfg->phy_layers[param->phyid].frm_layer; frml = cnfg->phy_layers[param->phyid].frm_layer;
if (frml == NULL) { if (frml == NULL) {
pr_err("CAIF: %s(): Specified PHY type does not exist!", pr_err("Specified PHY type does not exist!\n");
__func__);
return -ENODEV; return -ENODEV;
} }
caif_assert(param->phyid == cnfg->phy_layers[param->phyid].id); caif_assert(param->phyid == cnfg->phy_layers[param->phyid].id);
...@@ -330,9 +327,7 @@ cfcnfg_linkup_rsp(struct cflayer *layer, u8 channel_id, enum cfctrl_srv serv, ...@@ -330,9 +327,7 @@ cfcnfg_linkup_rsp(struct cflayer *layer, u8 channel_id, enum cfctrl_srv serv,
struct net_device *netdev; struct net_device *netdev;
if (adapt_layer == NULL) { if (adapt_layer == NULL) {
pr_debug("CAIF: %s(): link setup response " pr_debug("link setup response but no client exist, send linkdown back\n");
"but no client exist, send linkdown back\n",
__func__);
cfctrl_linkdown_req(cnfg->ctrl, channel_id, NULL); cfctrl_linkdown_req(cnfg->ctrl, channel_id, NULL);
return; return;
} }
...@@ -374,13 +369,11 @@ cfcnfg_linkup_rsp(struct cflayer *layer, u8 channel_id, enum cfctrl_srv serv, ...@@ -374,13 +369,11 @@ cfcnfg_linkup_rsp(struct cflayer *layer, u8 channel_id, enum cfctrl_srv serv,
servicel = cfdbgl_create(channel_id, &phyinfo->dev_info); servicel = cfdbgl_create(channel_id, &phyinfo->dev_info);
break; break;
default: default:
pr_err("CAIF: %s(): Protocol error. " pr_err("Protocol error. Link setup response - unknown channel type\n");
"Link setup response - unknown channel type\n",
__func__);
return; return;
} }
if (!servicel) { if (!servicel) {
pr_warning("CAIF: %s(): Out of memory\n", __func__); pr_warn("Out of memory\n");
return; return;
} }
layer_set_dn(servicel, cnfg->mux); layer_set_dn(servicel, cnfg->mux);
...@@ -418,7 +411,7 @@ cfcnfg_add_phy_layer(struct cfcnfg *cnfg, enum cfcnfg_phy_type phy_type, ...@@ -418,7 +411,7 @@ cfcnfg_add_phy_layer(struct cfcnfg *cnfg, enum cfcnfg_phy_type phy_type,
} }
} }
if (*phyid == 0) { if (*phyid == 0) {
pr_err("CAIF: %s(): No Available PHY ID\n", __func__); pr_err("No Available PHY ID\n");
return; return;
} }
...@@ -427,7 +420,7 @@ cfcnfg_add_phy_layer(struct cfcnfg *cnfg, enum cfcnfg_phy_type phy_type, ...@@ -427,7 +420,7 @@ cfcnfg_add_phy_layer(struct cfcnfg *cnfg, enum cfcnfg_phy_type phy_type,
phy_driver = phy_driver =
cfserl_create(CFPHYTYPE_FRAG, *phyid, stx); cfserl_create(CFPHYTYPE_FRAG, *phyid, stx);
if (!phy_driver) { if (!phy_driver) {
pr_warning("CAIF: %s(): Out of memory\n", __func__); pr_warn("Out of memory\n");
return; return;
} }
...@@ -436,7 +429,7 @@ cfcnfg_add_phy_layer(struct cfcnfg *cnfg, enum cfcnfg_phy_type phy_type, ...@@ -436,7 +429,7 @@ cfcnfg_add_phy_layer(struct cfcnfg *cnfg, enum cfcnfg_phy_type phy_type,
phy_driver = NULL; phy_driver = NULL;
break; break;
default: default:
pr_err("CAIF: %s(): %d", __func__, phy_type); pr_err("%d\n", phy_type);
return; return;
break; break;
} }
...@@ -455,7 +448,7 @@ cfcnfg_add_phy_layer(struct cfcnfg *cnfg, enum cfcnfg_phy_type phy_type, ...@@ -455,7 +448,7 @@ cfcnfg_add_phy_layer(struct cfcnfg *cnfg, enum cfcnfg_phy_type phy_type,
phy_layer->type = phy_type; phy_layer->type = phy_type;
frml = cffrml_create(*phyid, fcs); frml = cffrml_create(*phyid, fcs);
if (!frml) { if (!frml) {
pr_warning("CAIF: %s(): Out of memory\n", __func__); pr_warn("Out of memory\n");
return; return;
} }
cnfg->phy_layers[*phyid].frm_layer = frml; cnfg->phy_layers[*phyid].frm_layer = frml;
......
...@@ -4,6 +4,8 @@ ...@@ -4,6 +4,8 @@
* License terms: GNU General Public License (GPL) version 2 * License terms: GNU General Public License (GPL) version 2
*/ */
#define pr_fmt(fmt) KBUILD_MODNAME ":%s(): " fmt, __func__
#include <linux/stddef.h> #include <linux/stddef.h>
#include <linux/spinlock.h> #include <linux/spinlock.h>
#include <linux/slab.h> #include <linux/slab.h>
...@@ -36,7 +38,7 @@ struct cflayer *cfctrl_create(void) ...@@ -36,7 +38,7 @@ struct cflayer *cfctrl_create(void)
struct cfctrl *this = struct cfctrl *this =
kmalloc(sizeof(struct cfctrl), GFP_ATOMIC); kmalloc(sizeof(struct cfctrl), GFP_ATOMIC);
if (!this) { if (!this) {
pr_warning("CAIF: %s(): Out of memory\n", __func__); pr_warn("Out of memory\n");
return NULL; return NULL;
} }
caif_assert(offsetof(struct cfctrl, serv.layer) == 0); caif_assert(offsetof(struct cfctrl, serv.layer) == 0);
...@@ -132,9 +134,7 @@ struct cfctrl_request_info *cfctrl_remove_req(struct cfctrl *ctrl, ...@@ -132,9 +134,7 @@ struct cfctrl_request_info *cfctrl_remove_req(struct cfctrl *ctrl,
list_for_each_entry_safe(p, tmp, &ctrl->list, list) { list_for_each_entry_safe(p, tmp, &ctrl->list, list) {
if (cfctrl_req_eq(req, p)) { if (cfctrl_req_eq(req, p)) {
if (p != first) if (p != first)
pr_warning("CAIF: %s(): Requests are not " pr_warn("Requests are not received in order\n");
"received in order\n",
__func__);
atomic_set(&ctrl->rsp_seq_no, atomic_set(&ctrl->rsp_seq_no,
p->sequence_no); p->sequence_no);
...@@ -177,7 +177,7 @@ void cfctrl_enum_req(struct cflayer *layer, u8 physlinkid) ...@@ -177,7 +177,7 @@ void cfctrl_enum_req(struct cflayer *layer, u8 physlinkid)
int ret; int ret;
struct cfpkt *pkt = cfpkt_create(CFPKT_CTRL_PKT_LEN); struct cfpkt *pkt = cfpkt_create(CFPKT_CTRL_PKT_LEN);
if (!pkt) { if (!pkt) {
pr_warning("CAIF: %s(): Out of memory\n", __func__); pr_warn("Out of memory\n");
return; return;
} }
caif_assert(offsetof(struct cfctrl, serv.layer) == 0); caif_assert(offsetof(struct cfctrl, serv.layer) == 0);
...@@ -189,8 +189,7 @@ void cfctrl_enum_req(struct cflayer *layer, u8 physlinkid) ...@@ -189,8 +189,7 @@ void cfctrl_enum_req(struct cflayer *layer, u8 physlinkid)
ret = ret =
cfctrl->serv.layer.dn->transmit(cfctrl->serv.layer.dn, pkt); cfctrl->serv.layer.dn->transmit(cfctrl->serv.layer.dn, pkt);
if (ret < 0) { if (ret < 0) {
pr_err("CAIF: %s(): Could not transmit enum message\n", pr_err("Could not transmit enum message\n");
__func__);
cfpkt_destroy(pkt); cfpkt_destroy(pkt);
} }
} }
...@@ -208,7 +207,7 @@ int cfctrl_linkup_request(struct cflayer *layer, ...@@ -208,7 +207,7 @@ int cfctrl_linkup_request(struct cflayer *layer,
char utility_name[16]; char utility_name[16];
struct cfpkt *pkt = cfpkt_create(CFPKT_CTRL_PKT_LEN); struct cfpkt *pkt = cfpkt_create(CFPKT_CTRL_PKT_LEN);
if (!pkt) { if (!pkt) {
pr_warning("CAIF: %s(): Out of memory\n", __func__); pr_warn("Out of memory\n");
return -ENOMEM; return -ENOMEM;
} }
cfpkt_addbdy(pkt, CFCTRL_CMD_LINK_SETUP); cfpkt_addbdy(pkt, CFCTRL_CMD_LINK_SETUP);
...@@ -253,13 +252,13 @@ int cfctrl_linkup_request(struct cflayer *layer, ...@@ -253,13 +252,13 @@ int cfctrl_linkup_request(struct cflayer *layer,
param->u.utility.paramlen); param->u.utility.paramlen);
break; break;
default: default:
pr_warning("CAIF: %s():Request setup of bad link type = %d\n", pr_warn("Request setup of bad link type = %d\n",
__func__, param->linktype); param->linktype);
return -EINVAL; return -EINVAL;
} }
req = kzalloc(sizeof(*req), GFP_KERNEL); req = kzalloc(sizeof(*req), GFP_KERNEL);
if (!req) { if (!req) {
pr_warning("CAIF: %s(): Out of memory\n", __func__); pr_warn("Out of memory\n");
return -ENOMEM; return -ENOMEM;
} }
req->client_layer = user_layer; req->client_layer = user_layer;
...@@ -276,8 +275,7 @@ int cfctrl_linkup_request(struct cflayer *layer, ...@@ -276,8 +275,7 @@ int cfctrl_linkup_request(struct cflayer *layer,
ret = ret =
cfctrl->serv.layer.dn->transmit(cfctrl->serv.layer.dn, pkt); cfctrl->serv.layer.dn->transmit(cfctrl->serv.layer.dn, pkt);
if (ret < 0) { if (ret < 0) {
pr_err("CAIF: %s(): Could not transmit linksetup request\n", pr_err("Could not transmit linksetup request\n");
__func__);
cfpkt_destroy(pkt); cfpkt_destroy(pkt);
return -ENODEV; return -ENODEV;
} }
...@@ -291,7 +289,7 @@ int cfctrl_linkdown_req(struct cflayer *layer, u8 channelid, ...@@ -291,7 +289,7 @@ int cfctrl_linkdown_req(struct cflayer *layer, u8 channelid,
struct cfctrl *cfctrl = container_obj(layer); struct cfctrl *cfctrl = container_obj(layer);
struct cfpkt *pkt = cfpkt_create(CFPKT_CTRL_PKT_LEN); struct cfpkt *pkt = cfpkt_create(CFPKT_CTRL_PKT_LEN);
if (!pkt) { if (!pkt) {
pr_warning("CAIF: %s(): Out of memory\n", __func__); pr_warn("Out of memory\n");
return -ENOMEM; return -ENOMEM;
} }
cfpkt_addbdy(pkt, CFCTRL_CMD_LINK_DESTROY); cfpkt_addbdy(pkt, CFCTRL_CMD_LINK_DESTROY);
...@@ -300,8 +298,7 @@ int cfctrl_linkdown_req(struct cflayer *layer, u8 channelid, ...@@ -300,8 +298,7 @@ int cfctrl_linkdown_req(struct cflayer *layer, u8 channelid,
ret = ret =
cfctrl->serv.layer.dn->transmit(cfctrl->serv.layer.dn, pkt); cfctrl->serv.layer.dn->transmit(cfctrl->serv.layer.dn, pkt);
if (ret < 0) { if (ret < 0) {
pr_err("CAIF: %s(): Could not transmit link-down request\n", pr_err("Could not transmit link-down request\n");
__func__);
cfpkt_destroy(pkt); cfpkt_destroy(pkt);
} }
return ret; return ret;
...@@ -313,7 +310,7 @@ void cfctrl_sleep_req(struct cflayer *layer) ...@@ -313,7 +310,7 @@ void cfctrl_sleep_req(struct cflayer *layer)
struct cfctrl *cfctrl = container_obj(layer); struct cfctrl *cfctrl = container_obj(layer);
struct cfpkt *pkt = cfpkt_create(CFPKT_CTRL_PKT_LEN); struct cfpkt *pkt = cfpkt_create(CFPKT_CTRL_PKT_LEN);
if (!pkt) { if (!pkt) {
pr_warning("CAIF: %s(): Out of memory\n", __func__); pr_warn("Out of memory\n");
return; return;
} }
cfpkt_addbdy(pkt, CFCTRL_CMD_SLEEP); cfpkt_addbdy(pkt, CFCTRL_CMD_SLEEP);
...@@ -330,7 +327,7 @@ void cfctrl_wake_req(struct cflayer *layer) ...@@ -330,7 +327,7 @@ void cfctrl_wake_req(struct cflayer *layer)
struct cfctrl *cfctrl = container_obj(layer); struct cfctrl *cfctrl = container_obj(layer);
struct cfpkt *pkt = cfpkt_create(CFPKT_CTRL_PKT_LEN); struct cfpkt *pkt = cfpkt_create(CFPKT_CTRL_PKT_LEN);
if (!pkt) { if (!pkt) {
pr_warning("CAIF: %s(): Out of memory\n", __func__); pr_warn("Out of memory\n");
return; return;
} }
cfpkt_addbdy(pkt, CFCTRL_CMD_WAKE); cfpkt_addbdy(pkt, CFCTRL_CMD_WAKE);
...@@ -347,7 +344,7 @@ void cfctrl_getstartreason_req(struct cflayer *layer) ...@@ -347,7 +344,7 @@ void cfctrl_getstartreason_req(struct cflayer *layer)
struct cfctrl *cfctrl = container_obj(layer); struct cfctrl *cfctrl = container_obj(layer);
struct cfpkt *pkt = cfpkt_create(CFPKT_CTRL_PKT_LEN); struct cfpkt *pkt = cfpkt_create(CFPKT_CTRL_PKT_LEN);
if (!pkt) { if (!pkt) {
pr_warning("CAIF: %s(): Out of memory\n", __func__); pr_warn("Out of memory\n");
return; return;
} }
cfpkt_addbdy(pkt, CFCTRL_CMD_START_REASON); cfpkt_addbdy(pkt, CFCTRL_CMD_START_REASON);
...@@ -364,12 +361,11 @@ void cfctrl_cancel_req(struct cflayer *layr, struct cflayer *adap_layer) ...@@ -364,12 +361,11 @@ void cfctrl_cancel_req(struct cflayer *layr, struct cflayer *adap_layer)
struct cfctrl_request_info *p, *tmp; struct cfctrl_request_info *p, *tmp;
struct cfctrl *ctrl = container_obj(layr); struct cfctrl *ctrl = container_obj(layr);
spin_lock(&ctrl->info_list_lock); spin_lock(&ctrl->info_list_lock);
pr_warning("CAIF: %s(): enter\n", __func__); pr_warn("enter\n");
list_for_each_entry_safe(p, tmp, &ctrl->list, list) { list_for_each_entry_safe(p, tmp, &ctrl->list, list) {
if (p->client_layer == adap_layer) { if (p->client_layer == adap_layer) {
pr_warning("CAIF: %s(): cancel req :%d\n", __func__, pr_warn("cancel req :%d\n", p->sequence_no);
p->sequence_no);
list_del(&p->list); list_del(&p->list);
kfree(p); kfree(p);
} }
...@@ -520,9 +516,8 @@ static int cfctrl_recv(struct cflayer *layer, struct cfpkt *pkt) ...@@ -520,9 +516,8 @@ static int cfctrl_recv(struct cflayer *layer, struct cfpkt *pkt)
cfpkt_extr_head(pkt, &param, len); cfpkt_extr_head(pkt, &param, len);
break; break;