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
This commit is contained in:
parent
1840ff8d42
commit
670c898cee
|
@ -793,7 +793,7 @@ static int spear_smi_probe_config_dt(struct platform_device *pdev,
|
||||||
struct device_node *np)
|
struct device_node *np)
|
||||||
{
|
{
|
||||||
struct spear_smi_plat_data *pdata = dev_get_platdata(&pdev->dev);
|
struct spear_smi_plat_data *pdata = dev_get_platdata(&pdev->dev);
|
||||||
struct device_node *pp = NULL;
|
struct device_node *pp;
|
||||||
const __be32 *addr;
|
const __be32 *addr;
|
||||||
u32 val;
|
u32 val;
|
||||||
int len;
|
int len;
|
||||||
|
@ -812,7 +812,7 @@ static int spear_smi_probe_config_dt(struct platform_device *pdev,
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
/* Fill structs for each subnode (flash device) */
|
/* 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;
|
pdata->np[i] = pp;
|
||||||
|
|
||||||
/* Read base-addr and size from DT */
|
/* Read base-addr and size from DT */
|
||||||
|
|
Loading…
Reference in New Issue