]> www.infradead.org Git - users/jedix/linux-maple.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)
commitc7f6dc60a319edac986486580b2fc31475ceba11
tree7d18e42d8f548b855b1f69c059e6616995437f3d
parent00142d6ffeb67b22e1f5259c9f3af540ed1d2b62
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