diff options
author | Yang Yingliang <yangyingliang@huawei.com> | 2023-08-09 11:12:27 +0300 |
---|---|---|
committer | Hans de Goede <hdegoede@redhat.com> | 2023-08-09 23:02:50 +0300 |
commit | e5d5ffa48a6eadb67949590ca78c594836e2ae28 (patch) | |
tree | 43aea4ba4e3fceb3e5c8b0054b2225c54940d1c0 /drivers/platform/x86/siemens | |
parent | c56beff2037549c951042d178de75e535818a98a (diff) | |
download | linux-e5d5ffa48a6eadb67949590ca78c594836e2ae28.tar.xz |
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: 917f54340794 ("platform/x86: simatic-ipc: add CMOS battery monitoring")
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Link: https://lore.kernel.org/r/20230809081227.1221267-1-yangyingliang@huawei.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Diffstat (limited to 'drivers/platform/x86/siemens')
-rw-r--r-- | drivers/platform/x86/siemens/simatic-ipc-batt.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/platform/x86/siemens/simatic-ipc-batt.c b/drivers/platform/x86/siemens/simatic-ipc-batt.c index d66b9969234b..15c08c4900b8 100644 --- a/drivers/platform/x86/siemens/simatic-ipc-batt.c +++ b/drivers/platform/x86/siemens/simatic-ipc-batt.c @@ -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; } |