reset: Fix of_reset_control_get() for consistent return values
authorAlban Bedel <albeu@free.fr>
Tue, 1 Sep 2015 15:28:31 +0000 (17:28 +0200)
committerPhilipp Zabel <p.zabel@pengutronix.de>
Mon, 16 Nov 2015 08:23:47 +0000 (09:23 +0100)
commit3d81216fde465e76c5eae98f61d3666163634395
tree023f1529f76097af8c143587979744fea38e393d
parentc0a13aa6da5da19f9eedb562b226ec585aabdca9
reset: Fix of_reset_control_get() for consistent return values

When of_reset_control_get() is called without connection ID it returns
-ENOENT when the 'resets' property doesn't exists or is an empty entry.
However when a connection ID is given it returns -EINVAL when the 'resets'
property doesn't exists or the requested name can't be found. This is
because the error code returned by of_property_match_string() is just
passed down as an index to of_parse_phandle_with_args(), which then
returns -EINVAL.

To get a consistent return value with both code paths we must return
-ENOENT when of_property_match_string() fails.

Signed-off-by: Alban Bedel <albeu@free.fr>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
drivers/reset/core.c