Received: by 2002:a05:7412:40d:b0:e2:908c:2ebd with SMTP id 13csp247212rdf; Tue, 21 Nov 2023 01:11:54 -0800 (PST) X-Google-Smtp-Source: AGHT+IHutkuKdRVmtJFxB2giOfGa+zqMtb/wZfXTjNq+48+QFOo9dbM6zxDbnlDKen41oRM5WOeQ X-Received: by 2002:a05:6a20:734e:b0:187:1cb7:337f with SMTP id v14-20020a056a20734e00b001871cb7337fmr3167205pzc.15.1700557914002; Tue, 21 Nov 2023 01:11:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700557913; cv=none; d=google.com; s=arc-20160816; b=i4no1ilAbELE5mdmNzxi5RtCTO1qf8oqj8EvRt5lE7U5/bcZh7EeOU81tbxMdCNtt3 f68PYX0Yo59ArFDjOTqpNsBdxi8e0Y1/zWfhc9K7JHXfIFwh4Q+Kl1AQOq2YfQ03Rjqy IsB7JLAJ5uMzr1cfiK7uAJhFAiZT06To5eqOfnbgev3lM4sWF7oAKyyY7B/1LdYCKzXA 6+NIJlyQPxmG++hFD27kCbr7Ov/wkbCz3FzrFRdpnPkFI2UUin6L7AuUjNW/Gz9HidWN mbGsb7lpleXEczh4MDmxud/2GPvn5/e/0oCBDeQgyHCOw23KgEuVWwoE1+kK6DSkZ2jv Zxgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=PVEWPYbsjaWw8oNKtC+GT//cdbDx4S4lXW9HsdlX7Qc=; fh=1/AZsjf7CiLZ27bZYjHY5GgNwUuPg/xul+pLHWYqyS8=; b=0GjXumZr1bDunnRjkILDkqzQKxNEsk62g4Km2z/ZBb4KkSHhzhGzBYDVytdwTdgq5C sb1K1siieX2j5tppAxSbZyZpWTZET3oau0+9Uw+NgjfEJi/vvDFcfkgXzrWZ0hebJH9M 5sCfki1YdBHY8CWRoldYohjHCaLNOPDTnOQx+xKYQPlVrN23hBxDunEf2EHALVLWo8lV 8KHjIDFvaNe8ThylnkMD8dZM2zeeBHng/EyAFSxW89Wz0aFbgSM+ByVDvl+gViUfUAp+ HVCcXjoV4S7rFq1gSMnuMg9czSZjmUo9LrqBfqXUk+esYGBv/I4/D4lpBW+qvXbaCFgS N+jw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id j190-20020a638bc7000000b005b368301d97si10210565pge.305.2023.11.21.01.11.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Nov 2023 01:11:53 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 051D680ACCF2; Tue, 21 Nov 2023 01:11:51 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229454AbjKUJLm (ORCPT + 99 others); Tue, 21 Nov 2023 04:11:42 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48006 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231441AbjKUJLl (ORCPT ); Tue, 21 Nov 2023 04:11:41 -0500 Received: from rtits2.realtek.com.tw (rtits2.realtek.com [211.75.126.72]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AB64B18E; Tue, 21 Nov 2023 01:11:27 -0800 (PST) X-SpamFilter-By: ArmorX SpamTrap 5.78 with qID 3AL9BMr041506565, This message is accepted by code: ctloc85258 Received: from mail.realtek.com (rtexh36506.realtek.com.tw[172.21.6.27]) by rtits2.realtek.com.tw (8.15.2/2.95/5.92) with ESMTPS id 3AL9BMr041506565 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 21 Nov 2023 17:11:22 +0800 Received: from RTEXMBS05.realtek.com.tw (172.21.6.98) by RTEXH36506.realtek.com.tw (172.21.6.27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.17; Tue, 21 Nov 2023 17:11:23 +0800 Received: from RTEXH36506.realtek.com.tw (172.21.6.27) by RTEXMBS05.realtek.com.tw (172.21.6.98) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Tue, 21 Nov 2023 17:11:22 +0800 Received: from localhost.localdomain (172.21.252.101) by RTEXH36506.realtek.com.tw (172.21.6.27) with Microsoft SMTP Server id 15.1.2507.17 via Frontend Transport; Tue, 21 Nov 2023 17:11:22 +0800 From: Tzuyi Chang To: Linus Walleij CC: Dan Carpenter , , , Tzuyi Chang Subject: [PATCH] pinctrl: realtek: Fix logical error when finding descriptor Date: Tue, 21 Nov 2023 17:11:07 +0800 Message-ID: <20231121091107.5564-1-tychang@realtek.com> X-Mailer: git-send-email 2.42.0 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-KSE-ServerInfo: RTEXMBS05.realtek.com.tw, 9 X-KSE-AntiSpam-Interceptor-Info: fallback X-KSE-Antivirus-Interceptor-Info: fallback X-KSE-AntiSpam-Interceptor-Info: fallback X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Tue, 21 Nov 2023 01:11:51 -0800 (PST) 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") Signed-off-by: Tzuyi Chang --- drivers/pinctrl/realtek/pinctrl-rtd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/pinctrl/realtek/pinctrl-rtd.c b/drivers/pinctrl/realtek/pinctrl-rtd.c index 9c7a1af4ba69..208896593b61 100644 --- a/drivers/pinctrl/realtek/pinctrl-rtd.c +++ b/drivers/pinctrl/realtek/pinctrl-rtd.c @@ -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; -- 2.42.0