From patchwork Fri Oct 6 21:04:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 149409 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a888:0:b0:403:3b70:6f57 with SMTP id x8csp594225vqo; Fri, 6 Oct 2023 14:04:51 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF4s6bbOM5dY7c7/8AoERwqmMZsU71CmLN79sdDJOUWls7E7pxt4ZM6aD8TnqyESGrkFeRk X-Received: by 2002:a05:6358:261a:b0:14f:d52:39cb with SMTP id l26-20020a056358261a00b0014f0d5239cbmr11110094rwc.26.1696626290803; Fri, 06 Oct 2023 14:04:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696626290; cv=none; d=google.com; s=arc-20160816; b=cnwwD4LcLGPPu5qtMxpDu5xswGTtYxhUPfQ2UTA3A2y4MMYHy7atBtKswAvSV5OAer +VIPoJV66/YBVCw9dcIWm5hTR8rYL95XRDjJEPqfbleNa1WjPu2AzeVNs9E4ReleQzvl D+aZAqwSO+25OyrHLJyPr+erPi69ubdsVkLKqQn7Y9QRLszfyH6yEQFXk6Dt87Ibvmgc oEEgBMmbKy+IryKb4nhcuBiGJoPky2UxpDl4xm14OSB+LpXg6QuVj/bSve3907U2sWXZ GAXcfuJGSLxPAIXxA05tSyaJ/e0TBu+0ZdwBcYs8Yhg2TZeK8QOE3izG/0SIXfaMmzDO RMQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=0gRhdNWLww8131tERKBK6Gq4NzqQdVzbadH36wOuOqU=; fh=HeFuHcG6IktQO4a/cwjZUtGV29xawWhpXBb+OCTZ9Vg=; b=GwZ0x/7F5OgMYpW3q8km2ej39xthDI21oy+26WzJer8WupZb9xHMjYJDMBPrQv35vn kjipYmTbYrDxDRNe9HbMXDTVlzn0I8cb8CdGRNstz3zTEj77HGQL0F7l8JuL/8a1Wogf fM3RQ3Nw0RqmEUTdCzTifu+yiWl37GJVgiNplf1shX3OG81+B+yOdcXWnRjBTU44ZnOs CU1KBhSWGbeem9mY/YmPAUBCrJyA7LylkaPmcsqa7oQC94jRE2xpu7F23V1cyC0UCjU/ mnOTcwBijY2h6VmqRjGHi0ce0qTGtuAzxJu+637bEj9rnBmQdvptF8U9sGW2sEmGEV2l acTA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=RgBAllhP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id a1-20020a655c81000000b0057ab7f46381si4222460pgt.76.2023.10.06.14.04.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Oct 2023 14:04:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=RgBAllhP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 1902A818CC8C; Fri, 6 Oct 2023 14:04:48 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233657AbjJFVEa (ORCPT + 18 others); Fri, 6 Oct 2023 17:04:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55242 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233635AbjJFVEZ (ORCPT ); Fri, 6 Oct 2023 17:04:25 -0400 Received: from mail-lj1-x22f.google.com (mail-lj1-x22f.google.com [IPv6:2a00:1450:4864:20::22f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 61185BD for ; Fri, 6 Oct 2023 14:04:22 -0700 (PDT) Received: by mail-lj1-x22f.google.com with SMTP id 38308e7fff4ca-2c17de836fbso31752701fa.1 for ; Fri, 06 Oct 2023 14:04:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696626260; x=1697231060; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=0gRhdNWLww8131tERKBK6Gq4NzqQdVzbadH36wOuOqU=; b=RgBAllhPuvHE58VeOKyCwaNQW5hKHzU/LPdJHzzP4qqdRCVJqwV79dM4qVdknEfFx7 O3NM7kdoyYEHaWVOjy++fhDkxDATtWSIiFCAqvTPFEX77QMtvdNqj5itnbbNhCCy7pRb 1ADezwecAXAqMP45ptzJgXh4L+afEJxp4ATByy+C3pKFt5Mveddvt7xtWttTdHbsGgBX Krs/jFZE3KMsLMKVqSsyIHvYYp8HcRrAMB1FbAARa8Mzou09scZpgmnKp36CMejDqfeP lR6TK22bqOK7losMKUfMmoHFkSvOvq6iPaRB3d7czlwGVfKVWoH8c6inlFU/rJw0GvzE L5Ig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696626260; x=1697231060; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=0gRhdNWLww8131tERKBK6Gq4NzqQdVzbadH36wOuOqU=; b=WYw5vszwH3D+c65p486PMtbQAXNGMUCn/iOhdJ/PvPkwXFJsWAOvMYVO6dp8FAT87s GGl7+iP600zJLWiv9UjVKj8X9qxm2kBlz7y7luUjsGugiRnzJ5GHvffpXE506VFLgp3P /IHWX+yKc1IeKCgy5y+cnWCYTj+u7RvvOqAMzU7NNLYS4tuqZkgiaGfUW5BETq5R6a5z /dqRZShsR86jeGuLvwxGlTkx7E8nCcXA1tEbBGmT4RvwKsHiQyKT3CeCodpaXlH09NTn mO0RzCzgZUVcFM999p1hywSW3YepeWn1jlz14XE/Jj7UUHcjAdfZ30ORnSoIdbo4/8vu r/MA== X-Gm-Message-State: AOJu0Yy5LCDJy63RP2IetGvNM+ptX7wvzraifQS1nqxIV7ox/xwJhLti kiWBbxIBMh+ZkDpvAVlYINNJ4g== X-Received: by 2002:a05:6512:3494:b0:500:c348:7efd with SMTP id v20-20020a056512349400b00500c3487efdmr8154629lfr.59.1696626260055; Fri, 06 Oct 2023 14:04:20 -0700 (PDT) Received: from [127.0.1.1] ([85.235.12.238]) by smtp.gmail.com with ESMTPSA id d25-20020ac25459000000b00501ce28db76sm432993lfn.291.2023.10.06.14.04.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Oct 2023 14:04:18 -0700 (PDT) From: Linus Walleij Date: Fri, 06 Oct 2023 23:04:18 +0200 Subject: [PATCH 1/2] pinctrl: realtek: Tag unused pins as __maybe_unused MIME-Version: 1.0 Message-Id: <20231006-fix-realtek-warnings-v1-1-09af253312ba@linaro.org> References: <20231006-fix-realtek-warnings-v1-0-09af253312ba@linaro.org> In-Reply-To: <20231006-fix-realtek-warnings-v1-0-09af253312ba@linaro.org> To: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, Linus Walleij Cc: Tzuyi Chang X-Mailer: b4 0.12.3 X-Spam-Status: No, score=2.7 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no 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]); Fri, 06 Oct 2023 14:04:48 -0700 (PDT) X-Spam-Level: ** X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779041609846871914 X-GMAIL-MSGID: 1779041609846871914 These pin definitions are helpful to have when working with the driver in the future, so they are in a sense a bit like documentation. They could be commented out as well, but why. This should fix these build warnings: drivers/pinctrl/realtek/pinctrl-rtd1315e.c:231:35: warning: 'rtd1315e_boot_sel_pins' defined but not used [-Wunused-const-variable=] drivers/pinctrl/realtek/pinctrl-rtd1315e.c:231:35: warning: 'rtd1315e_reset_n_pins' defined but not used [-Wunused-const-variable=] drivers/pinctrl/realtek/pinctrl-rtd1315e.c:231:35: warning: 'rtd1315e_scan_switch_pins' defined but not used [-Wunused-const-variable=] drivers/pinctrl/realtek/pinctrl-rtd1315e.c:231:35: warning: 'rtd1315e_testmode_pins' defined but not used [-Wunused-const-variable=] drivers/pinctrl/realtek/pinctrl-rtd1315e.c:231:35: warning: 'rtd1315e_wd_rset_pins' defined but not used [-Wunused-const-variable=] drivers/pinctrl/realtek/pinctrl-rtd1319d.c:237:35: warning: 'rtd1319d_boot_sel_pins' defined but not used [-Wunused-const-variable=] drivers/pinctrl/realtek/pinctrl-rtd1319d.c:237:35: warning: 'rtd1319d_reset_n_pins' defined but not used [-Wunused-const-variable=] drivers/pinctrl/realtek/pinctrl-rtd1319d.c:237:35: warning: 'rtd1319d_scan_switch_pins' defined but not used [-Wunused-const-variable=] drivers/pinctrl/realtek/pinctrl-rtd1319d.c:237:35: warning: 'rtd1319d_testmode_pins' defined but not used [-Wunused-const-variable=] drivers/pinctrl/realtek/pinctrl-rtd1319d.c:237:35: warning: 'rtd1319d_wd_rset_pins' defined but not used [-Wunused-const-variable=] Cc: Tzuyi Chang Link: https://lore.kernel.org/oe-kbuild-all/202309270313.mBEc9o1A-lkp@intel.com/ Link: https://lore.kernel.org/oe-kbuild-all/202309270448.7Aen3Sgx-lkp@intel.com/ Signed-off-by: Linus Walleij --- drivers/pinctrl/realtek/pinctrl-rtd1315e.c | 3 ++- drivers/pinctrl/realtek/pinctrl-rtd1319d.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/pinctrl/realtek/pinctrl-rtd1315e.c b/drivers/pinctrl/realtek/pinctrl-rtd1315e.c index 5ab35d73e6f4..10afc736a52b 100644 --- a/drivers/pinctrl/realtek/pinctrl-rtd1315e.c +++ b/drivers/pinctrl/realtek/pinctrl-rtd1315e.c @@ -227,8 +227,9 @@ static const struct pinctrl_pin_desc rtd1315e_iso_pins[] = { PINCTRL_PIN(RTD1315E_ISO_TESTMODE, "testmode"), }; +/* Tagged as __maybe_unused since there are pins we may use in the future */ #define DECLARE_RTD1315E_PIN(_pin, _name) \ - static const unsigned int rtd1315e_## _name ##_pins[] = { _pin } + static const unsigned int rtd1315e_## _name ##_pins[] __maybe_unused = { _pin } DECLARE_RTD1315E_PIN(RTD1315E_ISO_GPIO_0, gpio_0); DECLARE_RTD1315E_PIN(RTD1315E_ISO_GPIO_1, gpio_1); diff --git a/drivers/pinctrl/realtek/pinctrl-rtd1319d.c b/drivers/pinctrl/realtek/pinctrl-rtd1319d.c index 838a447776ba..b1a654ac30dc 100644 --- a/drivers/pinctrl/realtek/pinctrl-rtd1319d.c +++ b/drivers/pinctrl/realtek/pinctrl-rtd1319d.c @@ -233,8 +233,9 @@ static const struct pinctrl_pin_desc rtd1319d_iso_pins[] = { PINCTRL_PIN(RTD1319D_ISO_TESTMODE, "testmode"), }; +/* Tagged as __maybe_unused since there are pins we may use in the future */ #define DECLARE_RTD1319D_PIN(_pin, _name) \ - static const unsigned int rtd1319d_## _name ##_pins[] = { _pin } + static const unsigned int rtd1319d_## _name ##_pins[] __maybe_unused = { _pin } DECLARE_RTD1319D_PIN(RTD1319D_ISO_GPIO_0, gpio_0); DECLARE_RTD1319D_PIN(RTD1319D_ISO_GPIO_1, gpio_1); From patchwork Fri Oct 6 21:04:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 149408 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a888:0:b0:403:3b70:6f57 with SMTP id x8csp594169vqo; Fri, 6 Oct 2023 14:04:45 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEwIzBpoQrJ6q+Huv2kC/87iQCkuvY7UhWXJThlRX9oBkDyJUDpkJGcDp1b8rpznEktx1gp X-Received: by 2002:a05:6a20:3c90:b0:15e:22a4:b897 with SMTP id b16-20020a056a203c9000b0015e22a4b897mr8306141pzj.10.1696626285155; Fri, 06 Oct 2023 14:04:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696626285; cv=none; d=google.com; s=arc-20160816; b=Azko/1L6o0R7Pen9vPvLHHwLy/0brh5+trh+q+scSk5BdeoCpWZuqBRKkLpni+LAiV QCfkRjUhnUHsvWp1yDQhZ9em4tEZ2SaWKXwNdsGiXA+DqwgOAvnANIrGzU9jkCtbDsVN /RXXk8edZI/hfMgUfIVOJS+USfZjxgc9R5/8oK0Fkt7SwYHRfVZk4nvsgRAOTy96FjlG xcW/7IxbjLUKV1uQ+T2WPBY4xXVSX4KS1ALZyskMfdFGSkpGCHaZTM3B7BdhkCJNQ/dz ifX8cxkhipUYsb9Hpq4rjHHQytIyc3NbXI3yM06rqxey6Pr6iGQ19EBD2n0BJIfzt5Vo T3jQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=unO5+OwTpqcdKwNk0P0czzkhYjqFhgQGJfILd9g1TMg=; fh=HeFuHcG6IktQO4a/cwjZUtGV29xawWhpXBb+OCTZ9Vg=; b=kojXDA+HDUiE4pYPeWFKoWElviUwFcQ8G4Pwxzz3CPsAbXtsdBOcHEDNR30fg9hfO0 6IdsEhOck2LDHbQBpl9dWX5fLUPOAGX1+yP4Uol1KXaOVFoKqmnf+bSQ+AeLSoptHGij ILgTGlDSDP9sRvRYKjDaJsMk6tIJnLw8gSTDYgPWNs41Ls2NXUC3T3E8fEQfg0LNivaT P6wFgDJH/I7haewBhQ42ljrN0tktUOOHUhs2tFMYRx0+qLBLIr0+xPagM8wpTIpqp11h F+ouCxM87B0/KNnstQssH+Uh+TS4UKyYA48bZVB8QUlUA5cXqC1//0/AxRtQFo+tz69Y m5/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=s6uAvr7a; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id t185-20020a6381c2000000b00578a2db484esi4305138pgd.248.2023.10.06.14.04.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Oct 2023 14:04:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=s6uAvr7a; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 3D27182CD432; Fri, 6 Oct 2023 14:04:41 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233642AbjJFVE2 (ORCPT + 18 others); Fri, 6 Oct 2023 17:04:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55272 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233639AbjJFVEZ (ORCPT ); Fri, 6 Oct 2023 17:04:25 -0400 Received: from mail-lf1-x132.google.com (mail-lf1-x132.google.com [IPv6:2a00:1450:4864:20::132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7C021C5 for ; Fri, 6 Oct 2023 14:04:22 -0700 (PDT) Received: by mail-lf1-x132.google.com with SMTP id 2adb3069b0e04-5046bf37daeso3319422e87.1 for ; Fri, 06 Oct 2023 14:04:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696626261; x=1697231061; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=unO5+OwTpqcdKwNk0P0czzkhYjqFhgQGJfILd9g1TMg=; b=s6uAvr7a0hgIYiJg/21hJU9IeiRfLD4mi/YogfnPr09c2GZram5pZ0M+nSJtcRtCoI u2p6Gtx6ZSI9mh+ekeZybLV5rc4Exi0T1FnqKuspGErecZ+BXCSoy9v9siuqBKtkxiO8 K285V3GF/QrU7rC8Rt4TFT8PeKzLq8/j7gTG60v7xxcQRZYGrf+3DMoq0s+GhjkDhn5W 4+ytbTBcggebzhgqa61mwlb4VodPZe21fpjRLqkGpOht8Vq7V1osy/IUQhcYu1vmDhKz uYEXLAH86GqBIbXi0mALaz6HAUmHTfJhIoF6oDqJy/9SsCc9JZ08KTYiNZV9k4kZsC7I 0Oew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696626261; x=1697231061; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=unO5+OwTpqcdKwNk0P0czzkhYjqFhgQGJfILd9g1TMg=; b=qVEJNlnsSmTkkedknAigmEkGiyN7tCXayOs4auT7S9LLNQ6HwbD+4Bl/zucgSwuZBo bfGaiXYz4aY92fCZ+7dhzrwNZ6f3WrbxT/rAIb9rYaCY+0487BF1TUA02ABMlo92GFCw 2hgfBCt0sfl21GixsMBVkzpVDFdfEYYqrPejS4KRiD3Tno45Ejpi/fCjosZ9sGRBq4Jm Pkdba97AfkHtP09MHuNzzG0AncOveTKuoGL6pdCKR7Fh3rVECOJxMyDjpjP2cbaidwr4 7dcUGQGQkgWDa0fBdzOSY2iyeMgu/PmevCQXu8+MK6weZVR7XobqHQtfwnhBl+SIAqSc 8dQA== X-Gm-Message-State: AOJu0YzPQgiSaLOesVwN4mw1cDW0z50Xj++WqYw2rL6wqihRWbpquvY0 74p2/yvIQ9x1iITVhmbUlvHpnyia0/6d6ouHF1s= X-Received: by 2002:a05:6512:4011:b0:501:bd6f:7c1e with SMTP id br17-20020a056512401100b00501bd6f7c1emr11091519lfb.33.1696626260738; Fri, 06 Oct 2023 14:04:20 -0700 (PDT) Received: from [127.0.1.1] ([85.235.12.238]) by smtp.gmail.com with ESMTPSA id d25-20020ac25459000000b00501ce28db76sm432993lfn.291.2023.10.06.14.04.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Oct 2023 14:04:20 -0700 (PDT) From: Linus Walleij Date: Fri, 06 Oct 2023 23:04:19 +0200 Subject: [PATCH 2/2] pinctrl: realtek: Fix some NULL dereference warnings MIME-Version: 1.0 Message-Id: <20231006-fix-realtek-warnings-v1-2-09af253312ba@linaro.org> References: <20231006-fix-realtek-warnings-v1-0-09af253312ba@linaro.org> In-Reply-To: <20231006-fix-realtek-warnings-v1-0-09af253312ba@linaro.org> To: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, Linus Walleij Cc: Tzuyi Chang X-Mailer: b4 0.12.3 X-Spam-Status: No, score=2.7 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.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 (pete.vger.email [0.0.0.0]); Fri, 06 Oct 2023 14:04:41 -0700 (PDT) X-Spam-Level: ** X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779041603930613263 X-GMAIL-MSGID: 1779041603930613263 Just inspecting the code doesn't convince me that this is a real issue, but the tools complain that it is so I will just handle it. Cc: Tzuyi Chang Link: https://lore.kernel.org/oe-kbuild-all/202309270234.aJGlDE0P-lkp@intel.com/ Signed-off-by: Linus Walleij --- drivers/pinctrl/realtek/pinctrl-rtd.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/pinctrl/realtek/pinctrl-rtd.c b/drivers/pinctrl/realtek/pinctrl-rtd.c index bafe27face80..fc27e4f61be1 100644 --- a/drivers/pinctrl/realtek/pinctrl-rtd.c +++ b/drivers/pinctrl/realtek/pinctrl-rtd.c @@ -165,7 +165,10 @@ static int rtd_pinctrl_set_one_mux(struct pinctrl_dev *pcdev, return 0; if (!mux->functions) { - dev_err(pcdev->dev, "No functions available for pin %s\n", mux->name); + if (!mux->name) + dev_err(pcdev->dev, "NULL pin has no functions\n"); + else + dev_err(pcdev->dev, "No functions available for pin %s\n", mux->name); return -ENOTSUPP; } @@ -177,6 +180,11 @@ static int rtd_pinctrl_set_one_mux(struct pinctrl_dev *pcdev, return ret; } + if (!mux->name) { + dev_err(pcdev->dev, "NULL pin provided for function %s\n", func_name); + return -EINVAL; + } + dev_err(pcdev->dev, "No function %s available for pin %s\n", func_name, mux->name); return -EINVAL;