Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

MIPS: Lantiq: Fix another request_mem_region() return code check

Hauke already fixed a couple of them, but one instance remains
that checks for a negative integer when it should check
for a NULL pointer:

arch/mips/lantiq/xway/sysctrl.c: In function 'ltq_soc_init':
arch/mips/lantiq/xway/sysctrl.c:473:19: error: ordered comparison of pointer with integer zero [-Werror=extra]

Fixes: 6e807852676a ("MIPS: Lantiq: Fix check for return value of request_mem_region()")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: John Crispin <john@phrozen.org>
Cc: linux-mips@linux-mips.org
Cc: linux-kernel@vger.kernel.org
Patchwork: https://patchwork.linux-mips.org/patch/15043/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

authored by

Arnd Bergmann and committed by
Ralf Baechle
98ea51cb e4558729

+2 -2
+2 -2
arch/mips/lantiq/xway/sysctrl.c
··· 469 469 panic("Failed to load xbar nodes from devicetree"); 470 470 if (of_address_to_resource(np_pmu, 0, &res_xbar)) 471 471 panic("Failed to get xbar resources"); 472 - if (request_mem_region(res_xbar.start, resource_size(&res_xbar), 473 - res_xbar.name) < 0) 472 + if (!request_mem_region(res_xbar.start, resource_size(&res_xbar), 473 + res_xbar.name)) 474 474 panic("Failed to get xbar resources"); 475 475 476 476 ltq_xbar_membase = ioremap_nocache(res_xbar.start,