mirror of
https://github.com/fail0verflow/switch-linux.git
synced 2025-05-04 02:34:21 -04:00
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>
This commit is contained in:
parent
1bd49882d7
commit
7807e086a2
3 changed files with 10 additions and 9 deletions
|
@ -367,7 +367,7 @@ static int gpmc_onenand_setup(void __iomem *onenand_base, int *freq_ptr)
|
||||||
return ret;
|
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;
|
int err;
|
||||||
struct device *dev = &gpmc_onenand_device.dev;
|
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) {
|
if (err < 0) {
|
||||||
dev_err(dev, "Cannot request GPMC CS %d, error %d\n",
|
dev_err(dev, "Cannot request GPMC CS %d, error %d\n",
|
||||||
gpmc_onenand_data->cs, err);
|
gpmc_onenand_data->cs, err);
|
||||||
return;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
gpmc_onenand_resource.end = gpmc_onenand_resource.start +
|
gpmc_onenand_resource.end = gpmc_onenand_resource.start +
|
||||||
ONENAND_IO_SIZE - 1;
|
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");
|
dev_err(dev, "Unable to register OneNAND device\n");
|
||||||
gpmc_cs_free(gpmc_onenand_data->cs);
|
gpmc_cs_free(gpmc_onenand_data->cs);
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return err;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1947,9 +1947,7 @@ static int gpmc_probe_onenand_child(struct platform_device *pdev,
|
||||||
if (!of_property_read_u32(child, "dma-channel", &val))
|
if (!of_property_read_u32(child, "dma-channel", &val))
|
||||||
gpmc_onenand_data->dma_channel = val;
|
gpmc_onenand_data->dma_channel = val;
|
||||||
|
|
||||||
gpmc_onenand_init(gpmc_onenand_data);
|
return gpmc_onenand_init(gpmc_onenand_data);
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
static int gpmc_probe_onenand_child(struct platform_device *pdev,
|
static int gpmc_probe_onenand_child(struct platform_device *pdev,
|
||||||
|
|
|
@ -88,10 +88,11 @@ static inline int gpmc_nand_init(struct omap_nand_platform_data *d,
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if IS_ENABLED(CONFIG_MTD_ONENAND_OMAP2)
|
#if IS_ENABLED(CONFIG_MTD_ONENAND_OMAP2)
|
||||||
extern void gpmc_onenand_init(struct omap_onenand_platform_data *d);
|
extern int gpmc_onenand_init(struct omap_onenand_platform_data *d);
|
||||||
#else
|
#else
|
||||||
#define board_onenand_data NULL
|
#define board_onenand_data NULL
|
||||||
static inline void gpmc_onenand_init(struct omap_onenand_platform_data *d)
|
static inline int gpmc_onenand_init(struct omap_onenand_platform_data *d)
|
||||||
{
|
{
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Reference in a new issue