Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mtd: spear_smi: use for_each_child_of_node() macro

Use for_each_child_of_node() macro instead of open coding it.

Signed-off-by: Qinglang Miao <miaoqinglang@huawei.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20200914061324.3230-1-miaoqinglang@huawei.com

authored by

Qinglang Miao and committed by
Miquel Raynal
670c898c 1840ff8d

+2 -2
+2 -2
drivers/mtd/devices/spear_smi.c
··· 793 793 struct device_node *np) 794 794 { 795 795 struct spear_smi_plat_data *pdata = dev_get_platdata(&pdev->dev); 796 - struct device_node *pp = NULL; 796 + struct device_node *pp; 797 797 const __be32 *addr; 798 798 u32 val; 799 799 int len; ··· 812 812 return -ENOMEM; 813 813 814 814 /* Fill structs for each subnode (flash device) */ 815 - while ((pp = of_get_next_child(np, pp))) { 815 + for_each_child_of_node(np, pp) { 816 816 pdata->np[i] = pp; 817 817 818 818 /* Read base-addr and size from DT */