From patchwork Thu Nov 30 09:57:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Stein X-Patchwork-Id: 13474192 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9867FC4167B for ; Thu, 30 Nov 2023 09:58:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=a4wdxDtL5XCRT01JNIU3hyB3I3kujUAXw8vlXvTR7eA=; b=tm+MbDwrbP8ij0 pIVdGIKIuDcoY5UetYrSV31J4Cr1Hlrj3fG+opFuNW4KQ11zI7EbqH8CmohCCEYPbPMw1vR31IBQ5 ZYndAIvCQk1q3vv8OL76avPjBIov3rBa7S+mQQO+mYh4oqgToNF4mi8r6Qi29AKxml4iXVbfOspe3 fo+zRlL/782wO4gEXTpaM6fs4abpiyn+VL5i8hpFe4OyBhulNsDJQ/jeUs0RyfoeR8zRd7i3x9OwS H22OUFbtwd+GxWgXXqYJM7ngqk/UR3vhPA1hX+/k80dkn42ddHk58luzyvLom2q5dInTr8Dg0n7QY lUqbIa845pXirB+x90Qg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1r8dny-00ANPz-27; Thu, 30 Nov 2023 09:57:58 +0000 Received: from mx1.tq-group.com ([93.104.207.81]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1r8dnw-00ANOy-0p for linux-arm-kernel@lists.infradead.org; Thu, 30 Nov 2023 09:57:57 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tq-group.com; i=@tq-group.com; q=dns/txt; s=key1; t=1701338276; x=1732874276; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=l2YmISjzorPYeE/jsxQPle8Nr81ohOrF30/kQc+QbxI=; b=N3Ibd4cjdFQYSfmhRZSdIkAGnuM8HJ09tv2oB3ky9/6eNTaKLUCRWbR/ 6rgqgfecxCXBK0iFhiK4j9g6+1rkVU3Lrgts70JNEoNj5B2Y4ltZLrfor FZDYUqMms5aU1SWdo4mmYZzUh9Z4VfUedPiMiKAHBT3UK5OH7bA3tIfzf H8zW4zZH0W4xdy8iQwJgD2q12/5nZEgwYD0WVKjQaCmcmY3YTS0FqOSoN FvZ6UzsZo8MdksbdAZoeVX2EwqjQtdROI2c3eBq0Hm33SIRuDEQk/tNgo azh1yFBmrNTN7WW1fy5Maz04XXWXZYph4Hu73OkYliDtwmhbaRpoMyWbT A==; X-IronPort-AV: E=Sophos;i="6.04,237,1695679200"; d="scan'208";a="34256378" Received: from vtuxmail01.tq-net.de ([10.115.0.20]) by mx1.tq-group.com with ESMTP; 30 Nov 2023 10:57:54 +0100 Received: from steina-w.tq-net.de (steina-w.tq-net.de [10.123.53.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by vtuxmail01.tq-net.de (Postfix) with ESMTPSA id 14E62280075; Thu, 30 Nov 2023 10:57:54 +0100 (CET) From: Alexander Stein To: Oleksij Rempel , Andi Shyti , Shawn Guo , Sascha Hauer , Fabio Estevam Cc: Alexander Stein , Pengutronix Kernel Team , NXP Linux Team , linux-i2c@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 1/1] i2c: imx: Make SDA actually optional for bus recovering Date: Thu, 30 Nov 2023 10:57:51 +0100 Message-Id: <20231130095751.65773-1-alexander.stein@ew.tq-group.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231130_015756_673092_415BA757 X-CRM114-Status: GOOD ( 11.76 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Both i2c_generic_scl_recovery() and the debug output indicate that SDA is purely optional for bus recovery. But devm_gpiod_get() never returns NULL making it mandatory. Fix this my calling devm_gpiod_get_optional instead. Signed-off-by: Alexander Stein Reviewed-by: Andi Shyti Reviewed-by: Oleksij Rempel Acked-by: Oleksij Rempel --- drivers/i2c/busses/i2c-imx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/i2c/busses/i2c-imx.c b/drivers/i2c/busses/i2c-imx.c index 1775a79aeba2a..88a053987403c 100644 --- a/drivers/i2c/busses/i2c-imx.c +++ b/drivers/i2c/busses/i2c-imx.c @@ -1401,7 +1401,7 @@ static int i2c_imx_init_recovery_info(struct imx_i2c_struct *i2c_imx, PINCTRL_STATE_DEFAULT); i2c_imx->pinctrl_pins_gpio = pinctrl_lookup_state(i2c_imx->pinctrl, "gpio"); - rinfo->sda_gpiod = devm_gpiod_get(&pdev->dev, "sda", GPIOD_IN); + rinfo->sda_gpiod = devm_gpiod_get_optional(&pdev->dev, "sda", GPIOD_IN); rinfo->scl_gpiod = devm_gpiod_get(&pdev->dev, "scl", GPIOD_OUT_HIGH_OPEN_DRAIN); if (PTR_ERR(rinfo->sda_gpiod) == -EPROBE_DEFER ||