From mboxrd@z Thu Jan 1 00:00:00 1970 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8DBEDC4332F for ; Mon, 6 Nov 2023 11:19:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230018AbjKFLTb (ORCPT ); Mon, 6 Nov 2023 06:19:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49966 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229583AbjKFLTb (ORCPT ); Mon, 6 Nov 2023 06:19:31 -0500 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C764FB6; Mon, 6 Nov 2023 03:19:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1699269568; x=1730805568; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=UZ2mllwSITLMwigLdMMHTXlcJTSw0v3IiGJDOlJ2u+Y=; b=cubp9twLVqAxNpl/F+C5/a0vGXxUQc/jCZ87Bau8HV/DZ1YDUumTDWjq IEnYptHgPTAaSW3PcIem+V0ZmlHvjWUnuCoHgcGZlFqP8s6VM+Y3LBTXu edZOCxQEJZ+IxnuegaWJgiuFFDtcAIFMwquELuZp2K3IHq+CNS7oXzxYA vF0rBKFdeQMsUS0+VH/LdSrYY3XVY3d7d09bBOCOoJ8vbZ1/nF3yu3gxe whuy21sI0S0aIHD9U1+jDWwqEr/LoksYZvMRjJnpLfce2Wl4O1WOiwTJH e7cGTioKKtg18pvDPp4ujXoNmyhVDWK++IK9M4c3uWJv98XXbYEe0Z2tU Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10885"; a="369461450" X-IronPort-AV: E=Sophos;i="6.03,281,1694761200"; d="scan'208";a="369461450" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Nov 2023 03:19:28 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10885"; a="1009491417" X-IronPort-AV: E=Sophos;i="6.03,281,1694761200"; d="scan'208";a="1009491417" Received: from smile.fi.intel.com ([10.237.72.54]) by fmsmga006.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Nov 2023 03:19:25 -0800 Received: from andy by smile.fi.intel.com with local (Exim 4.97-RC3) (envelope-from ) id 1qzxda-0000000Blvc-10qR; Mon, 06 Nov 2023 13:19:22 +0200 Date: Mon, 6 Nov 2023 13:19:21 +0200 From: Andy Shevchenko To: Stefan Wahren Cc: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Florian Fainelli , Pavel Machek , Lee Jones , bcm-kernel-feedback-list@broadcom.com, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-leds@vger.kernel.org Subject: Re: [PATCH 1/2] leds: gpio: Add kernel log if devm_fwnode_gpiod_get fails Message-ID: References: <20231105154940.97688-1-wahrenst@gmx.net> <20231105154940.97688-2-wahrenst@gmx.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231105154940.97688-2-wahrenst@gmx.net> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Precedence: bulk List-ID: X-Mailing-List: linux-leds@vger.kernel.org On Sun, Nov 05, 2023 at 04:49:39PM +0100, Stefan Wahren wrote: > 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. ... > led.gpiod = devm_fwnode_gpiod_get(dev, child, NULL, GPIOD_ASIS, > NULL); > if (IS_ERR(led.gpiod)) { > + dev_err(dev, "Failed to get gpio '%pfw': %ld\n", > + child, PTR_ERR(led.gpiod)); Perhaps %pe ? > fwnode_handle_put(child); > return ERR_CAST(led.gpiod); > } -- With Best Regards, Andy Shevchenko From mboxrd@z Thu Jan 1 00:00:00 1970 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 C285BC4332F for ; Mon, 6 Nov 2023 11:20:03 +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:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Sh3WK8/P/SQ+ekyaSonSU9CZtgd3ky7t777svtS8zo8=; b=mEyFkM3wggHFfT m4VgnwZvAjWh1NJILs0njRbrluv8ALjTBHBDndv4xjdaZI3Q1/j/kCYa5KBQ0gLEn/gYtJ9U4RtVT m2T6kCDXW9GdJ8gnEUahEBN6dH5FJw5iTeipEJTKb06KFCREsUS8fVkQNPlx8KlNFDto6EM3GzTuy 4Cewf5/2TRvUQqID13jIUJNyjWxrJLZSkQdOOxXZ9SC0UgoyefCOgXAJBWbJ/XpFRLClJDSGKN/Mj eV2jSTyISfdVbGC8rFsAA2/U/iwV1v30dj25pGOQbz3BRBJ1hQnUfZvROsX8K95MNwtLSAAUBG5e5 J2uaX/eihBRM4ukqOQtg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qzxdn-00GN04-32; Mon, 06 Nov 2023 11:19:35 +0000 Received: from mgamail.intel.com ([192.55.52.151]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qzxdl-00GMzd-1S for linux-arm-kernel@lists.infradead.org; Mon, 06 Nov 2023 11:19:34 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1699269573; x=1730805573; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=UZ2mllwSITLMwigLdMMHTXlcJTSw0v3IiGJDOlJ2u+Y=; b=THsafRNoIj3n4P1BOM5e+nIQTmnyNVluQ3C6CpuSwdS+Rc/Q2UPa7ewO Wc4W2BpGL5AqMaRC+oy3MwdsnIDX1K0nwUw5uYtpvs0XBzZ2+xrdGQhhH wBE0R9obeIWF3sGUR4Xaa7EJxEKBulBQbXotjVVSN5ynl9vGfJ411sr+1 7Y93P6wO19e7yK8avZhx4B46l8hM7K84OtxypjupQ7a5KkOfoq+twQKoI nLW0Y0x/Wycc52yQbdDy7SsGTCgBnK5QT6TyeTO+Rg4EIctPcC10jJUO1 pXz8YPzLKNJxsybomBSU2XYCBp7N6JSHD11PBXthFKwlxiHFo7mF59x6m A==; X-IronPort-AV: E=McAfee;i="6600,9927,10885"; a="369461452" X-IronPort-AV: E=Sophos;i="6.03,281,1694761200"; d="scan'208";a="369461452" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Nov 2023 03:19:28 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10885"; a="1009491417" X-IronPort-AV: E=Sophos;i="6.03,281,1694761200"; d="scan'208";a="1009491417" Received: from smile.fi.intel.com ([10.237.72.54]) by fmsmga006.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Nov 2023 03:19:25 -0800 Received: from andy by smile.fi.intel.com with local (Exim 4.97-RC3) (envelope-from ) id 1qzxda-0000000Blvc-10qR; Mon, 06 Nov 2023 13:19:22 +0200 Date: Mon, 6 Nov 2023 13:19:21 +0200 From: Andy Shevchenko To: Stefan Wahren Cc: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Florian Fainelli , Pavel Machek , Lee Jones , bcm-kernel-feedback-list@broadcom.com, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-leds@vger.kernel.org Subject: Re: [PATCH 1/2] leds: gpio: Add kernel log if devm_fwnode_gpiod_get fails Message-ID: References: <20231105154940.97688-1-wahrenst@gmx.net> <20231105154940.97688-2-wahrenst@gmx.net> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20231105154940.97688-2-wahrenst@gmx.net> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231106_031933_503630_E4209771 X-CRM114-Status: GOOD ( 13.29 ) 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Sun, Nov 05, 2023 at 04:49:39PM +0100, Stefan Wahren wrote: > 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. ... > led.gpiod = devm_fwnode_gpiod_get(dev, child, NULL, GPIOD_ASIS, > NULL); > if (IS_ERR(led.gpiod)) { > + dev_err(dev, "Failed to get gpio '%pfw': %ld\n", > + child, PTR_ERR(led.gpiod)); Perhaps %pe ? > fwnode_handle_put(child); > return ERR_CAST(led.gpiod); > } -- With Best Regards, Andy Shevchenko _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel