From nobody Sun Jun 21 04:20:46 2026 Received: from out-171.mta0.migadu.com (out-171.mta0.migadu.com [91.218.175.171]) (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 7E7F3212550 for ; Tue, 7 Apr 2026 12:42:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.171 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775565728; cv=none; b=u60l28LZjejm9IMoZ6hChYvxCw1eFmllgz9srhbkG8FjwHVLVanhrJKGPcvn3uvr8ZYJKKcKfwx7NlF3hggfxn4h0b9cYwj8tpwb4cPu4o0smjOEaonTCUZTzgEvOlT8CUAUS+UFJg3QNXFYQG+/G/0y0YnpNIjuM+n9EikD0Q4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775565728; c=relaxed/simple; bh=NDvoWCNckb+HiyiJCkM6tFoovnJ9cB8RnjLLcfX2ncw=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition; b=jTBrQbb91HsyJGeKQ+pYIFqwxeVzrP4o+Wx9Go+tSr6opTE8hc6TbnnDh5shLwZmfZZoZ1M0CPpYAL3HcfwiYJ83PyqMAowUtoHYAEp4SQSLTI3+iVp9SXcPJoinSwBpyHXfMFTwQ6VvcVD+hD7u7jhKp2Gnji1LG22ELEznBUs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=d4dtHIGU; arc=none smtp.client-ip=91.218.175.171 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="d4dtHIGU" Date: Tue, 7 Apr 2026 15:41:48 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1775565724; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type; bh=HyZfw/iTSUCVIQvx8srzyoIAkvgWLMs7oNKSmxPASvQ=; b=d4dtHIGUcvUjrUmjws+FSwKwdOPI3bDmmbx3wSK2HeR3tqNiD04rwFEt9fGEctezam3YZj DGAG9WdhObGd13r6bLNkJmrS6gzA4gKTTA5J9RkUM0MyrqoR9h1Y65oBj1jgYzf4kzMkE+ 6o+RzohqvPqwgSiKPSa4JpFhAkA/zN8= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Matti Vaittinen To: Matti Vaittinen , Matti Vaittinen , Matti Vaittinen Cc: Matti Vaittinen , Linus Walleij , Bartosz Golaszewski , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, Andreas Kemnade Subject: [PATCH] gpio: handle missing regmap Message-ID: <5bfffee380863bcf24f3062e48094c8eb7b1342f.1775565381.git.mazziesaccount@gmail.com> Reply-To: Matti Vaittinen Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="3RJFuEeMfWMbPJAH" Content-Disposition: inline X-Migadu-Flow: FLOW_OUT --3RJFuEeMfWMbPJAH Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Matti Vaittinen Currently the probe does not check whether getting the regmap succeeded. This can cause crash when regmap is used, if it wasn't successfully obtained. Failing to get the regmap is unlikely, especially since this driver is expected to be kicked by the MFD driver only after registering the regmap - but it is still better to handle this gracefully. Signed-off-by: Matti Vaittinen Fixes: e7eef0bd4075 ("regulator: bd71828-regulator.c: Fix LDON-HEAD mode") --- As mentioned, this is really not likely to happen. Hence, I am not sure it needs to be backported or whether to add the Fixes tag or not. OTOH, fix is very trivial and unlikely to conflict - so maybe it's better to just backport it. --- drivers/gpio/gpio-bd72720.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpio/gpio-bd72720.c b/drivers/gpio/gpio-bd72720.c index 6549dbf4c7ad..d0f936ed80af 100644 --- a/drivers/gpio/gpio-bd72720.c +++ b/drivers/gpio/gpio-bd72720.c @@ -256,6 +256,8 @@ static int gpo_bd72720_probe(struct platform_device *pd= ev) g->dev =3D dev; g->chip.parent =3D parent; g->regmap =3D dev_get_regmap(parent, NULL); + if (!g->regmap) + return -ENODEV; =20 return devm_gpiochip_add_data(dev, &g->chip, g); } base-commit: f338e77383789c0cae23ca3d48adcc5e9e137e3c --=20 2.53.0 --3RJFuEeMfWMbPJAH Content-Type: application/pgp-signature; name=signature.asc -----BEGIN PGP SIGNATURE----- iQEzBAEBCgAdFiEEIx+f8wZb28fLKEhTeFA3/03aocUFAmnU+4YACgkQeFA3/03a ocV7+wf5Absyq1hATE2LWTDJr97R7TBrDwEjKUHaax216bbNEhadGURrbQSWeAhX Au1C9EKOtWBDngS+i/qM9S9X/ubFVoP0VrwxYrmZDll/isyZyMhM93qHrhY30pn/ x1uRiSBmnnCDyNJCcuSD7VnA8t2fIIi8HJ7go6ihon1zeulJTZBWAv5SGWmpiS6T bMZ1C+Tib9l6IWQhnV2+3/0uja0xS0Z/vO2NjpY3XTuLow8vkpqyriXGnhu8Ycyx ha0iUAEi+a8981U+P0pgCtUVQZ6qDhsAdHJQmnqqvoiXdWTZ5fih3DGloOFsarHU U7HMX+ylI4MfB5S/bXvMJ6aaffB/qQ== =1Z7C -----END PGP SIGNATURE----- --3RJFuEeMfWMbPJAH--