From: Qinglang Miao Date: Mon, 14 Sep 2020 06:13:24 +0000 (+0800) Subject: mtd: spear_smi: use for_each_child_of_node() macro X-Git-Tag: v5.10-rc1~94^2~9 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=670c898cee31abb40bf31ca678a92aef3a8e685a;p=thirdparty%2Flinux.git 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 Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20200914061324.3230-1-miaoqinglang@huawei.com --- diff --git a/drivers/mtd/devices/spear_smi.c b/drivers/mtd/devices/spear_smi.c index 79dcca16481d1..2e00862389dd1 100644 --- a/drivers/mtd/devices/spear_smi.c +++ b/drivers/mtd/devices/spear_smi.c @@ -793,7 +793,7 @@ static int spear_smi_probe_config_dt(struct platform_device *pdev, struct device_node *np) { struct spear_smi_plat_data *pdata = dev_get_platdata(&pdev->dev); - struct device_node *pp = NULL; + struct device_node *pp; const __be32 *addr; u32 val; int len; @@ -812,7 +812,7 @@ static int spear_smi_probe_config_dt(struct platform_device *pdev, return -ENOMEM; /* Fill structs for each subnode (flash device) */ - while ((pp = of_get_next_child(np, pp))) { + for_each_child_of_node(np, pp) { pdata->np[i] = pp; /* Read base-addr and size from DT */