Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp970225rdb; Wed, 6 Dec 2023 05:24:28 -0800 (PST) X-Google-Smtp-Source: AGHT+IGyunxFCu3hW8UmpK+E19uRBgEXEKnZt7vzoGAFBfdexvQSTlRv8d+SvxK6CfwBwfvqfFD+ X-Received: by 2002:a05:622a:118b:b0:415:1683:9cf1 with SMTP id m11-20020a05622a118b00b0041516839cf1mr999828qtk.21.1701869067925; Wed, 06 Dec 2023 05:24:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701869067; cv=none; d=google.com; s=arc-20160816; b=zEjn6juZvwfMRm1lZwG2HjTCxEQtlyfXfZ19tb4sQsulMxuqXRly1ykyek2R7kox0M VzAT+hxGmibUiW25Takr1ePYB87Y1vCyQZ7kR6SLiA9iWKPoxBroQ9kmtpTDm9UpTwCK NjhAWzYAetyMPPeEVSBabQ9ewVOdZiDdKMHkUUGsUEZ3wXdgwgYorEOI/A9scl54ScOh GAYyTOBVQ/EBHN7tZs+iWb1kP6e1aQgtCnojYInrz9oLgDa4vUxz4CyFJ1ia+xlOsqY+ aWrXlDNBeUDL3aotEglQoVAmjsPTNnr8+bXLnYOhviBBS1EcKvXYyCYZw8iHfB0EdyLG DBFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :user-agent:content-transfer-encoding:autocrypt:references :in-reply-to:date:cc:to:from:subject:message-id; bh=G0+ijtiLHOFcFsN91kjJjtU7+UisIeaGTdWA3SCp7OE=; fh=b06vC6qxANg0+6fK7VUjNhKD3DuSk8UVsBMqb6YGd3A=; b=ZqoMsW0D6szmR5dVHHAV3xt/KLEYaYg7gIb/50cNsYDQjOj6EbfWj3CiFbFJTbEhM6 XvWcd8QwLjH2ITXntL+/Z2rc1HK/kSoA44XsUxVTisScNWOUUQTjlWN8N+OwHjL55zON x04Z8q2Gcw+jCq2R67edwbQrBfFRFSx62LqrG57+3jkERcopHLVk2TanpGFeeiP7NW7/ IYcUeI8tytQ9lyH5qoAi6EMDSQQrM/YDsdF46SjKriGY/yKlWQfGVDArv5W6nygMTLSL bXjR/yWdUfxyTe4a8RVq6VmUbSIkTwygO4gPALoRN3dtKlyeiuVYlsjdx7GYdOHjlH9m hwog== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-wireless+bounces-499-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-wireless+bounces-499-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id d8-20020ac80608000000b0041803fe8db8si12882881qth.293.2023.12.06.05.24.27 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Dec 2023 05:24:27 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless+bounces-499-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-wireless+bounces-499-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-wireless+bounces-499-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 6CF311C209DE for ; Wed, 6 Dec 2023 13:24:27 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 688B7381AB; Wed, 6 Dec 2023 13:24:23 +0000 (UTC) X-Original-To: linux-wireless@vger.kernel.org Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4883790 for ; Wed, 6 Dec 2023 05:24:20 -0800 (PST) Received: from ptz.office.stw.pengutronix.de ([2a0a:edc0:0:900:1d::77] helo=[IPv6:::1]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rArsv-0002sd-JQ; Wed, 06 Dec 2023 14:24:17 +0100 Message-ID: <6e3049e37b00e2e5a5f02bff7b75d6c9282973b5.camel@pengutronix.de> Subject: Re: [PATCH] net: rfkill: gpio: set GPIO direction From: Rouven Czerwinski To: Johannes Berg , Josua Mayer , linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Cc: stable@vger.kernel.org, Eric Dumazet , kernel@pengutronix.de, Jakub Kicinski , Paolo Abeni , "David S. Miller" Date: Wed, 06 Dec 2023 14:24:16 +0100 In-Reply-To: References: <20231206131336.3099727-1-r.czerwinski@pengutronix.de> Autocrypt: addr=r.czerwinski@pengutronix.de; prefer-encrypt=mutual; keydata=mQINBFgRuiYBEACrEIZN2swFJIO6XOEOcEb8/KNXmIvhG9SwHJIf+XOV0c5nbHnlu6NFlesPpxJr5NnLs3ws2WPE6xu7fY9EQhXMxyKQxEK186zyGxb1g02Y1yhlF+ibYqjlJoKbDJIpIHHMkLoLRZIAXtvLxJvWu4NFUMn/GYogfWA9Dvvem6Qxy+NeY6xgUSWJvrWpFXTBluuayclYZnoGoKSdcEBwhdSLzy+t24WMXrXe4lZB9/grD2VRFu6svWSsnJZAOy7CRlr75ZNzOQbhVXliv5Uce9UmhwHOfuBJH2qLJejm8f4NEX8npYtj7+E8s7+27DIPUxmN7pYt3I4TZH3WajO+Y67jsC2cOPTg5jLd8aXD2jDufnwmbF+SyaGvvBn+Recu5iCTW4BphPto2pYLlLkYzZ1b7T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Gq/J0YC+/5WJrOljVx3Wb9kC0MKxl/Dl1alpi1Ks+qjTreymhrNa6u4BI0DgNQ9CiIGyNZRGEbHnENCtthFs3o0LpCrG9UdGqtQH9fp9u/VquwKU1ZXJpzZqmnfC/TYcaMl+ebkNcl0CbnKxdW3Q1C32irJybcsQa0Fe1GzAUvfLMI2awGPYLxIS0UT/bTsDmhORZiRniR8YKvANBl25yzL8mWM7kZWvr29Po394o36q5gMgG4frxTnIUBexv5OVPOZVBxYceRM09dDYBXCUKLplNAva9RO5intWDszxikEOuZ6uFBy1kGFNITN231y2wI5AmNApXX39jQMJDyrgzgIAvhcVMSLnQwIbGSiQ7dSt1mpZprJ8dVsTJoJOS/IiuACEEWVloEeUdNJs Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.50.1 Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-SA-Exim-Connect-IP: 2a0a:edc0:0:900:1d::77 X-SA-Exim-Mail-From: r.czerwinski@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-wireless@vger.kernel.org Hi Johannes, On Wed, 2023-12-06 at 14:16 +0100, Johannes Berg wrote: > On Wed, 2023-12-06 at 14:13 +0100, Rouven Czerwinski wrote: > >=20 > > +++ b/net/rfkill/rfkill-gpio.c > > @@ -126,6 +126,16 @@ static int rfkill_gpio_probe(struct > > platform_device *pdev) > > =C2=A0 return -EINVAL; > > =C2=A0 } > > =C2=A0 > > + if (rfkill->reset_gpio) > > + ret =3D gpiod_direction_output(rfkill->reset_gpio, > > true); > > + if (ret) > > + return ret; > > + > > + if (rfkill->shutdown_gpio) > > + ret =3D gpiod_direction_output(rfkill- > > >shutdown_gpio, true); > > + if (ret) > > + return ret; > >=20 >=20 > 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. Thanks for the review, you are totally right, I didn't look at the ret initialization. I moved it inside the if for v2. Thanks, Rouven