Skip to contentSkip to conversation

pinctrl: realtek: Fix logical error when finding descriptor

PATCH In review Tzuyi Chang 2 participants 2 messages Nov 21, 2023 – Nov 24, 2023

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 pinctrl: realtek: Fix logical error when finding descriptor

The pin descriptor should be returned if the name has been found in the descriptor table. Remove the negation in the if statement for accurate retrieval.

Fixes e99ce78030db ("pinctrl: realtek: Add common pinctrl driver for Realtek DHC RTD SoCs")
---
 drivers/pinctrl/realtek/pinctrl-rtd.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/pinctrl/realtek/pinctrl-rtd.c +2 -2
index 9c7a1af4ba69..208896593b61 100644
@@ -146,7 +146,7 @@ static int rtd_pinctrl_get_function_groups(struct pinctrl_dev *pcdev,
 
 static const struct rtd_pin_desc *rtd_pinctrl_find_mux(struct rtd_pinctrl *data, unsigned int pin)
 {
-	if (!data->info->muxes[pin].name)
+	if (data->info->muxes[pin].name)
 		return &data->info->muxes[pin];
 
 	return NULL;
@@ -249,7 +249,7 @@ static const struct pinctrl_pin_desc
 static const struct rtd_pin_config_desc
 	*rtd_pinctrl_find_config(struct rtd_pinctrl *data, unsigned int pin)
 {
-	if (!data->info->configs[pin].name)
+	if (data->info->configs[pin].name)
 		return &data->info->configs[pin];
 
 	return NULL;
Signature · 1 line
2.42.0
#1 lore raw
Quoted 6 lines · Tzuyi Chang

The pin descriptor should be returned if the name has been found in the descriptor table. Remove the negation in the if statement for accurate retrieval.

Fixes e99ce78030db ("pinctrl: realtek: Add common pinctrl driver for Realtek DHC RTD SoCs")

Patch applied for fixes!

Yours,
Linus Walleij