crypto: hisilicon/hpre - Add a switch in sriov_configure
authorMeng Yu <yumeng18@huawei.com>
Fri, 10 Jul 2020 07:40:44 +0000 (15:40 +0800)
committerHerbert Xu <herbert@gondor.apana.org.au>
Thu, 16 Jul 2020 11:49:11 +0000 (21:49 +1000)
If CONFIG_PCI_IOV is not enabled, we can not use "sriov_configure".

Fixes: 5ec302a364bf("crypto: hisilicon - add SRIOV support for HPRE")
Signed-off-by: Meng Yu <yumeng18@huawei.com>
Reviewed-by: Zaibo Xu <xuzaibo@huawei.com>
Reviewed-by: Shukun Tan <tanshukun1@huawei.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/hisilicon/hpre/hpre_main.c

index da17729ef8ba5ed2c2824d115a62c7712c6012b8..37c2bc5d7c96f9142e81711f180d5ca7eae77760 100644 (file)
@@ -925,7 +925,8 @@ static struct pci_driver hpre_pci_driver = {
        .id_table               = hpre_dev_ids,
        .probe                  = hpre_probe,
        .remove                 = hpre_remove,
-       .sriov_configure        = hisi_qm_sriov_configure,
+       .sriov_configure        = IS_ENABLED(CONFIG_PCI_IOV) ?
+                                 hisi_qm_sriov_configure : NULL,
        .err_handler            = &hpre_err_handler,
 };