]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commitdiff
crypto/nx: Add nx842_add_coprocs_list function
authorHaren Myneni <haren@linux.vnet.ibm.com>
Thu, 28 Sep 2017 10:57:57 +0000 (07:57 -0300)
committerSeth Forshee <seth.forshee@canonical.com>
Thu, 28 Sep 2017 19:40:18 +0000 (15:40 -0400)
BugLink: http://bugs.launchpad.net/bugs/1718292
Updating coprocessor list is moved to nx842_add_coprocs_list().
This function will be used for both icswx and VAS functions.

Signed-off-by: Haren Myneni <haren@us.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
(cherry picked from commit cd38a8a8a2ab95e43a031410db6a32f2d84e3fc0)
Signed-off-by: Gustavo Walbon <gwalbon@linux.vnet.ibm.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
drivers/crypto/nx/nx-842-powernv.c

index 67dc06f9b557339123775527b0194d51b43b3dda..829b5cad0043cdb7784143c37c94ec1b9594bf28 100644 (file)
@@ -550,6 +550,14 @@ static int nx842_powernv_decompress(const unsigned char *in, unsigned int inlen,
                                      wmem, CCW_FC_842_DECOMP_CRC);
 }
 
+static inline void nx842_add_coprocs_list(struct nx842_coproc *coproc,
+                                       int chipid)
+{
+       coproc->chip_id = chipid;
+       INIT_LIST_HEAD(&coproc->list);
+       list_add(&coproc->list, &nx842_coprocs);
+}
+
 static int __init nx842_powernv_probe(struct device_node *dn)
 {
        struct nx842_coproc *coproc;
@@ -576,11 +584,9 @@ static int __init nx842_powernv_probe(struct device_node *dn)
        if (!coproc)
                return -ENOMEM;
 
-       coproc->chip_id = chip_id;
        coproc->ct = ct;
        coproc->ci = ci;
-       INIT_LIST_HEAD(&coproc->list);
-       list_add(&coproc->list, &nx842_coprocs);
+       nx842_add_coprocs_list(coproc, chip_id);
 
        pr_info("coprocessor found on chip %d, CT %d CI %d\n", chip_id, ct, ci);