All of lore.kernel.org
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: Rouven Czerwinski <r.czerwinski@pengutronix.de>,
	Josua Mayer <josua@solid-run.com>,
	linux-wireless@vger.kernel.org, netdev@vger.kernel.org,
	 linux-kernel@vger.kernel.org
Cc: kernel@pengutronix.de, stable@vger.kernel.org,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>
Subject: Re: [PATCH] net: rfkill: gpio: set GPIO direction
Date: Wed, 06 Dec 2023 14:16:15 +0100	[thread overview]
Message-ID: <cd25fd96fa391d3c8a5811d995d166cbb0b0efe5.camel@sipsolutions.net> (raw)
In-Reply-To: <20231206131336.3099727-1-r.czerwinski@pengutronix.de>

On Wed, 2023-12-06 at 14:13 +0100, Rouven Czerwinski wrote:
> 
> +++ b/net/rfkill/rfkill-gpio.c
> @@ -126,6 +126,16 @@ static int rfkill_gpio_probe(struct platform_device *pdev)
>  		return -EINVAL;
>  	}
>  
> +	if (rfkill->reset_gpio)
> +		ret = gpiod_direction_output(rfkill->reset_gpio, true);
> +	if (ret)
> +		return ret;
> +
> +	if (rfkill->shutdown_gpio)
> +		ret = gpiod_direction_output(rfkill->shutdown_gpio, true);
> +	if (ret)
> +		return ret;
> 

That's weird, you need ret to be inside the if. It's even entirely
uninitialized if you don't have ACPI, if you don't have reset/shutdown.

johannes

  reply	other threads:[~2023-12-06 13:16 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-06 13:13 [PATCH] net: rfkill: gpio: set GPIO direction Rouven Czerwinski
2023-12-06 13:16 ` Johannes Berg [this message]
2023-12-06 13:24   ` Rouven Czerwinski
2023-12-06 14:35     ` Philipp Zabel
2023-12-06 21:41 ` kernel test robot
2023-12-07  7:58 ` [PATCH v2] " Rouven Czerwinski
2023-12-12  9:54   ` Simon Horman

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=cd25fd96fa391d3c8a5811d995d166cbb0b0efe5.camel@sipsolutions.net \
    --to=johannes@sipsolutions.net \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=josua@solid-run.com \
    --cc=kernel@pengutronix.de \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=r.czerwinski@pengutronix.de \
    --cc=stable@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.