Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d211c6e8 authored by Axel Lin's avatar Axel Lin Committed by Anton Vorontsov
Browse files

generic-adc-battery: Fix checking if none of the channels are supported



If none of the channels are supported, index is 0. Also ensure to return
error code instead of 0 in goto second_mem_fail path.

Signed-off-by: default avatarAxel Lin <axel.lin@ingics.com>
Acked-by: default avataranish kumar <anish198519851985@gmail.com>
Signed-off-by: default avatarAnton Vorontsov <anton@enomsg.org>
parent e0835879
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -299,8 +299,10 @@ static int gab_probe(struct platform_device *pdev)
	}

	/* none of the channels are supported so let's bail out */
	if (index == ARRAY_SIZE(gab_chan_name))
	if (index == 0) {
		ret = -ENODEV;
		goto second_mem_fail;
	}

	/*
	 * Total number of properties is equal to static properties