]> git.baikalelectronics.ru Git - kernel.git/commit
mtd: maps: physmap: Use platform_get_resource() to retrieve iomem resources
authorBoris Brezillon <boris.brezillon@bootlin.com>
Fri, 19 Oct 2018 07:48:56 +0000 (09:48 +0200)
committerBoris Brezillon <boris.brezillon@bootlin.com>
Mon, 5 Nov 2018 21:23:43 +0000 (22:23 +0100)
commit3024b720f490faf2f8fc12542270a5b19b16b6de
tree7d18e42d8f548b855b1f69c059e6616995437f3d
parent56fe8cbbebe9b55ccdead9feb677ae5a356f21c6
mtd: maps: physmap: Use platform_get_resource() to retrieve iomem resources

Stop manipulating the dev->resource array directly and use the
platform_get_resource() helper instead.

While at it, fix the loop check so that we never overflow the info->maps
and info->mtds array even if the number of resources attached to the
platform dev is higher than MAX_RESOURCES.

Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>
Reviewed-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
drivers/mtd/maps/physmap.c