From patchwork Sat Nov 18 12:42:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 13460023 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 4E49AC2BB3F for ; Sat, 18 Nov 2023 12:43:56 +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:References:In-Reply-To: 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: List-Owner; bh=9g9l1zTFW5q1e9FWcFtvVSrO6gvSdIg3xu06qnjX3HU=; b=TTHlALifE5E0Ap BgPvJWYyb1L1uTxv+nymSE+dzD5skijxOq2bc/pwtrK6mMc0Pewh4groPGlV7KFpA+4aXYC0gygjy xLF/rt4XFO7n8PS/1+bp7aLJKpCXYeK7xdtToW2b1hRZETXhwVlvZ0K9Fb2UTfmvqq6zz3JtO0hAH SasIzJ1k2ErihZp5MP0AvXAj4i5Alibo9NNOEVP4PxfEW2iqFNfZPr0Ajx45CgyDCCVX8acG8RTJY 6DfkjqbrexVfggTfG3xaCKuiXTFpKnDujdUS7RIoy/JAXS6G2pmUcohOl3yaf0QNaEIbe2xZn0IBV lrkOY2Q7+1KtAz7nu6ig==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1r4KfU-008UFP-2s; Sat, 18 Nov 2023 12:43:24 +0000 Received: from mout.gmx.net ([212.227.15.19]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1r4KfQ-008UE3-29 for linux-arm-kernel@lists.infradead.org; Sat, 18 Nov 2023 12:43:23 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=s31663417; t=1700311390; x=1700916190; i=wahrenst@gmx.net; bh=HR6koxbLHfU1PLH0ktzrr5zUB6pdF380Odvqsc1xiIM=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To: References; b=ShYQcOd4tpfW3XLxvVlVBjDyYnX5dK/frOoTIAqRpxzULLYyrrPycc6wNBMjlwJH P/dvXPNLL6rgdiPf3q6Cp4CQuxbwAMJXM64+Gx9F8Phxy09ZhG1p0wKHK9nqV7fc9 B82l2TS13h3JnT3ZiqHYqCxfCvbB9zM2o+2wnHN6xDbbiDhUiVC7mTFaqWtpxah/3 93m6b/rZxOj+UTmFQUh9GV4S7EbWjM2e1MY9dRPxIfpCERTLK1rSvDPcLhfh76A2H IAUb8zSX9SW5YS9aEOyD1zR4XTTa6U786JH3dHo2gmNRQfALi+nhWl2f4a3xOXViY XAJiJxMJFEF5FEFXtQ== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from stefanw-SCHENKER ([37.4.248.43]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MplXz-1rgvbf20WD-00qEDd; Sat, 18 Nov 2023 13:43:10 +0100 From: Stefan Wahren To: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Florian Fainelli , Pavel Machek , Lee Jones Cc: bcm-kernel-feedback-list@broadcom.com, Andy Shevchenko , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-leds@vger.kernel.org, Stefan Wahren Subject: [PATCH V2 1/2] leds: gpio: Add kernel log if devm_fwnode_gpiod_get fails Date: Sat, 18 Nov 2023 13:42:51 +0100 Message-Id: <20231118124252.14838-2-wahrenst@gmx.net> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231118124252.14838-1-wahrenst@gmx.net> References: <20231118124252.14838-1-wahrenst@gmx.net> MIME-Version: 1.0 X-Provags-ID: V03:K1:q0GAkZRr/Y8I8XzOn+mDTl/H/sY92WAqSgmUYSEt5pmAX/cvP3N uEMbRNS3dZUv8ILqHj+aB8aAQJ78G0421D8rJ1AUBascm8GEneQgqdsy+7VUbW5K8kI+Fe3 5loHFX7J08vuKaDa62IK8j95nIleUXZQ+aMbuIQV8t93fMnLpxCuahH8rqpHyrW0FtYtACl UOgnquNua4NeHe6Y0F88Q== UI-OutboundReport: notjunk:1;M01:P0:Cj71fqjZ0iU=;ka7CUlJQN91shKmH2E5i+lXDr5M 1+MPu2OWcXGNoSVMfZT/h1zAV5K/mSH6rCvzhiiQ5Wtyt31YFdjW4mMg7ccYFdQ3SzOdSH9/C ySKdj1uJjxwFONk3c22TgJ7inbY5tv+i2Sgv4AJQEeg7eQ4I3sSGQ3/jgZmqLeMHXxMQn59Pg ekOkSX5ayo+50WvR4Y3mqAjyouVjAQPGJlHh2mm1jCRsgKVV2cbzGkwRaOF1fL9AwBNBVnusX WeOaWsxmhC3JxAkyNRuwXbUMr8nNrvplFE/pfkEuS4kMO8sv2Vm0aQR4dh0LLi22J8AcpoULw Pz4i/SrP/kof4J7NijxgekbsjUTYNlD6QtzjaVg48R6TLUb2ELoqqBB84PZd45jJTnIdQrLUv Dd8iQ6oo9PgRsD0RWWoe2I2O/2HZphmTY2NfPp5hz0060ac7uV3kuceH8DaGOSRU2JgBZ8AYN cVqAn90SFm5GogFdoBCHMDk4SwPa2I/3CXC96KiHC8F8RFE29/8MSuk5eSj/p9a8s09lqNNxu 4q1csLhhltcKyi+laC5Mm39T/rN92JaOPA9r9aWW5E8L3Q1B1RUiRQ38GdjVxjeGhDuakLE61 ky/ZD9Ox71FlJ2QxZ9JLKrW054ylujJ4zsruiLYDxGPl3nscWgGq0oHKZEzW6RoSijiJOJgUo vJkkyHa2Yvut1xkTrvWDNqa2fpGu+Gx8boVw/8d5dl2eVWonoO9abSH6Nna3OGUna1b8lZt+b 15Ldxm3XvVBsSp7ztvsBCNarozVQWhthfyC0s8Wbgm+tT1DQitLoBhjCP9zOu21lBf2bGy+Wj wm1Rjc5ZsZ3Z2IoKOAvliWP5ldyWB16Tv07VFCIeRnYyYdzD82vUEnMEiwRPhYIVG6xoeuLPN ok74Oe8t6qs/4lbh+BAqWobx11rhR3ymOa9r3N1ACxPqu+dCODVdVoZhwEzcF4T8q0NbQWvwq le5uZSVhkcjg7lQhIcFEuG955i4= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231118_044321_340244_BA2AD62A X-CRM114-Status: GOOD ( 10.72 ) 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 In case leds-gpio fails to get the GPIO from the DT (e.g. the GPIO is already requested) the driver doesn't provide any helpful error log: leds-gpio: probe of leds failed with error -16 So add a new error log in case devm_fwnode_gpiod_get() fails. Signed-off-by: Stefan Wahren --- drivers/leds/leds-gpio.c | 2 ++ 1 file changed, 2 insertions(+) -- 2.34.1 diff --git a/drivers/leds/leds-gpio.c b/drivers/leds/leds-gpio.c index 710c319ad312..0159cedffa9e 100644 --- a/drivers/leds/leds-gpio.c +++ b/drivers/leds/leds-gpio.c @@ -172,6 +172,8 @@ static struct gpio_leds_priv *gpio_leds_create(struct device *dev) led.gpiod = devm_fwnode_gpiod_get(dev, child, NULL, GPIOD_ASIS, NULL); if (IS_ERR(led.gpiod)) { + dev_err_probe(dev, PTR_ERR(led.gpiod), "Failed to get gpio '%pfw'\n", + child); fwnode_handle_put(child); return ERR_CAST(led.gpiod); }