lkml.org 
[lkml]   [2022]   [Apr]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH] soc: ixp4xx: qmgr: Make use of the helper function devm_platform_ioremap_resource()
    Date
    From: Lv Ruyi <lv.ruyi@zte.com.cn>

    Use the devm_platform_ioremap_resource() helper instead of calling
    platform_get_resource() and devm_ioremap_resource() separately.Make the
    code simpler without functional changes.

    Reported-by: Zeal Robot <zealci@zte.com.cn>
    Signed-off-by: Lv Ruyi <lv.ruyi@zte.com.cn>
    ---
    drivers/soc/ixp4xx/ixp4xx-qmgr.c | 6 +-----
    1 file changed, 1 insertion(+), 5 deletions(-)

    diff --git a/drivers/soc/ixp4xx/ixp4xx-qmgr.c b/drivers/soc/ixp4xx/ixp4xx-qmgr.c
    index 9154c7029b05..72b5a10e3104 100644
    --- a/drivers/soc/ixp4xx/ixp4xx-qmgr.c
    +++ b/drivers/soc/ixp4xx/ixp4xx-qmgr.c
    @@ -377,13 +377,9 @@ static int ixp4xx_qmgr_probe(struct platform_device *pdev)
    int i, err;
    irq_handler_t handler1, handler2;
    struct device *dev = &pdev->dev;
    - struct resource *res;
    int irq1, irq2;

    - res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
    - if (!res)
    - return -ENODEV;
    - qmgr_regs = devm_ioremap_resource(dev, res);
    + qmgr_regs = devm_platform_ioremap_resource(pdev, 0);
    if (IS_ERR(qmgr_regs))
    return PTR_ERR(qmgr_regs);

    --
    2.25.1

    \
     
     \ /
      Last update: 2022-04-21 10:47    [W:2.305 / U:1.780 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site