treewide: remove platform_get_resoruce

Easier to just use devm_platform_ioremap_resource.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/16701
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
This commit is contained in:
Rosen Penev
2024-09-26 16:36:35 -07:00
committed by Hauke Mehrtens
parent 7ad9988287
commit 19bd5436c7
10 changed files with 16 additions and 38 deletions

View File

@@ -1359,7 +1359,6 @@ static const struct nand_controller_ops ar934x_nfc_controller_ops = {
static int ar934x_nfc_probe(struct platform_device *pdev)
{
struct ar934x_nfc *nfc;
struct resource *res;
struct mtd_info *mtd;
struct nand_chip *nand;
int ret;
@@ -1367,19 +1366,13 @@ static int ar934x_nfc_probe(struct platform_device *pdev)
pdev->dev.dma_mask = &ar934x_nfc_dma_mask;
pdev->dev.coherent_dma_mask = DMA_BIT_MASK(32);
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!res) {
dev_err(&pdev->dev, "failed to get I/O memory\n");
return -EINVAL;
}
nfc = devm_kzalloc(&pdev->dev, sizeof(struct ar934x_nfc), GFP_KERNEL);
if (!nfc) {
dev_err(&pdev->dev, "failed to allocate driver data\n");
return -ENOMEM;
}
nfc->base = devm_ioremap_resource(&pdev->dev, res);
nfc->base = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(nfc->base)) {
dev_err(&pdev->dev, "failed to remap I/O memory\n");
return PTR_ERR(nfc->base);