Skip to content

Commit dd89d82

Browse files
Dan CarpenterEduardo Valentin
authored andcommitted
thermal: thermal_mmio: remove some dead code
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 <[email protected]> Acked-by: Talel Shenhar <[email protected]> Signed-off-by: Eduardo Valentin <[email protected]>
1 parent 56037ca commit dd89d82

File tree

1 file changed

+0
-7
lines changed

1 file changed

+0
-7
lines changed

drivers/thermal/thermal_mmio.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,6 @@ static int thermal_mmio_probe(struct platform_device *pdev)
5353
return -ENOMEM;
5454

5555
resource = platform_get_resource(pdev, IORESOURCE_MEM, 0);
56-
if (IS_ERR(resource)) {
57-
dev_err(&pdev->dev,
58-
"fail to get platform memory resource (%ld)\n",
59-
PTR_ERR(resource));
60-
return PTR_ERR(resource);
61-
}
62-
6356
sensor->mmio_base = devm_ioremap_resource(&pdev->dev, resource);
6457
if (IS_ERR(sensor->mmio_base)) {
6558
dev_err(&pdev->dev, "failed to ioremap memory (%ld)\n",

0 commit comments

Comments
 (0)