lkml.org 
[lkml]   [2019]   [Sep]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH -next 02/15] thermal: bcm2835: use devm_platform_ioremap_resource() to simplify code
    Date
    Use devm_platform_ioremap_resource() to simplify the code a bit.
    This is detected by coccinelle.

    Reported-by: Hulk Robot <hulkci@huawei.com>
    Signed-off-by: YueHaibing <yuehaibing@huawei.com>
    ---
    drivers/thermal/broadcom/bcm2835_thermal.c | 4 +---
    1 file changed, 1 insertion(+), 3 deletions(-)

    diff --git a/drivers/thermal/broadcom/bcm2835_thermal.c b/drivers/thermal/broadcom/bcm2835_thermal.c
    index 3199977..01eec8e 100644
    --- a/drivers/thermal/broadcom/bcm2835_thermal.c
    +++ b/drivers/thermal/broadcom/bcm2835_thermal.c
    @@ -166,7 +166,6 @@ static int bcm2835_thermal_probe(struct platform_device *pdev)
    const struct of_device_id *match;
    struct thermal_zone_device *tz;
    struct bcm2835_thermal_data *data;
    - struct resource *res;
    int err = 0;
    u32 val;
    unsigned long rate;
    @@ -180,8 +179,7 @@ static int bcm2835_thermal_probe(struct platform_device *pdev)
    if (!match)
    return -EINVAL;

    - res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
    - data->regs = devm_ioremap_resource(&pdev->dev, res);
    + data->regs = devm_platform_ioremap_resource(pdev, 0);
    if (IS_ERR(data->regs)) {
    err = PTR_ERR(data->regs);
    dev_err(&pdev->dev, "Could not get registers: %d\n", err);
    --
    2.7.4

    \
     
     \ /
      Last update: 2019-09-04 15:06    [W:3.521 / U:0.436 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site