OSDN Git Service

mtd: core: simplify (a bit) code find partition-matching dynamic OF node
authorRafał Miłecki <rafal@milecki.pl>
Tue, 4 Oct 2022 08:37:09 +0000 (10:37 +0200)
committerMiquel Raynal <miquel.raynal@bootlin.com>
Mon, 7 Nov 2022 16:06:30 +0000 (17:06 +0100)
commitc5f5d0cd40e3bc2d6d397af788a7c0241b1c6b68
treecfbe441cd3fbe332e5b88cd9e9d5c1985917a4f4
parent30a0b95b1335e12efef89dd78518ed3e4a71a763
mtd: core: simplify (a bit) code find partition-matching dynamic OF node

1. Don't hardcode "partition-" string twice
2. Use simpler logic & use ->name to avoid of_property_read_string()
3. Use mtd_get_of_node() helper

Cc: Christian Marangi <ansuelsmth@gmail.com>
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20221004083710.27704-1-zajec5@gmail.com
drivers/mtd/mtdcore.c