On Tue, May 24, 2022 at 4:32 PM Kefeng Wang <wangkefeng.wang@xxxxxxxxxx> wrote:
On 2022/5/24 20:37, Arnd Bergmann wrote:I had another look at the resulting arm64 function, and it appears that
On Thu, May 19, 2022 at 10:25 AM Kefeng Wang <wangkefeng.wang@xxxxxxxxxx> wrote:I don't find a good error code, maybe ENOTSUPP, any better suggestion?
Add special hook for architecture to verify or setup addr, sizeI don't really like interfaces that mix error pointers and NULL pointer
or prot when ioremap() or iounmap(), which will make the generic
ioremap more useful.
arch_ioremap() return a pointer,
- IS_ERR means return an error
- NULL means continue to remap
- a non-NULL, non-IS_ERR pointer is directly returned
arch_iounmap() return a int value,
- 0 means continue to vunmap
- error code means skip vunmap and return directly
Signed-off-by: Kefeng Wang <wangkefeng.wang@xxxxxxxxxx>
returns.
Would it be possible to have a special error code other than NULL
for the fallback case?
you never actually return a non-error pointer here. If I didn't miss anything,
I think the best way would be to change the return type to just indicate
success or an error code, and drop the case of returning the actual result,
and changing the function name accordingly.
Would that work, or do you actually require returning an __iomem
token from somewhere else?
Arnd
.