1
0
Fork 0

ARM: OMAP2+: return -ENODEV if GPMC child device creation fails

gpmc_probe_nor_child() calls of_platform_device_create() to create a
platform device for the NOR child. If this function fails the value
of ret is returned to the caller but this value is zero since it was
assigned the return of a previous call to gpmc_cs_program_settings()
that had to succeed or otherwise gpmc_probe_nor_child() would have
returned before.

This means that if of_platform_device_create() fails, 0 will be returned
to the caller instead of an appropriate error code.

Signed-off-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk>
Signed-off-by: Jon Hunter <jon-hunter@ti.com>
Tested-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
hifive-unleashed-5.1
Javier Martinez Canillas 2013-03-14 16:09:20 +01:00 committed by Jon Hunter
parent 84b00f0e28
commit e8ffd6fdf2
1 changed files with 1 additions and 0 deletions

View File

@ -1495,6 +1495,7 @@ static int gpmc_probe_nor_child(struct platform_device *pdev,
return 0;
dev_err(&pdev->dev, "failed to create gpmc child %s\n", child->name);
ret = -ENODEV;
err:
gpmc_cs_free(cs);