bus: hisi_lpc: Use devm_platform_ioremap_resource
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Mon, 5 Sep 2022 08:23:03 +0000 (16:23 +0800)
committerWei Xu <xuwei5@hisilicon.com>
Thu, 8 Sep 2022 02:27:29 +0000 (02:27 +0000)
The struct resource is not used for anything else, so we can simplify
the code a bit by using the helper function.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: John Garry <john.garry@huawei.com>
Signed-off-by: Wei Xu <xuwei5@hisilicon.com>
drivers/bus/hisi_lpc.c

index 6d432a07cbba8484ec1e93260bff3b403d36b1dd..03d4d96ff7947d4db0f31b245f43057cd3ddc42d 100644 (file)
@@ -618,7 +618,6 @@ static int hisi_lpc_probe(struct platform_device *pdev)
        struct logic_pio_hwaddr *range;
        struct hisi_lpc_dev *lpcdev;
        resource_size_t io_end;
-       struct resource *res;
        int ret;
 
        lpcdev = devm_kzalloc(dev, sizeof(*lpcdev), GFP_KERNEL);
@@ -627,8 +626,7 @@ static int hisi_lpc_probe(struct platform_device *pdev)
 
        spin_lock_init(&lpcdev->cycle_lock);
 
-       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       lpcdev->membase = devm_ioremap_resource(dev, res);
+       lpcdev->membase = devm_platform_ioremap_resource(pdev, 0);
        if (IS_ERR(lpcdev->membase))
                return PTR_ERR(lpcdev->membase);