Received: by 2002:a05:7412:cfc7:b0:fc:a2b0:25d7 with SMTP id by7csp2305200rdb; Wed, 21 Feb 2024 03:42:44 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUblmgkYZvR2mUXGlUZ5QY0EO1HJIwof3qFRJkhIPk4kydnp+WP8d7DwmMxuxWINddWRR9leiG4Z6JDk79qaQz4Ns3zE/A4lg/stFXJjA== X-Google-Smtp-Source: AGHT+IG0n5m0Z/An4ghebpMRFDoGuHQjzLmFDKU8+h+nGV7hXkfSstcXkKUA0w+zE3tP7KVN3kqo X-Received: by 2002:a17:902:a516:b0:1db:51ee:8677 with SMTP id s22-20020a170902a51600b001db51ee8677mr14728032plq.59.1708515763961; Wed, 21 Feb 2024 03:42:43 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708515763; cv=pass; d=google.com; s=arc-20160816; b=Q79Hp4K9XfnG5nlzix3PXXLSoS0YxujFFnrVKeWI3Qxs2N/Z6U61X6uRsjDVhaKpOT orxHGKsbe847qn/qIlRCK8BR89O55fzRiNYGhxpu5CrCYeU7ACYoCRlAjskdRVQgMhYQ hSqYrz/cARgvJ6fjhM+SruevuuqiCZaRDY1cGh/twFKAInX4Ea8CGXbVtb/o/J/+2fGR sbfGpvIPC+S5XFZXirXyvJqqgqRBaEg+Y7kFuQT5OW7stPWXO6nWgdbVfn9sp2lqk6qA cUi+EWe+hOd7IKUOOFpb4zzRUpQhwBi8wge2Gm0WGGdBFcrk1cwhWNW3KlGHXcizoOeq 5rMQ== ARC-Message-Signature: i=2; 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:references:in-reply-to:date:cc :to:from:subject:message-id; bh=29Krn7wiHmCrqL2eMZ6IOFC1nRpg8N768ac1T4ZHQDY=; fh=QfW14qef1uygmVtHQtK5avN4TWIuxC8xicVuN0c5L9U=; b=GaiyFh6jHs0x0pekjTIktXFVNixJ7QNhawJ2Ih8pR9BJfpJ4sQi9ZsOorcoTv7AVyr 3std3NU51kWJgB+9MZKKwAfFI0nW9VRCC9/PE9ODBeJ3lEMmAKh+Rtymu0m7l5+WLeVC DYgLtQgmisx6YpHK1dXC4QREm4by3dVYi7IFJYuUxbdK4WYG1Kqa1Ltn8otO1wNRnLeV X/o7eA9QUId2UKesQ8RiZQ0b+NdMjgbebxE15P8F9Q9AGW0SnYShJMAS0g7RzH1fTU88 RhVYUzAPHURfptXrrGvz1aNELsVaLyGozs386VkwKOg+Xf5O22QCrnCvjQyuwv9LfvvH 6oWA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=pengutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-74653-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-74653-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id x18-20020a170902ea9200b001d991a0da23si7802020plb.102.2024.02.21.03.42.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Feb 2024 03:42:43 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-74653-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=pengutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-74653-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-74653-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id A84F2282A7E for ; Wed, 21 Feb 2024 11:42:43 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C496645BF6; Wed, 21 Feb 2024 11:41:18 +0000 (UTC) Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [185.203.201.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DD2B945976 for ; Wed, 21 Feb 2024 11:41:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.203.201.7 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708515678; cv=none; b=MQPBV5ea9ggnioqJA9ze1dx/qgp7fGUpWOvzWY5kCaL16G+lGz+FGbTcHsL7sbOg+OOnqQEExWKOLGmliD2ot+ArteneBKWnFzVwu5DWq1+7+qZwjIYZcyTcXCvD4hrlEa5c/k4CxXWSqdIhnmSnbK5G0gEWSn56v8MqWU5XDvc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708515678; c=relaxed/simple; bh=N88ZAVmfemoKev6jlYmIQMcDug/YAdpNBEedT/wfwl8=; h=Message-ID:Subject:From:To:Cc:Date:In-Reply-To:References: Content-Type:MIME-Version; b=MIgliugwsolEF/w3Y2kbxd8yC24kytdNsuk+aGlGPi1G8O5MYjhn7y5/IiB4WnXZVcYTg4NyyvDUhTdLDCB234FeguWBSHGzU/iUEKFOqwokaj7XonKmaYkuVEBiAO1Xvfdrwvjfb2RZx4GjLzo6IWJYHSWnltABWDfGQZPTHKk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de; spf=pass smtp.mailfrom=pengutronix.de; arc=none smtp.client-ip=185.203.201.7 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rckyI-0002lV-Sp; Wed, 21 Feb 2024 12:41:06 +0100 Received: from [2a0a:edc0:0:900:1d::4e] (helo=lupine) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rckyE-0021v1-Of; Wed, 21 Feb 2024 12:41:02 +0100 Received: from pza by lupine with local (Exim 4.96) (envelope-from ) id 1rckyE-00061g-2E; Wed, 21 Feb 2024 12:41:02 +0100 Message-ID: Subject: Re: [PATCH 05/23] gpio: nomadik: extract GPIO platform driver from drivers/pinctrl/nomadik/ From: Philipp Zabel To: Bartosz Golaszewski Cc: =?ISO-8859-1?Q?Th=E9o?= Lebrun , Linus Walleij , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Thomas Bogendoerfer , linux-gpio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mips@vger.kernel.org, Gregory CLEMENT , Vladimir Kondratiev , Thomas Petazzoni , Tawfik Bayouk Date: Wed, 21 Feb 2024 12:41:02 +0100 In-Reply-To: References: <20240214-mbly-gpio-v1-0-f88c0ccf372b@bootlin.com> <20240214-mbly-gpio-v1-5-f88c0ccf372b@bootlin.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.46.4-2 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: p.zabel@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Hi Bartosz, On Mo, 2024-02-19 at 16:33 +0100, Bartosz Golaszewski wrote: > On Thu, Feb 15, 2024 at 11:03=E2=80=AFAM Philipp Zabel wrote: > >=20 > > On Mi, 2024-02-14 at 17:23 +0100, Th=C3=A9o Lebrun wrote: > > [...] > > > diff --git a/drivers/gpio/gpio-nomadik.c b/drivers/gpio/gpio-nomadik.= c > > > new file mode 100644 > > > index 000000000000..e39477e1a58f > > > --- /dev/null > > > +++ b/drivers/gpio/gpio-nomadik.c > > > @@ -0,0 +1,660 @@ > > [...] > > > +static int nmk_gpio_probe(struct platform_device *dev) > > > +{ > > [...] > > > + ret =3D gpiochip_add_data(chip, nmk_chip); > >=20 > > Use devm_gpiochip_add_data() to cleanup on unbind, before nmk_chip goes > > away. Or make the driver un-unbindable via suppress_bind_attrs. In that > > case you could drop devm_ prefixes everywhere for consistency. > >=20 >=20 > No! Why? What about error paths in probe() where you want to undo everyth= ing? Brain fog moment. I was triggered by the mixture of devm_ and non-devm_ calls and jumped to the wrong conclusion. Yes, keeping devm_ for error cleanup is of course correct, and with suppress_bind_attrs it'd even be ok to use non-devm_ gpiochip_add_data(), as long as there can be no error return afterwards. regards Philipp