Skip to content

Commit de3b9fe

Browse files
Dan Carpenterjic23
authored andcommitted
iio:dac:ad3552r: Fix an IS_ERR() vs NULL check
The fwnode_get_named_child_node() function does not return error pointers. It returns NULL. Update the check accordingly. Fixes: 8f2b548 ("drivers:iio:dac: Add AD3552R driver support") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Reviewed-by: Nuno Sá <nuno.sa@analog.com> Link: https://lore.kernel.org/r/20220404114244.GA19201@kili Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
1 parent d79478a commit de3b9fe

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/iio/dac/ad3552r.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -809,10 +809,10 @@ static int ad3552r_configure_custom_gain(struct ad3552r_desc *dac,
809809

810810
gain_child = fwnode_get_named_child_node(child,
811811
"custom-output-range-config");
812-
if (IS_ERR(gain_child)) {
812+
if (!gain_child) {
813813
dev_err(dev,
814814
"mandatory custom-output-range-config property missing\n");
815-
return PTR_ERR(gain_child);
815+
return -EINVAL;
816816
}
817817

818818
dac->ch_data[ch].range_override = 1;

0 commit comments

Comments
 (0)