Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

RDMA/hns: Modify hns_roce_hw_v2_get_cfg to simplify the code

Merge base configuration of hr_dev into hns_roce_hw_v2_get_cfg(). In
addition, there is no need to return 0 at last, so we change return type
of it to void.

Link: https://lore.kernel.org/r/1572952082-6681-8-git-send-email-liweihang@hisilicon.com
Signed-off-by: Lang Cheng <chenglang@huawei.com>
Signed-off-by: Weihang Li <liweihang@hisilicon.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>

authored by

Lang Cheng and committed by
Jason Gunthorpe
301cc7eb 880f133c

+4 -11
+4 -11
drivers/infiniband/hw/hns/hns_roce_hw_v2.c
··· 6370 6370 6371 6371 MODULE_DEVICE_TABLE(pci, hns_roce_hw_v2_pci_tbl); 6372 6372 6373 - static int hns_roce_hw_v2_get_cfg(struct hns_roce_dev *hr_dev, 6373 + static void hns_roce_hw_v2_get_cfg(struct hns_roce_dev *hr_dev, 6374 6374 struct hnae3_handle *handle) 6375 6375 { 6376 6376 struct hns_roce_v2_priv *priv = hr_dev->priv; 6377 6377 int i; 6378 6378 6379 + hr_dev->pci_dev = handle->pdev; 6380 + hr_dev->dev = &handle->pdev->dev; 6379 6381 hr_dev->hw = &hns_roce_hw_v2; 6380 6382 hr_dev->dfx = &hns_roce_dfx_hw_v2; 6381 6383 hr_dev->sdb_offset = ROCEE_DB_SQ_L_0_REG; ··· 6402 6400 6403 6401 hr_dev->reset_cnt = handle->ae_algo->ops->ae_dev_reset_cnt(handle); 6404 6402 priv->handle = handle; 6405 - 6406 - return 0; 6407 6403 } 6408 6404 6409 6405 static int __hns_roce_hw_v2_init_instance(struct hnae3_handle *handle) ··· 6419 6419 goto error_failed_kzalloc; 6420 6420 } 6421 6421 6422 - hr_dev->pci_dev = handle->pdev; 6423 - hr_dev->dev = &handle->pdev->dev; 6424 - 6425 - ret = hns_roce_hw_v2_get_cfg(hr_dev, handle); 6426 - if (ret) { 6427 - dev_err(hr_dev->dev, "Get Configuration failed!\n"); 6428 - goto error_failed_get_cfg; 6429 - } 6422 + hns_roce_hw_v2_get_cfg(hr_dev, handle); 6430 6423 6431 6424 ret = hns_roce_init(hr_dev); 6432 6425 if (ret) {