thermal: thermal_mmio: remove some dead code
authorDan Carpenter <dan.carpenter@oracle.com>
Wed, 15 May 2019 09:34:21 +0000 (12:34 +0300)
committerEduardo Valentin <edubezval@gmail.com>
Sun, 22 Sep 2019 20:44:52 +0000 (13:44 -0700)
The platform_get_resource() function doesn't return error pointers, it
returns NULL.  The way this is normally done, is that we pass the NULL
resource to devm_ioremap_resource() and then check for errors from that.
See the comment in front of devm_ioremap_resource() for more details.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Talel Shenhar <talel@amazon.com>
Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
drivers/thermal/thermal_mmio.c

index de3cceea23bc6372b325086bcf46be9105cd9f74..40524fa135337ff7153147533ffa49ce8a10d21a 100644 (file)
@@ -53,13 +53,6 @@ static int thermal_mmio_probe(struct platform_device *pdev)
                return -ENOMEM;
 
        resource = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       if (IS_ERR(resource)) {
-               dev_err(&pdev->dev,
-                       "fail to get platform memory resource (%ld)\n",
-                       PTR_ERR(resource));
-               return PTR_ERR(resource);
-       }
-
        sensor->mmio_base = devm_ioremap_resource(&pdev->dev, resource);
        if (IS_ERR(sensor->mmio_base)) {
                dev_err(&pdev->dev, "failed to ioremap memory (%ld)\n",