core/namespace: rework the return semantics of clone_device_node yet again
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 12 Apr 2018 15:48:22 +0000 (17:48 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 12 Apr 2018 16:15:33 +0000 (18:15 +0200)
commitaf984e137e7f53ca3e2fd885b03a25e17fdd0fad
tree51513e2a7dd2c58fe6aa4172615bca7a3cbf9e40
parent16498617443da94533ef9ae28be0ffaace40c526
core/namespace: rework the return semantics of clone_device_node yet again

Returning 0 on not-found/wrong-type is confusing. Let's return -ENXIO in that
case instead, and explicitly ignore it in the call site where we want to do that.
I think this is clearer and less likely to be used errenously in case another
call site is added.

C.f. 152c475f95c7b9b20d293 and 98b1d2b8d9ea27087a598.
src/core/namespace.c