[PATCH] NOMMU: Improved handling of get_unmapped_area() errors
The attached patch does two things:
(1) We no longer check the return value of file->f_op->get_unmapped_area()
unless we actually called it. We know addr is zero otherwise because
we'd've given an error earlier if it wasn't.
(2) If -ENOSYS was returned by that operation, then we assume we actually
called a driver (such as the framebuffer driver) that might want to
invoke the operation in a lower level driver (such as matroxfb) if one
exists, and that it found that one didn't.
We translate the -ENOSYS error into -ENODEV - the error we would have
given if the operation was not supplied in the file ops.
Doing this permits us an opportunity for arch_get_unmapped_area() or
something else to be called if we want that to happen, particularly in
the MMU case.
Signed-Off-By: David Howells <dhowells@redhat.com> Signed-Off-By: Linus Torvalds <torvalds@osdl.org>