summaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorLadislav Michl <ladis@linux-mips.org>2017-02-11 14:02:49 +0100
committerTony Lindgren <tony@atomide.com>2017-02-28 09:06:23 -0800
commit7807e086a2d1f69cc1a57958cac04fea79fc2112 (patch)
tree69f75d7fa71ddd432418d027f96b3ede87565aa2 /arch
parent1bd49882d78a9b976fe7380ec1bdeb454d68a358 (diff)
downloadlinux-7807e086a2d1f69cc1a57958cac04fea79fc2112.tar.gz
linux-7807e086a2d1f69cc1a57958cac04fea79fc2112.tar.bz2
linux-7807e086a2d1f69cc1a57958cac04fea79fc2112.zip
ARM: OMAP2+: gpmc-onenand: propagate error on initialization failure
gpmc_probe_onenand_child returns success even on gpmc_onenand_init failure. Fix that. Signed-off-by: Ladislav Michl <ladis@linux-mips.org> Acked-by: Roger Quadros <rogerq@ti.com> Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mach-omap2/gpmc-onenand.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/arch/arm/mach-omap2/gpmc-onenand.c b/arch/arm/mach-omap2/gpmc-onenand.c
index 8633c703546a..2944af820558 100644
--- a/arch/arm/mach-omap2/gpmc-onenand.c
+++ b/arch/arm/mach-omap2/gpmc-onenand.c
@@ -367,7 +367,7 @@ static int gpmc_onenand_setup(void __iomem *onenand_base, int *freq_ptr)
return ret;
}
-void gpmc_onenand_init(struct omap_onenand_platform_data *_onenand_data)
+int gpmc_onenand_init(struct omap_onenand_platform_data *_onenand_data)
{
int err;
struct device *dev = &gpmc_onenand_device.dev;
@@ -393,15 +393,17 @@ void gpmc_onenand_init(struct omap_onenand_platform_data *_onenand_data)
if (err < 0) {
dev_err(dev, "Cannot request GPMC CS %d, error %d\n",
gpmc_onenand_data->cs, err);
- return;
+ return err;
}
gpmc_onenand_resource.end = gpmc_onenand_resource.start +
ONENAND_IO_SIZE - 1;
- if (platform_device_register(&gpmc_onenand_device) < 0) {
+ err = platform_device_register(&gpmc_onenand_device);
+ if (err) {
dev_err(dev, "Unable to register OneNAND device\n");
gpmc_cs_free(gpmc_onenand_data->cs);
- return;
}
+
+ return err;
}