mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-16 07:51:31 -04:00
mmc: cavium-octeon: Simplify with scoped for each OF child loop
Use scoped for-each loop when iterating over device nodes to make code a bit simpler. Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
This commit is contained in:
committed by
Ulf Hansson
parent
e8c23b466b
commit
4e709d5d62
@@ -148,7 +148,7 @@ static void octeon_mmc_dmar_fixup_done(struct cvm_mmc_host *host)
|
||||
|
||||
static int octeon_mmc_probe(struct platform_device *pdev)
|
||||
{
|
||||
struct device_node *cn, *node = pdev->dev.of_node;
|
||||
struct device_node *node = pdev->dev.of_node;
|
||||
struct cvm_mmc_host *host;
|
||||
void __iomem *base;
|
||||
int mmc_irq[9];
|
||||
@@ -268,7 +268,7 @@ static int octeon_mmc_probe(struct platform_device *pdev)
|
||||
platform_set_drvdata(pdev, host);
|
||||
|
||||
i = 0;
|
||||
for_each_child_of_node(node, cn) {
|
||||
for_each_child_of_node_scoped(node, cn) {
|
||||
host->slot_pdev[i] =
|
||||
of_platform_device_create(cn, NULL, &pdev->dev);
|
||||
if (!host->slot_pdev[i]) {
|
||||
@@ -279,7 +279,6 @@ static int octeon_mmc_probe(struct platform_device *pdev)
|
||||
if (ret) {
|
||||
dev_err(&pdev->dev, "Error populating slots\n");
|
||||
octeon_mmc_set_shared_power(host, 0);
|
||||
of_node_put(cn);
|
||||
goto error;
|
||||
}
|
||||
i++;
|
||||
|
||||
Reference in New Issue
Block a user