RDMA/hns: Remove unnecessary platform_get_resource() error check
authorweiyongjun (A) <weiyongjun1@huawei.com>
Wed, 17 Jan 2018 11:28:38 +0000 (11:28 +0000)
committerDoug Ledford <dledford@redhat.com>
Thu, 18 Jan 2018 19:49:21 +0000 (14:49 -0500)
devm_ioremap_resource() already checks if the resource is NULL, so
remove the unnecessary platform_get_resource() error check.

Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Reviewed-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/infiniband/hw/hns/hns_roce_hw_v1.c

index 833a305085efe11948f74da626cd3f3628add7ba..21ca9fa7c9d13053420531adf647a835527f1add 100644 (file)
@@ -4788,10 +4788,6 @@ static int hns_roce_get_cfg(struct hns_roce_dev *hr_dev)
 
        /* get the mapped register base address */
        res = platform_get_resource(hr_dev->pdev, IORESOURCE_MEM, 0);
-       if (!res) {
-               dev_err(dev, "memory resource not found!\n");
-               return -EINVAL;
-       }
        hr_dev->reg_base = devm_ioremap_resource(dev, res);
        if (IS_ERR(hr_dev->reg_base))
                return PTR_ERR(hr_dev->reg_base);