linux/arch/arm/plat-omap
Russell King 71856843fb ARM: OMAP: use consistent error checking
Consistently check errors using the usual method used in the kernel
for much of its history.  For instance:

int gpmc_cs_set_timings(int cs, const struct gpmc_timings *t)
{
	int div;
	div = gpmc_calc_divider(t->sync_clk);
	if (div < 0)
		return div;
static int gpmc_set_async_mode(int cs, struct gpmc_timings *t)
{
...
	return gpmc_cs_set_timings(cs, t);

.....
	ret = gpmc_set_async_mode(gpmc_onenand_data->cs, &t);
	if (IS_ERR_VALUE(ret))
		return ret;

So, gpmc_cs_set_timings() thinks any negative return value is an error,
but where we check that in higher levels, only a limited range are
errors...

There is only _one_ use of IS_ERR_VALUE() in arch/arm which is really
appropriate, and that is in arch/arm/include/asm/syscall.h:

static inline long syscall_get_error(struct task_struct *task,
				     struct pt_regs *regs)
{
	unsigned long error = regs->ARM_r0;
	return IS_ERR_VALUE(error) ? error : 0;
}

because this function really does have to differentiate between error
return values and addresses which look like negative numbers (eg, from
mmap()).

So, here's a patch to remove them from OMAP, except for the above.

Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2013-03-13 20:44:21 +00:00
..
include/plat ARM: arm-soc: late cleanups for omap 2012-12-30 09:59:21 -08:00
counter_32k.c ARM: OMAP: 32k counter: resolve sparse warnings 2012-12-28 02:09:01 -07:00
debug-leds.c ARM: OMAP: debug-leds: Use resource_size instead of hard coded macro 2012-11-12 13:28:28 -08:00
dma.c ARM: drivers: remove __dev* attributes. 2013-01-03 15:57:04 -08:00
dmtimer.c ARM: OMAP: use consistent error checking 2013-03-13 20:44:21 +00:00
i2c.c Revert "ARM: OMAP: convert I2C driver to PM QoS for MPU latency constraints" 2012-11-14 11:54:41 +01:00
Kconfig ARM: OMAP2+: timer: remove CONFIG_OMAP_32K_TIMER 2012-11-21 10:15:59 -08:00
mailbox.c workqueue: deprecate flush[_delayed]_work_sync() 2012-08-20 14:51:24 -07:00
Makefile ARM: arm-soc: late cleanups for omap 2012-12-30 09:59:21 -08:00
sram.c ARM: OMAP: SRAM: resolve sparse warnings 2013-01-01 15:42:00 -07:00