[v2,2/2] platform/x86/siemens: simatic-ipc-batt: fix logic error for BX-59A

Message ID 20430731173417.2692-1-xingtong_wu@163.com
State New
Headers
Series [v2,1/2] platform/x86/siemens: simatic-ipc: fix logic error in BX-59A |

Commit Message

Xing Tong Wu July 31, 2043, 5:34 p.m. UTC
  From: "xingtong.wu" <xingtong.wu@siemens.com>

The variable "priv.devmode" is missing from if statement that leads
to a logical error. Add the missing variable to the if condition.

Fixes: c56beff20375 ("platform/x86/siemens: simatic-ipc-batt: add support for module BX-59A")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202308010001.BGYCSQrl-lkp@intel.com/

Signed-off-by: xingtong.wu <xingtong.wu@siemens.com>
---
 drivers/platform/x86/siemens/simatic-ipc-batt.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
  

Comments

Ilpo Järvinen Aug. 7, 2023, 9 a.m. UTC | #1
On Sat, 1 Aug 2043, xingtong_wu@163.com wrote:

> From: "xingtong.wu" <xingtong.wu@siemens.com>
> 
> The variable "priv.devmode" is missing from if statement that leads
> to a logical error. Add the missing variable to the if condition.
>
> Fixes: c56beff20375 ("platform/x86/siemens: simatic-ipc-batt: add support for module BX-59A")
> Reported-by: kernel test robot <lkp@intel.com>
> Closes: https://lore.kernel.org/oe-kbuild-all/202308010001.BGYCSQrl-lkp@intel.com/
> 
> Signed-off-by: xingtong.wu <xingtong.wu@siemens.com>

The tags block should not have extra newlines like there's now one in 
between Closes and Signed-off-by.

For patches 1-2:

Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>

(In case you end up submitting a new version, you should collect the tags 
other people have given you, except e.g., if you did major modifications 
to the patch.)
  

Patch

diff --git a/drivers/platform/x86/siemens/simatic-ipc-batt.c b/drivers/platform/x86/siemens/simatic-ipc-batt.c
index d66b9969234b..e6c12c52843c 100644
--- a/drivers/platform/x86/siemens/simatic-ipc-batt.c
+++ b/drivers/platform/x86/siemens/simatic-ipc-batt.c
@@ -194,7 +194,8 @@  int simatic_ipc_batt_probe(struct platform_device *pdev, struct gpiod_lookup_tab
 
 	if (table->table[2].key) {
 		flags = GPIOD_OUT_HIGH;
-		if (priv.devmode == SIMATIC_IPC_DEVICE_BX_21A || SIMATIC_IPC_DEVICE_BX_59A)
+		if (priv.devmode == SIMATIC_IPC_DEVICE_BX_21A ||
+		    priv.devmode == SIMATIC_IPC_DEVICE_BX_59A)
 			flags = GPIOD_OUT_LOW;
 		priv.gpios[2] = devm_gpiod_get_index(dev, "CMOSBattery meter", 2, flags);
 		if (IS_ERR(priv.gpios[2])) {