From: Richard Fitzgerald Date: Sat, 3 Mar 2018 17:30:34 +0000 (+0000) Subject: extcon: madera: Fix skipping of ranges < external resistor X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=122cef3b48f919afb917e032e2ddeb0be4372e99;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git extcon: madera: Fix skipping of ranges < external resistor The loop for skipping external ranges should start at the first valid range. It was starting at 0 which on cs47l15 had the effect of changing hpdet_init_range to 0. Change-Id: If4783b66b661dceca28aaa5617f6494af7898c5f Signed-off-by: Richard Fitzgerald --- diff --git a/drivers/extcon/extcon-madera.c b/drivers/extcon/extcon-madera.c index 2bbb91f8bb99..4709ea1855e0 100644 --- a/drivers/extcon/extcon-madera.c +++ b/drivers/extcon/extcon-madera.c @@ -3312,7 +3312,7 @@ static int madera_extcon_probe(struct platform_device *pdev) } /* Skip any HPDET ranges less than the external resistance */ - for (i = 0; i < info->num_hpdet_ranges; ++i) { + for (i = info->hpdet_init_range; i < info->num_hpdet_ranges; ++i) { if (madera_ohm_to_hohm(info->hpdet_ranges[i].max) >= pdata->hpdet_ext_res_x100) { info->hpdet_init_range = i;