Skip to content

Commit

Permalink
ath10k: Use devm_platform_get_and_ioremap_resource()
Browse files Browse the repository at this point in the history
Use devm_platform_get_and_ioremap_resource() to simplify
code.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20210605110227.2429420-1-yangyingliang@huawei.com
  • Loading branch information
Yang Yingliang authored and Kalle Valo committed Jun 15, 2021
1 parent a8b1de7 commit ea1c202
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions drivers/net/wireless/ath/ath10k/ahb.c
Original file line number Diff line number Diff line change
Expand Up @@ -442,14 +442,7 @@ static int ath10k_ahb_resource_init(struct ath10k *ar)

pdev = ar_ahb->pdev;

res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!res) {
ath10k_err(ar, "failed to get memory resource\n");
ret = -ENXIO;
goto out;
}

ar_ahb->mem = devm_ioremap_resource(&pdev->dev, res);
ar_ahb->mem = devm_platform_get_and_ioremap_resource(pdev, 0, &res);
if (IS_ERR(ar_ahb->mem)) {
ath10k_err(ar, "mem ioremap error\n");
ret = PTR_ERR(ar_ahb->mem);
Expand Down

0 comments on commit ea1c202

Please sign in to comment.