diff options
author | Russell King <rmk+kernel@arm.linux.org.uk> | 2013-03-13 16:44:21 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2013-05-02 14:54:22 -0400 |
commit | c48cd659892962f79bba4b4e0eedea8e5aa54c44 (patch) | |
tree | 0880025c1deabc9ad252db3a7fd7af7e9ab755f9 /arch/arm/mach-omap2/clock.c | |
parent | 857835c6d57aef101ac335a6da2149b54e7e0512 (diff) |
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>
Diffstat (limited to 'arch/arm/mach-omap2/clock.c')
-rw-r--r-- | arch/arm/mach-omap2/clock.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/arm/mach-omap2/clock.c b/arch/arm/mach-omap2/clock.c index e4ec3a69ee2e..2191f25ad21b 100644 --- a/arch/arm/mach-omap2/clock.c +++ b/arch/arm/mach-omap2/clock.c | |||
@@ -596,7 +596,7 @@ int __init omap2_clk_switch_mpurate_at_boot(const char *mpurate_ck_name) | |||
596 | return -ENOENT; | 596 | return -ENOENT; |
597 | 597 | ||
598 | r = clk_set_rate(mpurate_ck, mpurate); | 598 | r = clk_set_rate(mpurate_ck, mpurate); |
599 | if (IS_ERR_VALUE(r)) { | 599 | if (r < 0) { |
600 | WARN(1, "clock: %s: unable to set MPU rate to %d: %d\n", | 600 | WARN(1, "clock: %s: unable to set MPU rate to %d: %d\n", |
601 | mpurate_ck_name, mpurate, r); | 601 | mpurate_ck_name, mpurate, r); |
602 | clk_put(mpurate_ck); | 602 | clk_put(mpurate_ck); |