Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial
[firefly-linux-kernel-4.4.55.git] / drivers / target / tcm_fc / tfc_conf.c
index d963d9014973b2570b9a7d7be3b32642cc2b5d26..8781d1e423df31629d2d5eaa19e2db0e409059d8 100644 (file)
@@ -105,7 +105,7 @@ static ssize_t ft_parse_wwn(const char *name, u64 *wwn, int strict)
        }
        err = 4;
 fail:
-       FT_CONF_DBG("err %u len %zu pos %u byte %u\n",
+       pr_debug("err %u len %zu pos %u byte %u\n",
                    err, cp - name, pos, byte);
        return -1;
 }
@@ -215,14 +215,14 @@ static struct se_node_acl *ft_add_acl(
        u64 wwpn;
        u32 q_depth;
 
-       FT_CONF_DBG("add acl %s\n", name);
+       pr_debug("add acl %s\n", name);
        tpg = container_of(se_tpg, struct ft_tpg, se_tpg);
 
        if (ft_parse_wwn(name, &wwpn, 1) < 0)
                return ERR_PTR(-EINVAL);
 
        acl = kzalloc(sizeof(struct ft_node_acl), GFP_KERNEL);
-       if (!(acl))
+       if (!acl)
                return ERR_PTR(-ENOMEM);
        acl->node_auth.port_name = wwpn;
 
@@ -238,11 +238,11 @@ static void ft_del_acl(struct se_node_acl *se_acl)
        struct ft_node_acl *acl = container_of(se_acl,
                                struct ft_node_acl, se_node_acl);
 
-       FT_CONF_DBG("del acl %s\n",
+       pr_debug("del acl %s\n",
                config_item_name(&se_acl->acl_group.cg_item));
 
        tpg = container_of(se_tpg, struct ft_tpg, se_tpg);
-       FT_CONF_DBG("del acl %p se_acl %p tpg %p se_tpg %p\n",
+       pr_debug("del acl %p se_acl %p tpg %p se_tpg %p\n",
                    acl, se_acl, tpg, &tpg->se_tpg);
 
        core_tpg_del_initiator_node_acl(&tpg->se_tpg, se_acl, 1);
@@ -259,11 +259,11 @@ struct ft_node_acl *ft_acl_get(struct ft_tpg *tpg, struct fc_rport_priv *rdata)
        spin_lock_bh(&se_tpg->acl_node_lock);
        list_for_each_entry(se_acl, &se_tpg->acl_node_list, acl_list) {
                acl = container_of(se_acl, struct ft_node_acl, se_node_acl);
-               FT_CONF_DBG("acl %p port_name %llx\n",
+               pr_debug("acl %p port_name %llx\n",
                        acl, (unsigned long long)acl->node_auth.port_name);
                if (acl->node_auth.port_name == rdata->ids.port_name ||
                    acl->node_auth.node_name == rdata->ids.node_name) {
-                       FT_CONF_DBG("acl %p port_name %llx matched\n", acl,
+                       pr_debug("acl %p port_name %llx matched\n", acl,
                                    (unsigned long long)rdata->ids.port_name);
                        found = acl;
                        /* XXX need to hold onto ACL */
@@ -279,11 +279,11 @@ struct se_node_acl *ft_tpg_alloc_fabric_acl(struct se_portal_group *se_tpg)
        struct ft_node_acl *acl;
 
        acl = kzalloc(sizeof(*acl), GFP_KERNEL);
-       if (!(acl)) {
-               printk(KERN_ERR "Unable to allocate struct ft_node_acl\n");
+       if (!acl) {
+               pr_err("Unable to allocate struct ft_node_acl\n");
                return NULL;
        }
-       FT_CONF_DBG("acl %p\n", acl);
+       pr_debug("acl %p\n", acl);
        return &acl->se_node_acl;
 }
 
@@ -293,7 +293,7 @@ static void ft_tpg_release_fabric_acl(struct se_portal_group *se_tpg,
        struct ft_node_acl *acl = container_of(se_acl,
                                struct ft_node_acl, se_node_acl);
 
-       FT_CONF_DBG(KERN_INFO "acl %p\n", acl);
+       pr_debug("acl %p\n", acl);
        kfree(acl);
 }
 
@@ -310,7 +310,7 @@ static struct se_portal_group *ft_add_tpg(
        unsigned long index;
        int ret;
 
-       FT_CONF_DBG("tcm_fc: add tpg %s\n", name);
+       pr_debug("tcm_fc: add tpg %s\n", name);
 
        /*
         * Name must be "tpgt_" followed by the index.
@@ -330,7 +330,7 @@ static struct se_portal_group *ft_add_tpg(
        transport_init_queue_obj(&tpg->qobj);
 
        ret = core_tpg_register(&ft_configfs->tf_ops, wwn, &tpg->se_tpg,
-                               (void *)tpg, TRANSPORT_TPG_TYPE_NORMAL);
+                               tpg, TRANSPORT_TPG_TYPE_NORMAL);
        if (ret < 0) {
                kfree(tpg);
                return NULL;
@@ -353,7 +353,7 @@ static void ft_del_tpg(struct se_portal_group *se_tpg)
 {
        struct ft_tpg *tpg = container_of(se_tpg, struct ft_tpg, se_tpg);
 
-       FT_CONF_DBG("del tpg %s\n",
+       pr_debug("del tpg %s\n",
                    config_item_name(&tpg->se_tpg.tpg_group.cg_item));
 
        kthread_stop(tpg->thread);
@@ -411,7 +411,7 @@ static struct se_wwn *ft_add_lport(
        struct ft_lport_acl *old_lacl;
        u64 wwpn;
 
-       FT_CONF_DBG("add lport %s\n", name);
+       pr_debug("add lport %s\n", name);
        if (ft_parse_wwn(name, &wwpn, 1) < 0)
                return NULL;
        lacl = kzalloc(sizeof(*lacl), GFP_KERNEL);
@@ -440,7 +440,7 @@ static void ft_del_lport(struct se_wwn *wwn)
        struct ft_lport_acl *lacl = container_of(wwn,
                                struct ft_lport_acl, fc_lport_wwn);
 
-       FT_CONF_DBG("del lport %s\n",
+       pr_debug("del lport %s\n",
                        config_item_name(&wwn->wwn_group.cg_item));
        mutex_lock(&ft_lport_lock);
        list_del(&lacl->list);
@@ -535,8 +535,7 @@ static struct target_core_fabric_ops ft_fabric_ops = {
        .tpg_release_fabric_acl =       ft_tpg_release_fabric_acl,
        .tpg_get_inst_index =           ft_tpg_get_inst_index,
        .check_stop_free =              ft_check_stop_free,
-       .release_cmd_to_pool =          ft_release_cmd,
-       .release_cmd_direct =           ft_release_cmd,
+       .release_cmd =                  ft_release_cmd,
        .shutdown_session =             ft_sess_shutdown,
        .close_session =                ft_sess_close,
        .stop_session =                 ft_sess_stop,
@@ -549,7 +548,6 @@ static struct target_core_fabric_ops ft_fabric_ops = {
        .set_default_node_attributes =  ft_set_default_node_attr,
        .get_task_tag =                 ft_get_task_tag,
        .get_cmd_state =                ft_get_cmd_state,
-       .new_cmd_failure =              ft_new_cmd_failure,
        .queue_data_in =                ft_queue_data_in,
        .queue_status =                 ft_queue_status,
        .queue_tm_rsp =                 ft_queue_tm_resp,
@@ -581,10 +579,10 @@ int ft_register_configfs(void)
         * Register the top level struct config_item_type with TCM core
         */
        fabric = target_fabric_configfs_init(THIS_MODULE, "fc");
-       if (!fabric) {
-               printk(KERN_INFO "%s: target_fabric_configfs_init() failed!\n",
+       if (IS_ERR(fabric)) {
+               pr_err("%s: target_fabric_configfs_init() failed!\n",
                       __func__);
-               return -1;
+               return PTR_ERR(fabric);
        }
        fabric->tf_ops = ft_fabric_ops;
 
@@ -609,11 +607,8 @@ int ft_register_configfs(void)
         */
        ret = target_fabric_configfs_register(fabric);
        if (ret < 0) {
-               FT_CONF_DBG("target_fabric_configfs_register() for"
+               pr_debug("target_fabric_configfs_register() for"
                            " FC Target failed!\n");
-               printk(KERN_INFO
-                      "%s: target_fabric_configfs_register() failed!\n",
-                      __func__);
                target_fabric_configfs_free(fabric);
                return -1;
        }