Skip to content

Commit 38a285d

Browse files
Tzuyi ChangLinus Walleij
authored andcommitted
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: e99ce78 ("pinctrl: realtek: Add common pinctrl driver for Realtek DHC RTD SoCs") Signed-off-by: Tzuyi Chang <tychang@realtek.com> Link: https://lore.kernel.org/r/20231121091107.5564-1-tychang@realtek.com Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
1 parent 6588732 commit 38a285d

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

drivers/pinctrl/realtek/pinctrl-rtd.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ static int rtd_pinctrl_get_function_groups(struct pinctrl_dev *pcdev,
146146

147147
static const struct rtd_pin_desc *rtd_pinctrl_find_mux(struct rtd_pinctrl *data, unsigned int pin)
148148
{
149-
if (!data->info->muxes[pin].name)
149+
if (data->info->muxes[pin].name)
150150
return &data->info->muxes[pin];
151151

152152
return NULL;
@@ -249,7 +249,7 @@ static const struct pinctrl_pin_desc
249249
static const struct rtd_pin_config_desc
250250
*rtd_pinctrl_find_config(struct rtd_pinctrl *data, unsigned int pin)
251251
{
252-
if (!data->info->configs[pin].name)
252+
if (data->info->configs[pin].name)
253253
return &data->info->configs[pin];
254254

255255
return NULL;

0 commit comments

Comments
 (0)