Commit e5d5ffa4 authored by Yang Yingliang's avatar Yang Yingliang Committed by Hans de Goede

platform/x86/siemens: simatic-ipc-batt: fix wrong pointer pass to PTR_ERR()

Fix wrong pointer pass to PTR_ERR() if devm_gpiod_get_index() fails.

Fixes: 917f5434 ("platform/x86: simatic-ipc: add CMOS battery monitoring")
Signed-off-by: default avatarYang Yingliang <yangyingliang@huawei.com>
Reviewed-by: default avatarIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
Link: https://lore.kernel.org/r/20230809081227.1221267-1-yangyingliang@huawei.comSigned-off-by: default avatarHans de Goede <hdegoede@redhat.com>
parent c56beff2
......@@ -198,7 +198,7 @@ int simatic_ipc_batt_probe(struct platform_device *pdev, struct gpiod_lookup_tab
flags = GPIOD_OUT_LOW;
priv.gpios[2] = devm_gpiod_get_index(dev, "CMOSBattery meter", 2, flags);
if (IS_ERR(priv.gpios[2])) {
err = PTR_ERR(priv.gpios[1]);
err = PTR_ERR(priv.gpios[2]);
priv.gpios[2] = NULL;
goto out;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment