From patchwork Thu Dec 19 09:39:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luca Ceresoli X-Patchwork-Id: 852164 Received: from relay7-d.mail.gandi.net (relay7-d.mail.gandi.net [217.70.183.200]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DC3B41FCCFF; Thu, 19 Dec 2024 09:40:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.200 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734601205; cv=none; b=uM/WuJSSBrZfTErR3QKMPFF6ZyOO6vtU147igOQsEO0THCFRIVitqP2L79O//WBTGXkVroZVEESgGRsYBnwDgxYdhH65ZTc/JNI4RM3TaturyOwjwzX0u4solqtqAy/gLI3dxMHcEXZ436MEkcuJV0KVN9Pb5fpYs6EU1ohgbKg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734601205; c=relaxed/simple; bh=asoMtNr/7DDL+ZS1NzT0fU5ntAUMb/bchJkHSjjqXcc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:To:Cc; b=kySr533gQ/zRwSY61Nv1rYRSdqNoR4oT2jV60bwDQ09ZIDdVAH94FBf0M8llRgSit+WjogXP4aFKByH+O/HuhObMVTf2SKPEckq0xQUALut/rswG4oNj03+AfhfkIdZx95xOee9x3RKtbqiIe4gHFmXo+iQGtHlt1IxSc2rqYT0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=QKgmfrK4; arc=none smtp.client-ip=217.70.183.200 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="QKgmfrK4" Received: by mail.gandi.net (Postfix) with ESMTPSA id 3912020003; Thu, 19 Dec 2024 09:39:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1734601194; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Rt3bGd+gANsuXeKES7jxLUhMTlz/ejc4AkMBDKGVYGQ=; b=QKgmfrK4w2mjYEPybmwCQyRb+8EIbfawwFbyKCeQ4LgCR9L8OIdvbluz1fA4gTZC6rMOhd 0tHZ9vRlOX5UFOM/GEH7OJXKa/5Gy1yNMQX4ZwUncAinJZ+RLpQnrsgaP+fkLa4InMVQKz CWVB5hINoei6CY8P47Z5v9V1QzC2iJP3yUJR9iNtCGgvpOkbe6tSgotJqjEXNBjyaQcF4e zw920XluaJzY8E2RAPhX12Qi87+mXtmMWa8YKkH/vWwSUsvPTGYj+GlQ8bAiv3pGzon2GF P+nsxg1tKMzuZacarZiIHO96NEVsvwV1Thhme6B37erCSuYtrbSNSnR2Bma7sA== From: Luca Ceresoli Date: Thu, 19 Dec 2024 10:39:46 +0100 Subject: [PATCH] gpio: pca953x: log an error when failing to get the reset GPIO Precedence: bulk X-Mailing-List: linux-gpio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20241219-pca953x-log-no-reset-gpio-v1-1-9aa7bcc45ead@bootlin.com> X-B4-Tracking: v=1; b=H4sIAOHpY2cC/x3MywqAIBBA0V+JWTfgowf2K9EibLKBUNGIQPr3p OVZ3FsgU2LKMDUFEt2cOfgK2TZgj9U7Qt6qQQnVSSUNRruaXj94Boc+YKJMF7rIAfd+FIOwRms 9Qu1jop2f/z0v7/sBuHNFx2sAAAA= X-Change-ID: 20241219-pca953x-log-no-reset-gpio-f57060c93337 To: Linus Walleij , Bartosz Golaszewski Cc: Thomas Petazzoni , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, Luca Ceresoli X-Mailer: b4 0.14.2 X-GND-Sasl: luca.ceresoli@bootlin.com When the dirver fails getting this GPIO, it fails silently. Log an error message to make debugging a lot easier by just reading dmesg. Signed-off-by: Luca Ceresoli --- drivers/gpio/gpio-pca953x.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- base-commit: 78d4f34e2115b517bcbfe7ec0d018bbbb6f9b0b8 change-id: 20241219-pca953x-log-no-reset-gpio-f57060c93337 Best regards, diff --git a/drivers/gpio/gpio-pca953x.c b/drivers/gpio/gpio-pca953x.c index 272febc3230e90baf370811f498383b9fb12cc6f..be4c9981ebc404ad5c1e1b0ba9f9f948122de462 100644 --- a/drivers/gpio/gpio-pca953x.c +++ b/drivers/gpio/gpio-pca953x.c @@ -1088,7 +1088,8 @@ static int pca953x_probe(struct i2c_client *client) */ reset_gpio = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_LOW); if (IS_ERR(reset_gpio)) - return PTR_ERR(reset_gpio); + return dev_err_probe(dev, PTR_ERR(reset_gpio), + "Failed to get reset gpio\n"); } chip->client = client;