staging: vc04_services: make use of devm_platform_ioremap_resource
authorHariprasad Kelam <hariprasad.kelam@gmail.com>
Sun, 6 Oct 2019 09:16:21 +0000 (14:46 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 7 Oct 2019 10:32:42 +0000 (12:32 +0200)
fix below issue reported by coccicheck
drivers/staging//vc04_services/interface/vchiq_arm/vchiq_2835_arm.c:139
WARNING: Use devm_platform_ioremap_resource for g_regs

Signed-off-by: Hariprasad Kelam <hariprasad.kelam@gmail.com>
Link: https://lore.kernel.org/r/1570353394-9991-1-git-send-email-hariprasad.kelam@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c

index 8dc730cfe7a633ead8653ede308767b64c9144d2..6559f0e50db1e6e149d61502ecfc2e5d5848275e 100644 (file)
@@ -81,7 +81,6 @@ int vchiq_platform_init(struct platform_device *pdev, struct vchiq_state *state)
        struct vchiq_drvdata *drvdata = platform_get_drvdata(pdev);
        struct rpi_firmware *fw = drvdata->fw;
        struct vchiq_slot_zero *vchiq_slot_zero;
-       struct resource *res;
        void *slot_mem;
        dma_addr_t slot_phys;
        u32 channelbase;
@@ -135,8 +134,7 @@ int vchiq_platform_init(struct platform_device *pdev, struct vchiq_state *state)
        if (vchiq_init_state(state, vchiq_slot_zero) != VCHIQ_SUCCESS)
                return -EINVAL;
 
-       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       g_regs = devm_ioremap_resource(&pdev->dev, res);
+       g_regs = devm_platform_ioremap_resource(pdev, 0);
        if (IS_ERR(g_regs))
                return PTR_ERR(g_regs);