diff mbox series

[next] ath11k: convert to devm_platform_get_and_ioremap_resource

Message ID 20200508075323.81128-1-weiyongjun1@huawei.com (mailing list archive)
State Accepted
Commit c8ffcd122760612c1fac45c44d008a3fe8b2cbb4
Delegated to: Kalle Valo
Headers show
Series [next] ath11k: convert to devm_platform_get_and_ioremap_resource | expand

Commit Message

Wei Yongjun May 8, 2020, 7:53 a.m. UTC
Use the helper function that wraps the calls to platform_get_resource()
and devm_ioremap_resource() together.

Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
 drivers/net/wireless/ath/ath11k/ahb.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

Comments

Kalle Valo May 12, 2020, 7:34 a.m. UTC | #1
Wei Yongjun <weiyongjun1@huawei.com> wrote:

> Use the helper function that wraps the calls to platform_get_resource()
> and devm_ioremap_resource() together.
> 
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>

Patch applied to ath-next branch of ath.git, thanks.

c8ffcd122760 ath11k: convert to devm_platform_get_and_ioremap_resource
diff mbox series

Patch

diff --git a/drivers/net/wireless/ath/ath11k/ahb.c b/drivers/net/wireless/ath/ath11k/ahb.c
index 3b2b76d602f2..d4ad99eb0e16 100644
--- a/drivers/net/wireless/ath/ath11k/ahb.c
+++ b/drivers/net/wireless/ath/ath11k/ahb.c
@@ -891,13 +891,7 @@  static int ath11k_ahb_probe(struct platform_device *pdev)
 		return -EINVAL;
 	}
 
-	mem_res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	if (!mem_res) {
-		dev_err(&pdev->dev, "failed to get IO memory resource\n");
-		return -ENXIO;
-	}
-
-	mem = devm_ioremap_resource(&pdev->dev, mem_res);
+	mem = devm_platform_get_and_ioremap_resource(pdev, 0, &mem_res);
 	if (IS_ERR(mem)) {
 		dev_err(&pdev->dev, "ioremap error\n");
 		return PTR_ERR(mem);