{"id":2215820,"url":"http://patchwork.ozlabs.org/api/patches/2215820/?format=json","web_url":"http://patchwork.ozlabs.org/project/linux-gpio/patch/20260325-gpio-shared-deadlock-v1-1-e4e7a5319e95@oss.qualcomm.com/","project":{"id":42,"url":"http://patchwork.ozlabs.org/api/projects/42/?format=json","name":"Linux GPIO development","link_name":"linux-gpio","list_id":"linux-gpio.vger.kernel.org","list_email":"linux-gpio@vger.kernel.org","web_url":"","scm_url":"","webscm_url":"","list_archive_url":"","list_archive_url_format":"","commit_url_format":""},"msgid":"<20260325-gpio-shared-deadlock-v1-1-e4e7a5319e95@oss.qualcomm.com>","list_archive_url":null,"date":"2026-03-25T11:06:38","name":"gpio: shared: shorten the critical section in gpiochip_setup_shared()","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"fab767b71126ad0f87229c4165e44937dd30dc9d","submitter":{"id":92196,"url":"http://patchwork.ozlabs.org/api/people/92196/?format=json","name":"Bartosz Golaszewski","email":"bartosz.golaszewski@oss.qualcomm.com"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/linux-gpio/patch/20260325-gpio-shared-deadlock-v1-1-e4e7a5319e95@oss.qualcomm.com/mbox/","series":[{"id":497424,"url":"http://patchwork.ozlabs.org/api/series/497424/?format=json","web_url":"http://patchwork.ozlabs.org/project/linux-gpio/list/?series=497424","date":"2026-03-25T11:06:38","name":"gpio: shared: shorten the critical section in gpiochip_setup_shared()","version":1,"mbox":"http://patchwork.ozlabs.org/series/497424/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/2215820/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/2215820/checks/","tags":{},"related":[],"headers":{"Return-Path":"\n <linux-gpio+bounces-34125-incoming=patchwork.ozlabs.org@vger.kernel.org>","X-Original-To":["incoming@patchwork.ozlabs.org","linux-gpio@vger.kernel.org"],"Delivered-To":"patchwork-incoming@legolas.ozlabs.org","Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=qualcomm.com header.i=@qualcomm.com header.a=rsa-sha256\n header.s=qcppdkim1 header.b=UG4w89mZ;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com\n header.a=rsa-sha256 header.s=google header.b=SqU801np;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=172.234.253.10; helo=sea.lore.kernel.org;\n envelope-from=linux-gpio+bounces-34125-incoming=patchwork.ozlabs.org@vger.kernel.org;\n receiver=patchwork.ozlabs.org)","smtp.subspace.kernel.org;\n\tdkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com\n header.b=\"UG4w89mZ\";\n\tdkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com\n header.b=\"SqU801np\"","smtp.subspace.kernel.org;\n arc=none smtp.client-ip=205.220.180.131","smtp.subspace.kernel.org;\n dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com","smtp.subspace.kernel.org;\n spf=pass smtp.mailfrom=oss.qualcomm.com"],"Received":["from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fgkph4Y3Yz1y1K\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 25 Mar 2026 22:15:24 +1100 (AEDT)","from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby sea.lore.kernel.org (Postfix) with ESMTP id F378130416EC\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 25 Mar 2026 11:06:52 +0000 (UTC)","from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id B9D733C8720;\n\tWed, 25 Mar 2026 11:06:51 +0000 (UTC)","from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com\n [205.220.180.131])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby smtp.subspace.kernel.org (Postfix) with ESMTPS id 3CC943C3BFE\n\tfor <linux-gpio@vger.kernel.org>; Wed, 25 Mar 2026 11:06:50 +0000 (UTC)","from pps.filterd (m0279873.ppops.net [127.0.0.1])\n\tby mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id\n 62P7kD6a2276760\n\tfor <linux-gpio@vger.kernel.org>; Wed, 25 Mar 2026 11:06:49 GMT","from mail-qt1-f197.google.com (mail-qt1-f197.google.com\n [209.85.160.197])\n\tby mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4d40ratttc-1\n\t(version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT)\n\tfor <linux-gpio@vger.kernel.org>; Wed, 25 Mar 2026 11:06:49 +0000 (GMT)","by mail-qt1-f197.google.com with SMTP id\n d75a77b69052e-50b52a2d70cso158878351cf.3\n        for <linux-gpio@vger.kernel.org>;\n Wed, 25 Mar 2026 04:06:49 -0700 (PDT)","from brgl-qcom.local ([2a01:cb1d:dc:7e00:7116:95af:5a1a:58c1])\n        by smtp.gmail.com with ESMTPSA id\n 5b1f17b1804b1-487172f916asm26526415e9.5.2026.03.25.04.06.46\n        (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n        Wed, 25 Mar 2026 04:06:47 -0700 (PDT)"],"ARC-Seal":"i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1774436811; cv=none;\n b=QBSNBoYrmLAGkU6+G6HOGxg3VTjftjlQmXgirxEmpnK7AIIhRmiNj1nv4ohC962kivift3gfYhrqA0t1Hl3O622FAUW5C4u7nF1lWmKr7j9Dw/crPmwA0AE43ih4l+UEyuYE2o9hjbdOsGHFQB6cmcryamlHYW+CYNS6tIIAxAs=","ARC-Message-Signature":"i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1774436811; c=relaxed/simple;\n\tbh=+lOYzTnO906o+OM4BjFEcqsuBb9EgOPvHQcpAdhs1c8=;\n\th=From:Date:Subject:MIME-Version:Content-Type:Message-Id:To:Cc;\n b=I3SwpngS+I7XcKNDqHj5G4C7iGBZsJyCPL2jItt3h0Etvght5us+GTficldj6dd5yGrz1tuskZFjG6gItAB5pphH6r+zPQurfu7N9+0wVfwar35Enpoh0rAsdP+A8ylVNWTlC3DofXCMdyVRHQSmAypA+mj77wGGcASQOX8bm+M=","ARC-Authentication-Results":"i=1; smtp.subspace.kernel.org;\n dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com;\n spf=pass smtp.mailfrom=oss.qualcomm.com;\n dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com\n header.b=UG4w89mZ;\n dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com\n header.b=SqU801np; arc=none smtp.client-ip=205.220.180.131","DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h=\n\tcc:content-transfer-encoding:content-type:date:from:message-id\n\t:mime-version:subject:to; s=qcppdkim1; bh=FtunU3L/j4WL0R0kP+04qh\n\taEQH5xAAZVxnxjK/pxLz0=; b=UG4w89mZGU5RYEi0bKwpg44Qw7l8a6awj71gYc\n\tgWrkWxlvm76n9sicZCzsYAM5odjUJ7pdCWufCKE0N/Z5YIvcy09DlFHV3THKNWBd\n\tyPP25jhkiA3uwxAia3mtsRX0BDiCTu9jLti+2k1HNBKGzSQXviMNO/PazxyBr/hm\n\tUyE1j0mmBm0Sj1w4hN6uhQT4CNU/PKLY2Ys7RrmsJL51nz4ERoN6xRk4xTARCde6\n\tkkTyb3dQMuflwhctIURSJS/xFCCfhsfUsqCZUBKidXg38FvLs4nlMjwXfnQgdW2o\n\t9rQN6sT6r80WPOZaoLf/xG8nqOUsfQUhKsbYbue8Wh0jbcNw==","v=1; a=rsa-sha256; c=relaxed/relaxed;\n        d=oss.qualcomm.com; s=google; t=1774436808; x=1775041608;\n darn=vger.kernel.org;\n        h=cc:to:message-id:content-transfer-encoding:mime-version:subject\n         :date:from:from:to:cc:subject:date:message-id:reply-to;\n        bh=FtunU3L/j4WL0R0kP+04qhaEQH5xAAZVxnxjK/pxLz0=;\n        b=SqU801npvp/4NqRWVEaFpSrBT4jscYO2uYv45kNWD1Ez1KfyVR5we2/mr7g7qvGXRO\n         NtNfHlMwdjBmkginigTWUyhkZ4Sa+HD5pKhfw4iowsDAIx4u4JyA8FkoIwBRFD7FzuKp\n         B+GSAXsDpu/xf3xzFeMS917V/pHTRD0iMxN9eP863hiupZhdH/kOVpfypqF6ftUDMFGB\n         R1lajbSiDKZjKPd6hnLELuGLmczY25rNaPTQ2OE2FZS6KCsGQ6rl89zsL0bSlBDjXKyt\n         gtVMz2YaH4+YU/7Dgxa86GPLhN7mJPlbGeIx3yc8h5xdELzgjiEkfuCHkB/5PEQhzS4w\n         qH4g=="],"X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n        d=1e100.net; s=20251104; t=1774436808; x=1775041608;\n        h=cc:to:message-id:content-transfer-encoding:mime-version:subject\n         :date:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date\n         :message-id:reply-to;\n        bh=FtunU3L/j4WL0R0kP+04qhaEQH5xAAZVxnxjK/pxLz0=;\n        b=pYuIsGTufz7nc9tVB/NI/v/Boy4rIj9HDwanxT2fqAmXq14Oe6aANVbOPB24ubZvEX\n         XsEww4DoSVxGUlurCeW0oe8VQP3qubeS0499xq9GMqiYXnp8kepctHmJ6VRXZKbgFYzn\n         Pk/AIk+1M6khttsoqquAtcn3T6AQfkNme3g4HKyI1uAG+HakNITsgegskJcL3vaknkYv\n         6SK4tzzUSdGcJdXXhaVcYM2y1rkHUnCLqM8jOH+dDsidx5Ao5Fbgk9hzjAyDHegRA4Wg\n         1wyne5lZX4Ns8ptQZVsEe9HP0yZcyflh9LeH+qREvzZLQ7ke6C1NoY+qmjm2dZsikTJK\n         X78w==","X-Gm-Message-State":"AOJu0YwHtZj0oeMGkFVVBg+BVwP3RbZnYVOErt+4JUtIlBQkfisalTGR\n\tm6ud69jYvRT5v7Apu05G9wM8GgCaKOTIFwzAwMnICpOLOxkc5C2L8Wwf1OxQx5HqDWerbJZ5HIC\n\tYQb/SV+Y75Id3larYekDyZv/7OhArvPK59h2ajPOwkeGovPCWKEp+/GLX3M536Anw","X-Gm-Gg":"ATEYQzyCAMJLfJ0wW/NrdtpEPfPl3nmKQoxiT74jEC8XyybXgDzDbzWzY3bqjyom5dc\n\tH13Ug/SoqEKPxLeKbVot7Hn1nBCxGOQ0gJ7uIEHZsr3CtC+IAU78221wH5b+Z9QNaCIK2fdNrkv\n\tC4uz4E39DLxYH6wiYCxGRR6x4fL2i0Pm+3L7UAyGx6xDe+/cDY9Svyq9i4dSGfljM9eFj+Z42Bm\n\tqMnI6ihdGTBvgD7Yb/vgLWrg8z3i94YxQ/lyQg18+Hmk/1k9ioNaxh1U3kmSIEjeGvDbQOHfXBI\n\tG+x2DTul3Lqs2Kun2b+omH0u5ghmkJJDiwphNhKla8gbGUnXzheH9IKxOfF6KNwIENR7FlyUIBc\n\tqZ85OUtb4L9lqKrxKYY9LY+47PyyVnJB7s64iw6PGIns+XHMDjkVr","X-Received":["by 2002:ac8:5c94:0:b0:509:127d:ee06 with SMTP id\n d75a77b69052e-50b80e68559mr41728621cf.58.1774436808335;\n        Wed, 25 Mar 2026 04:06:48 -0700 (PDT)","by 2002:ac8:5c94:0:b0:509:127d:ee06 with SMTP id\n d75a77b69052e-50b80e68559mr41728021cf.58.1774436807818;\n        Wed, 25 Mar 2026 04:06:47 -0700 (PDT)"],"From":"Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>","Date":"Wed, 25 Mar 2026 12:06:38 +0100","Subject":"[PATCH] gpio: shared: shorten the critical section in\n gpiochip_setup_shared()","Precedence":"bulk","X-Mailing-List":"linux-gpio@vger.kernel.org","List-Id":"<linux-gpio.vger.kernel.org>","List-Subscribe":"<mailto:linux-gpio+subscribe@vger.kernel.org>","List-Unsubscribe":"<mailto:linux-gpio+unsubscribe@vger.kernel.org>","MIME-Version":"1.0","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"7bit","Message-Id":"<20260325-gpio-shared-deadlock-v1-1-e4e7a5319e95@oss.qualcomm.com>","X-B4-Tracking":"v=1; b=H4sIAL3Bw2kC/x3MQQqAIBBA0avIrBvIiSS6SrQwnWooVBQiiO6et\n HyL/x8onIULjOqBzJcUiaFCNwrcbsPGKL4aqCXTdtTjliRi2W1mj56tP6M7cDGdIbKDcayhpin\n zKve/neb3/QCBe3DhZgAAAA==","X-Change-ID":"20260325-gpio-shared-deadlock-b63622a86ce1","To":"Linus Walleij <linusw@kernel.org>, Bartosz Golaszewski <brgl@kernel.org>,\n        Jon Hunter <jonathanh@nvidia.com>","Cc":"linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org,\n        Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>,\n        Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>","X-Mailer":"b4 0.14.2","X-Developer-Signature":"v=1; a=openpgp-sha256; l=3682;\n i=bartosz.golaszewski@oss.qualcomm.com; h=from:subject:message-id;\n bh=+lOYzTnO906o+OM4BjFEcqsuBb9EgOPvHQcpAdhs1c8=;\n b=owEBbQKS/ZANAwAKAQWdLsv/NoTDAcsmYgBpw8HC/nq2GsTJFBdQw5vT9/CCE/2+H3/G6Pi3s\n XLVyhww+B2JAjMEAAEKAB0WIQSR5RMt5bVGHXuiZfwFnS7L/zaEwwUCacPBwgAKCRAFnS7L/zaE\n wwYnD/49VU8b6T2tpWjeZTcT4414CZ5GkBya2x2xRQMIIyJGE5IOk9vOi7Ve4J/IXjJa6jY8PkN\n 5izOrruMyHLEYFA+4c9GU7n1oyeEVYot/6Fu+zscTpqQT49GLVk0nTdzns6h25aRJLu+2IadDNN\n iLC9lDXH1zeBLlflzARUfb4D1ylNp/uqiU/T2h8wDb/OSDZO6LCEcV3ZuEPrJmZ03FpOFDf2iKn\n rCIFfOahDXP0AbKA/siLH/6lknHARYc6YqgR/ASJKt4tXRHqtfncxf+oBLWNAXdELsj7HX/8U3J\n sjKKFEz4LTd2X9hJoCpH7qz4ArRme4ycfgi+XNGWgBxXdGgLCwXC5AAxstkt/SvHd8/0Y+SMyX6\n KJerxWID7mbTyJIJDflzRTLvBDhvJU1w0F35YpeUtagv6OPPaEj8QY0K/wRwHgUSyvZXwF71Nbr\n /tF16uhHcrxZ6NIx6Lh3MPPVgDGa0TLkv0taGBJ60KCTNjAQ834qMJrKqbf11Jw+1op9b7aYmgo\n 9tAdUFS425zmLdqj0i10eyYCS5EoeEecGMYjvW5tu2OMsTbYiI2KbU4899OwSfXFD4P+pqMni2Z\n FF6y4ElMmZd2IuFKoTNKpFDzFfHzhl9SEYtMGbO5wRRBWqWBbm6Iq+gfScZ3buYmDrw0AH/76xM\n GF9GgH2cSY1sNng==","X-Developer-Key":"i=bartosz.golaszewski@oss.qualcomm.com; a=openpgp;\n fpr=169DEB6C0BC3C46013D2C79F11A72EA01471D772","X-Authority-Analysis":"v=2.4 cv=Jvr8bc4C c=1 sm=1 tr=0 ts=69c3c1c9 cx=c_pps\n a=EVbN6Ke/fEF3bsl7X48z0g==:117 a=xqWC_Br6kY4A:10 a=IkcTkHD0fZMA:10\n a=Yq5XynenixoA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22\n a=u7WPNUs3qKkmUXheDGA7:22 a=rJkE3RaqiGZ5pbrm-msn:22 a=EUspDBNiAAAA:8\n a=yl17Z3i23zXCwgwor4gA:9 a=QEXdDO2ut3YA:10 a=a_PwQJl-kcHnX1M80qC6:22","X-Proofpoint-ORIG-GUID":"ORJrO6J1M7MmkVJVTtnyGMINsKaHn-4Q","X-Proofpoint-Spam-Details-Enc":"AW1haW4tMjYwMzI1MDA3OSBTYWx0ZWRfX9kFQqDBqnmr5\n ev/5XqCzFiHZemOy75FcsYtpsFydbkfAlYUgYo8x74crr/8ZG97GtuL0ETHFjzEw/i7CQLPnmyQ\n jWCJnWHhXAobnC4TxLLAdlEy6lF+eeR+GBmNbZSlbrIryjtuwH2pqsa4uWAXGD41VlGxAoR+Flp\n 1dYMmxj/y0/0vsmbovy9L4Vf68ParRvUk0fBOHH4kO1AKWYYgk46W/8vbYJcZvxFEcRMvwAaK9U\n y3a9Rtzv+RhO0R7I3NlDTVftsRvgzvqB/4UNrLHg/p407h4ya0lfZFautjAqCS7qKW0wW1TZ6qE\n gF+bBHsedujFOYtrvEgXyv2QaJYpOTmft9jT8LmJ/5VOPE/p/NAKwJBEOg2PMl20vOzczMTlORR\n dN2nRtisOj6YTVDt9jgV5vhgccxmwsBnXx9ijWynqaKcgt/5W0By7ZWbDNX6OHyle1uR36Z/ZCu\n xoUOWM7vyUL0tODjDYQ==","X-Proofpoint-GUID":"ORJrO6J1M7MmkVJVTtnyGMINsKaHn-4Q","X-Proofpoint-Virus-Version":"vendor=baseguard\n engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.51,FMLib:17.12.100.49\n definitions=2026-03-25_03,2026-03-24_01,2025-10-01_01","X-Proofpoint-Spam-Details":"rule=outbound_notspam policy=outbound score=0\n lowpriorityscore=0 adultscore=0 impostorscore=0 suspectscore=0 phishscore=0\n priorityscore=1501 spamscore=0 clxscore=1015 bulkscore=0 malwarescore=0\n classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0\n reason=mlx scancount=1 engine=8.22.0-2603050001 definitions=main-2603250079"},"content":"Commit 710abda58055 (\"gpio: shared: call gpio_chip::of_xlate() if set\")\nintroduced a critical section around the adjustmenet of entry->offset.\nHowever this may cause a deadlock if we create the auxiliary shared\nproxy devices with this lock taken. We only need to protect\nentry->offset while it's read/written so shorten the critical section\nand release the lock before creating the proxy device as the field in\nquestion is no longer accessed at this point.\n\nFixes: 710abda58055 (\"gpio: shared: call gpio_chip::of_xlate() if set\")\nReported-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>\nSigned-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>\n---\n drivers/gpio/gpiolib-shared.c | 56 +++++++++++++++++++++----------------------\n 1 file changed, 28 insertions(+), 28 deletions(-)\n\n\n---\nbase-commit: 85964cdcad0fac9a0eb7b87a0f9d88cc074b854c\nchange-id: 20260325-gpio-shared-deadlock-b63622a86ce1\n\nBest regards,","diff":"diff --git a/drivers/gpio/gpiolib-shared.c b/drivers/gpio/gpiolib-shared.c\nindex e257212fa5e3df249de0d06eebdb2165ae734ebc..e02d6b93a4ab42b197f0fd64e4854a303f54f140 100644\n--- a/drivers/gpio/gpiolib-shared.c\n+++ b/drivers/gpio/gpiolib-shared.c\n@@ -533,48 +533,48 @@ int gpiochip_setup_shared(struct gpio_chip *gc)\n \t * exposing shared pins. Find them and create the proxy devices.\n \t */\n \tlist_for_each_entry(entry, &gpio_shared_list, list) {\n-\t\tguard(mutex)(&entry->lock);\n-\n \t\tif (!device_match_fwnode(&gdev->dev, entry->fwnode))\n \t\t\tcontinue;\n \n \t\tif (list_count_nodes(&entry->refs) <= 1)\n \t\t\tcontinue;\n \n+\t\tscoped_guard(mutex, &entry->lock) {\n #if IS_ENABLED(CONFIG_OF)\n-\t\tif (is_of_node(entry->fwnode) && gc->of_xlate) {\n-\t\t\t/*\n-\t\t\t * This is the earliest that we can tranlate the\n-\t\t\t * devicetree offset to the chip offset.\n-\t\t\t */\n-\t\t\tstruct of_phandle_args gpiospec = { };\n+\t\t\tif (is_of_node(entry->fwnode) && gc->of_xlate) {\n+\t\t\t\t/*\n+\t\t\t\t * This is the earliest that we can tranlate the\n+\t\t\t\t * devicetree offset to the chip offset.\n+\t\t\t\t */\n+\t\t\t\tstruct of_phandle_args gpiospec = { };\n \n-\t\t\tgpiospec.np = to_of_node(entry->fwnode);\n-\t\t\tgpiospec.args_count = 2;\n-\t\t\tgpiospec.args[0] = entry->offset;\n+\t\t\t\tgpiospec.np = to_of_node(entry->fwnode);\n+\t\t\t\tgpiospec.args_count = 2;\n+\t\t\t\tgpiospec.args[0] = entry->offset;\n \n-\t\t\tret = gc->of_xlate(gc, &gpiospec, NULL);\n-\t\t\tif (ret < 0)\n-\t\t\t\treturn ret;\n+\t\t\t\tret = gc->of_xlate(gc, &gpiospec, NULL);\n+\t\t\t\tif (ret < 0)\n+\t\t\t\t\treturn ret;\n \n-\t\t\tentry->offset = ret;\n-\t\t}\n+\t\t\t\tentry->offset = ret;\n+\t\t\t}\n #endif /* CONFIG_OF */\n \n-\t\tdesc = &gdev->descs[entry->offset];\n+\t\t\tdesc = &gdev->descs[entry->offset];\n \n-\t\t__set_bit(GPIOD_FLAG_SHARED, &desc->flags);\n-\t\t/*\n-\t\t * Shared GPIOs are not requested via the normal path. Make\n-\t\t * them inaccessible to anyone even before we register the\n-\t\t * chip.\n-\t\t */\n-\t\tret = gpiod_request_commit(desc, \"shared\");\n-\t\tif (ret)\n-\t\t\treturn ret;\n+\t\t\t__set_bit(GPIOD_FLAG_SHARED, &desc->flags);\n+\t\t\t/*\n+\t\t\t * Shared GPIOs are not requested via the normal path. Make\n+\t\t\t * them inaccessible to anyone even before we register the\n+\t\t\t * chip.\n+\t\t\t */\n+\t\t\tret = gpiod_request_commit(desc, \"shared\");\n+\t\t\tif (ret)\n+\t\t\t\treturn ret;\n \n-\t\tpr_debug(\"GPIO %u owned by %s is shared by multiple consumers\\n\",\n-\t\t\t entry->offset, gpio_device_get_label(gdev));\n+\t\t\tpr_debug(\"GPIO %u owned by %s is shared by multiple consumers\\n\",\n+\t\t\t\t entry->offset, gpio_device_get_label(gdev));\n+\t\t}\n \n \t\tlist_for_each_entry(ref, &entry->refs, list) {\n \t\t\tpr_debug(\"Setting up a shared GPIO entry for %s (con_id: '%s')\\n\",\n","prefixes":[]}