Skip to content

Commit 670c898

Browse files
Qinglang Miaomiquelraynal
authored andcommitted
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
1 parent 1840ff8 commit 670c898

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

drivers/mtd/devices/spear_smi.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -793,7 +793,7 @@ static int spear_smi_probe_config_dt(struct platform_device *pdev,
793793
struct device_node *np)
794794
{
795795
struct spear_smi_plat_data *pdata = dev_get_platdata(&pdev->dev);
796-
struct device_node *pp = NULL;
796+
struct device_node *pp;
797797
const __be32 *addr;
798798
u32 val;
799799
int len;
@@ -812,7 +812,7 @@ static int spear_smi_probe_config_dt(struct platform_device *pdev,
812812
return -ENOMEM;
813813

814814
/* Fill structs for each subnode (flash device) */
815-
while ((pp = of_get_next_child(np, pp))) {
815+
for_each_child_of_node(np, pp) {
816816
pdata->np[i] = pp;
817817

818818
/* Read base-addr and size from DT */

0 commit comments

Comments
 (0)