soc: fsl: qe: avoid IS_ERR_VALUE in ucc_slow.c
authorRasmus Villemoes <linux@rasmusvillemoes.dk>
Thu, 28 Nov 2019 14:55:45 +0000 (15:55 +0100)
committerLi Yang <leoyang.li@nxp.com>
Mon, 9 Dec 2019 19:54:36 +0000 (13:54 -0600)
commit611780a6aa500345360bcda8a6dfdcd0666d4695
tree1ae51f7f74485ffa42338828af55fa3a1b27934b
parentec2058ac8f507865f7a7c353473bf0f4ebce5fc0
soc: fsl: qe: avoid IS_ERR_VALUE in ucc_slow.c

When trying to build this for a 64-bit platform, one gets warnings
from using IS_ERR_VALUE on something which is not sizeof(long).

Instead, change the various *_offset fields to store a signed integer,
and simply check for a negative return from qe_muram_alloc(). Since
qe_muram_free() now accepts and ignores a negative argument, we only
need to make sure these fields are initialized with -1, and we can
just unconditionally call qe_muram_free() in ucc_slow_free().

Note that the error case for us_pram_offset failed to set that field
to 0 (which, as noted earlier, is anyway a bogus sentinel value).

Reviewed-by: Timur Tabi <timur@kernel.org>
Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Signed-off-by: Li Yang <leoyang.li@nxp.com>
drivers/soc/fsl/qe/ucc_slow.c
include/soc/fsl/qe/ucc_slow.h