linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Jeff LaBundy <jeff@labundy.com>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: linux-input@vger.kernel.org,
	Michael Hennerich <michael.hennerich@analog.com>,
	Shawn Guo <shawnguo@kernel.org>,
	Sascha Hauer <s.hauer@pengutronix.de>,
	Fabio Estevam <festevam@gmail.com>,
	Laxman Dewangan <ldewangan@nvidia.com>,
	Thierry Reding <thierry.reding@gmail.com>,
	Hans de Goede <hdegoede@redhat.com>,
	Tony Lindgren <tony@atomide.com>,
	linux-kernel@vger.kernel.org, imx@lists.linux.dev,
	linux-arm-kernel@lists.infradead.org,
	linux-tegra@vger.kernel.org
Subject: Re: [PATCH 08/17] Input: iqs62x-keys - use cleanup facility for fwnodes
Date: Mon, 26 Aug 2024 17:43:34 -0500	[thread overview]
Message-ID: <Zs0FFtUKI7sZBl4r@nixie71> (raw)
In-Reply-To: <20240825051627.2848495-9-dmitry.torokhov@gmail.com>

Hi Dmitry,

On Sat, Aug 24, 2024 at 10:16:12PM -0700, Dmitry Torokhov wrote:
> Use __free(fwnode_handle) cleanup facility to ensure that references
> to acquired fwnodes are dropped at appropriate times automatically.
> 
> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

Reviewed-by: Jeff LaBundy <jeff@labundy.com>

> ---
>  drivers/input/keyboard/iqs62x-keys.c | 7 ++-----
>  1 file changed, 2 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/input/keyboard/iqs62x-keys.c b/drivers/input/keyboard/iqs62x-keys.c
> index 688d61244b5f..1315b0f0862f 100644
> --- a/drivers/input/keyboard/iqs62x-keys.c
> +++ b/drivers/input/keyboard/iqs62x-keys.c
> @@ -45,7 +45,6 @@ struct iqs62x_keys_private {
>  static int iqs62x_keys_parse_prop(struct platform_device *pdev,
>  				  struct iqs62x_keys_private *iqs62x_keys)
>  {
> -	struct fwnode_handle *child;
>  	unsigned int val;
>  	int ret, i;
>  
> @@ -68,7 +67,8 @@ static int iqs62x_keys_parse_prop(struct platform_device *pdev,
>  	}
>  
>  	for (i = 0; i < ARRAY_SIZE(iqs62x_keys->switches); i++) {
> -		child = device_get_named_child_node(&pdev->dev,
> +		struct fwnode_handle *child __free(fwnode_handle) =
> +			device_get_named_child_node(&pdev->dev,
>  						    iqs62x_switch_names[i]);
>  		if (!child)
>  			continue;
> @@ -77,7 +77,6 @@ static int iqs62x_keys_parse_prop(struct platform_device *pdev,
>  		if (ret) {
>  			dev_err(&pdev->dev, "Failed to read switch code: %d\n",
>  				ret);
> -			fwnode_handle_put(child);
>  			return ret;
>  		}
>  		iqs62x_keys->switches[i].code = val;
> @@ -91,8 +90,6 @@ static int iqs62x_keys_parse_prop(struct platform_device *pdev,
>  			iqs62x_keys->switches[i].flag = (i == IQS62X_SW_HALL_N ?
>  							 IQS62X_EVENT_HALL_N_T :
>  							 IQS62X_EVENT_HALL_S_T);
> -
> -		fwnode_handle_put(child);
>  	}
>  
>  	return 0;
> -- 
> 2.46.0.295.g3b9ea8a38a-goog
> 

Kind regards,
Jeff LaBundy


  reply	other threads:[~2024-08-26 22:45 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-25  5:16 [PATCH 00/17] Convert keyboard drivers to use new cleanup facilities Dmitry Torokhov
2024-08-25  5:16 ` [PATCH 01/17] Input: adp5589-keys - use guard notation when acquiring mutex Dmitry Torokhov
2024-08-25  5:16 ` [PATCH 02/17] Input: applespi - use guard notation when acquiring spinlock Dmitry Torokhov
2024-08-25  5:16 ` [PATCH 03/17] Input: atkbd - use guard notation when acquiring mutex Dmitry Torokhov
2024-08-25 13:12   ` Hans de Goede
2024-08-25  5:16 ` [PATCH 04/17] Input: ep93xx_keypad " Dmitry Torokhov
2024-08-25  5:16 ` [PATCH 05/17] Input: gpio-keys - switch to using cleanup functions Dmitry Torokhov
2024-08-25 13:10   ` Hans de Goede
2024-08-25  5:16 ` [PATCH 06/17] Input: imx_keypad - use guard notation when acquiring mutex Dmitry Torokhov
2024-08-25  5:16 ` [PATCH 07/17] Input: ipaq-micro-keys - use guard notation when acquiring mutex and spinlock Dmitry Torokhov
2024-08-25  5:16 ` [PATCH 08/17] Input: iqs62x-keys - use cleanup facility for fwnodes Dmitry Torokhov
2024-08-26 22:43   ` Jeff LaBundy [this message]
2024-08-25  5:16 ` [PATCH 09/17] Input: lm8323 - use guard notation when acquiring mutexes Dmitry Torokhov
2024-08-25  5:16 ` [PATCH 10/17] Input: lpc32xx-keys - use guard notation when acquiring mutex Dmitry Torokhov
2024-08-25  5:16 ` [PATCH 11/17] Input: matrix_keypad - use guard notation when acquiring spinlock Dmitry Torokhov
2024-08-25  5:16 ` [PATCH 12/17] Input: omap4-keypad - use guard notation when acquiring mutex Dmitry Torokhov
2024-08-25  5:16 ` [PATCH 13/17] Input: pmic8xxx-keypad " Dmitry Torokhov
2024-08-25  5:16 ` [PATCH 14/17] Input: pxa27x_keypad " Dmitry Torokhov
2024-08-25  5:16 ` [PATCH 15/17] Input: spear-keyboard " Dmitry Torokhov
2024-08-25  5:16 ` [PATCH 16/17] Input: st-keyscan " Dmitry Torokhov
2024-08-25  5:16 ` [PATCH 17/17] Input: tegra-kbc - use guard notation when acquiring mutex and spinlock Dmitry Torokhov
2024-08-27  9:08   ` Thierry Reding

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Zs0FFtUKI7sZBl4r@nixie71 \
    --to=jeff@labundy.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=festevam@gmail.com \
    --cc=hdegoede@redhat.com \
    --cc=imx@lists.linux.dev \
    --cc=ldewangan@nvidia.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=michael.hennerich@analog.com \
    --cc=s.hauer@pengutronix.de \
    --cc=shawnguo@kernel.org \
    --cc=thierry.reding@gmail.com \
    --cc=tony@atomide.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).