{"id":2222679,"url":"http://patchwork.ozlabs.org/api/1.1/patches/2222679/?format=json","web_url":"http://patchwork.ozlabs.org/project/linux-gpio/patch/20260413122233.375945-3-ajay.nandam@oss.qualcomm.com/","project":{"id":42,"url":"http://patchwork.ozlabs.org/api/1.1/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":""},"msgid":"<20260413122233.375945-3-ajay.nandam@oss.qualcomm.com>","date":"2026-04-13T12:22:32","name":"[v1,2/3] pinctrl: qcom: lpass-lpi: Fix GPIO register access helper return types","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"66728c490f7ef2ecd90e600440228ed7a55c98ee","submitter":{"id":93131,"url":"http://patchwork.ozlabs.org/api/1.1/people/93131/?format=json","name":"Ajay Kumar Nandam","email":"ajay.nandam@oss.qualcomm.com"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/linux-gpio/patch/20260413122233.375945-3-ajay.nandam@oss.qualcomm.com/mbox/","series":[{"id":499692,"url":"http://patchwork.ozlabs.org/api/1.1/series/499692/?format=json","web_url":"http://patchwork.ozlabs.org/project/linux-gpio/list/?series=499692","date":"2026-04-13T12:22:30","name":"pinctrl: qcom: lpass-lpi: PM clock framework cleanup and fixes","version":1,"mbox":"http://patchwork.ozlabs.org/series/499692/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/2222679/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/2222679/checks/","tags":{},"headers":{"Return-Path":"\n <linux-gpio+bounces-35088-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=onLJ9rIS;\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=A2eOKyAv;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=2600:3c04:e001:36c::12fc:5321; helo=tor.lore.kernel.org;\n envelope-from=linux-gpio+bounces-35088-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=\"onLJ9rIS\";\n\tdkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com\n header.b=\"A2eOKyAv\"","smtp.subspace.kernel.org;\n arc=none smtp.client-ip=205.220.168.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 tor.lore.kernel.org (tor.lore.kernel.org\n [IPv6:2600:3c04:e001:36c::12fc:5321])\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 4fvRQF4ZzTz1yDF\n\tfor <incoming@patchwork.ozlabs.org>; Mon, 13 Apr 2026 22:23:17 +1000 (AEST)","from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby tor.lore.kernel.org (Postfix) with ESMTP id 1B0C6301AA8A\n\tfor <incoming@patchwork.ozlabs.org>; Mon, 13 Apr 2026 12:23:00 +0000 (UTC)","from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id B193F3C4568;\n\tMon, 13 Apr 2026 12:22:57 +0000 (UTC)","from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com\n [205.220.168.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 2CCC43C4554\n\tfor <linux-gpio@vger.kernel.org>; Mon, 13 Apr 2026 12:22:56 +0000 (UTC)","from pps.filterd (m0279865.ppops.net [127.0.0.1])\n\tby mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id\n 63DC80ih2187568\n\tfor <linux-gpio@vger.kernel.org>; Mon, 13 Apr 2026 12:22:55 GMT","from mail-yw1-f198.google.com (mail-yw1-f198.google.com\n [209.85.128.198])\n\tby mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4dh07hg1cy-1\n\t(version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT)\n\tfor <linux-gpio@vger.kernel.org>; Mon, 13 Apr 2026 12:22:55 +0000 (GMT)","by mail-yw1-f198.google.com with SMTP id\n 00721157ae682-790afc07667so86142467b3.0\n        for <linux-gpio@vger.kernel.org>;\n Mon, 13 Apr 2026 05:22:55 -0700 (PDT)","from hu-nandam-hyd.qualcomm.com ([202.46.22.19])\n        by smtp.gmail.com with ESMTPSA id\n 00721157ae682-7af400eb1fasm50781657b3.44.2026.04.13.05.22.51\n        (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n        Mon, 13 Apr 2026 05:22:53 -0700 (PDT)"],"ARC-Seal":"i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1776082977; cv=none;\n b=eK8FAJTmkJinRk6pqAzV2Bs4oOOwCA4L8lXVWqWLWA4F6JBmiiXKfrPQ1AEqwe13t67A1v2xsWsNbmOu3YsOJEyRQ2ib2ZLbrTh0qR/DuPbcsJZQ0zhXn7J7tx3IKlKw4FyUaUaG+9yat5WSOoubLc/rlkPJfzbT/apFxqPgQr0=","ARC-Message-Signature":"i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1776082977; c=relaxed/simple;\n\tbh=ut9PV2o4yH/f8FFw1egzoxIKS47z+ANZobPjPIWRqWk=;\n\th=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References:\n\t MIME-Version;\n b=lFPyLA+IO23/5gHDAUEQRinR+W31PnpveCHOoX3zYK4q6X10SLeStD9vOxf42Pcc+9IqJ1Rl50Iwne1UwcTpx5cr59h5KwqRkRzQDbcwuNx7IF03FuEidYimGaT+huvD2yX6AYHxMzBYJUJiJdAOSPRyAgUlsP6gpTWzgi11voA=","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=onLJ9rIS;\n dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com\n header.b=A2eOKyAv; arc=none smtp.client-ip=205.220.168.131","DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h=\n\tcc:content-transfer-encoding:date:from:in-reply-to:message-id\n\t:mime-version:references:subject:to; s=qcppdkim1; bh=/JSKbxKMjlH\n\thR33pPEPgG0vWEqr9Nna/LCJkfK6/9BQ=; b=onLJ9rISvd95Su9DRKOxqBAqa9C\n\tWT67BEOcfPbGm1K5H1ZKsImVuDmZ+fhec0YXJdF4bMQFW8xyx9SsAlMaTC9gP3Yy\n\t+etHTyNcGUrXsYL2wt3t5ZrysYKDwOrq9KFobRZDw4iNqnDtnYZ0UTJw0IsgzzGv\n\tjrrBz37c7lTSnU7dOWioV5aH17V04BmsKU7veloOJZmrqjCEQ52W9ypnPZPvO4tK\n\tuc0oQVd0L44bCn4NTA2Ta3NsExM424+V3q24aP+qdT3cQKNRalk/EY9eDRR/O6Kv\n\t5o+8MaNy3SjziFB7kqlzRVRz+Y3n5f4bnNSh7K08SCJyFq+r1j9vd5ozwfQ==","v=1; a=rsa-sha256; c=relaxed/relaxed;\n        d=oss.qualcomm.com; s=google; t=1776082975; x=1776687775;\n darn=vger.kernel.org;\n        h=content-transfer-encoding:mime-version:references:in-reply-to\n         :message-id:date:subject:cc:to:from:from:to:cc:subject:date\n         :message-id:reply-to;\n        bh=/JSKbxKMjlHhR33pPEPgG0vWEqr9Nna/LCJkfK6/9BQ=;\n        b=A2eOKyAvAE+DR0arzu9Q9ux1qkDd/gOVIa9rpxpXIPGxcc7u1Xd7YoarG9ScFqyLd7\n         vf9zhdzIa3uiRKF1sMO1WElmZAZOxdId+ctZnsmcq0MyGWF7QiNvnkha4bYGLDqOuPt3\n         I2Bdk5fMqq56vntnf208BsFd3IR6U0SFEGhCNYK2OqexyWVJO9u5tQ3VjDi8i1fSEOdl\n         tfEB1j3rV1Weqxv/f+CtOcHn9O2AsQKIZgwBHXwwjlok7y2JnJgmDWt1hTItQ37RJPsJ\n         T5w0i9yV3agE7hxpnJwRDE77UKiHRdD1vkACC2wiC463xKuj39tAt9IfdiaXklVZQX6u\n         sSrQ=="],"X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n        d=1e100.net; s=20251104; t=1776082975; x=1776687775;\n        h=content-transfer-encoding:mime-version:references:in-reply-to\n         :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from\n         :to:cc:subject:date:message-id:reply-to;\n        bh=/JSKbxKMjlHhR33pPEPgG0vWEqr9Nna/LCJkfK6/9BQ=;\n        b=tLV9THinxO7f2gUw1S5rwlAohkhi9/yyolAdQDS7rSKcP95tYTTxquAYrVD57rUnhj\n         f4G8/uE8HHVIgmC0V1v9qP9BmVgu7BgfAXLRF2oVfbmIeGLmM+6sy+jfdgpzg9R8ewOS\n         vVhHTPSS2CzMH40bBqGACZCq3spMrVy13wrfYfrnnQlrBbtuP2BhKuBXBxMroyUz5h71\n         QGi/E28b+KWnc21Vsn/WJpPcNaRlLhu+0ZGdM69rQlcTA3ChcmUJagklV61kqqQ11Sdi\n         3jDHLs52lZBpZiQ358NwGKcgCrgdR6PRAr533phL0j7oJuxPVi2gCvVPiwZiTNGOEaOq\n         r4MA==","X-Forwarded-Encrypted":"i=1;\n AFNElJ9wOuU4ufAHFnq5nM/xrZ46r+qOzKLHLpqqT/ZmgT1HnUqNMgXWw8/x1LRB/FQSLxTmL6kLiOCRBonD@vger.kernel.org","X-Gm-Message-State":"AOJu0YxAyWjm+8S17Gpz0dHSnjVimrR11vOgi+il5hCty7oE6OBFaYO1\n\tUVSx+OgQ6+XP+C9dbhZ9kYLNkllHBoMmjSkOxmZw+WjKravPrxKUtFnOI/SUObXvGe43ynngb21\n\tgkp/b4A+CzwCZKYNM2Xi/wZ6WR/c3ohQFha8aV7eN369phgLfS5NotHvt9lac08rZ","X-Gm-Gg":"AeBDievptwVLp7zuyfymfW/rdl4ChchOZgpzZNM7PtrQ+QvuHUX8Xffg4o2PknnHUOJ\n\tl7dx+zidcb+mNYMtdJUoDliStTf+nCwozyUC1LDJBnT3YISb9J52aiB0bMckE7j8ANcO65ER2Qk\n\t9aZvrJCd/hDa/C8GXy5QgwtXIGVgzRH5UNDJpVOHClYhwyxl4zy1pp9jw75kOsbpu6SmIDArqzK\n\tSlXuL5e3+GRs/oXchB/A9xHASnNcuy7Pww7nzKlWfT9Q7VIXR9r7i6lkMXbKUR87XioK0BOPkyt\n\tXaxuHLtrhRGqX4VWcoONHedfkp5vnmEjGqVr6T2u/7BVw0PnMGSupWT0Z6ALJZJYqNbeE733bvD\n\tBNZmWr7/BmGi0+9Tw359twrNWXLAtVe/Nn3UH4AquzyKfOAbF3g==","X-Received":["by 2002:a05:690c:60c7:b0:79e:8299:7505 with SMTP id\n 00721157ae682-7af6ef4008dmr143218247b3.6.1776082974384;\n        Mon, 13 Apr 2026 05:22:54 -0700 (PDT)","by 2002:a05:690c:60c7:b0:79e:8299:7505 with SMTP id\n 00721157ae682-7af6ef4008dmr143217887b3.6.1776082973816;\n        Mon, 13 Apr 2026 05:22:53 -0700 (PDT)"],"From":"Ajay Kumar Nandam <ajay.nandam@oss.qualcomm.com>","To":"Bjorn Andersson <andersson@kernel.org>, Linus Walleij <linusw@kernel.org>","Cc":"linux-arm-msm@vger.kernel.org, linux-gpio@vger.kernel.org,\n        linux-kernel@vger.kernel.org, srinivas.kandagatla@oss.qualcomm.com","Subject":"[PATCH v1 2/3] pinctrl: qcom: lpass-lpi: Fix GPIO register access\n helper return types","Date":"Mon, 13 Apr 2026 17:52:32 +0530","Message-Id":"<20260413122233.375945-3-ajay.nandam@oss.qualcomm.com>","X-Mailer":"git-send-email 2.34.1","In-Reply-To":"<20260413122233.375945-1-ajay.nandam@oss.qualcomm.com>","References":"<20260413122233.375945-1-ajay.nandam@oss.qualcomm.com>","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-Transfer-Encoding":"8bit","X-Proofpoint-ORIG-GUID":"D3CAsHM77pfcooN13mQusziMQZG9uMyi","X-Proofpoint-Spam-Details-Enc":"AW1haW4tMjYwNDEzMDEyMiBTYWx0ZWRfXwjacW7Ey9xCe\n VBlEMMxtR2psE5tqlbOwYp/XmM+a7Pk0dvZ7yr9Z5jBTCprvZydCw+sQCDw4VJfYx0xEyUnTlUu\n eSkT8aSoop11gmw5kHi5IuyhZcHL1SxO8gy9uR+Pg5F8SjY4/7mhV65vuRAqXb4zRApYchy5LnD\n igmpzghsmRcidT/Wy7YGcLtPPTXd3qzsPCbijouwlP04QQWsz7ijtUNC1NRgAuTvT0f2C505kFo\n 0JJGnvEBJEXyYPzVXHLhdItiMIWd0ZdH2HlgWDavtKO1ZpA0hS97A9UU2fpaeo7AWB2uc2UF+9r\n EA3pTU8/q1huBws9JBBfLZXSxm/dK4tTEvaI5IxalvV/NArifosWlLUQFGXYDTCqf+Ssft6ut+z\n gHiPvtq1LQ6r68UilTTwR+LBIgi6m1dRqoy1itsG1WfFBJP3huV/Wvc+MbEpSoe0w5fYvNqsOVQ\n pcamUajwmcOuN5/muNg==","X-Proofpoint-GUID":"D3CAsHM77pfcooN13mQusziMQZG9uMyi","X-Authority-Analysis":"v=2.4 cv=QtNuG1yd c=1 sm=1 tr=0 ts=69dce01f cx=c_pps\n a=g1v0Z557R90hA0UpD/5Yag==:117 a=fChuTYTh2wq5r3m49p7fHw==:17\n a=A5OVakUREuEA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22\n a=u7WPNUs3qKkmUXheDGA7:22 a=Um2Pa8k9VHT-vaBCBUpS:22 a=EUspDBNiAAAA:8\n a=1J4TlokszvnMI57PoO4A:9 a=MFSWADHSvvjO3QEy5MdX:22","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-04-13_03,2026-04-13_01,2025-10-01_01","X-Proofpoint-Spam-Details":"rule=outbound_notspam policy=outbound score=0\n priorityscore=1501 impostorscore=0 adultscore=0 phishscore=0 malwarescore=0\n bulkscore=0 clxscore=1015 lowpriorityscore=0 spamscore=0 suspectscore=0\n classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0\n reason=mlx scancount=1 engine=8.22.0-2604010000 definitions=main-2604130122"},"content":"The LPI GPIO register access helpers previously returned the value from\nioread32(), even though their return type was int. This mixes data\nreturn with status and is inconsistent with common kernel helper\nconventions.\n\nRework lpi_gpio_read() and lpi_gpio_write() to return an int status and\nuse output parameters to pass register values. Update all callers to\nmatch the new helper interface.\n\nThis change fixes the helper API and resulting call sites without\nintending any functional change in GPIO or pinctrl behavior.\n\nSigned-off-by: Ajay Kumar Nandam <ajay.nandam@oss.qualcomm.com>\n---\n drivers/pinctrl/qcom/pinctrl-lpass-lpi.c | 66 +++++++++++++++++-------\n 1 file changed, 47 insertions(+), 19 deletions(-)","diff":"diff --git a/drivers/pinctrl/qcom/pinctrl-lpass-lpi.c b/drivers/pinctrl/qcom/pinctrl-lpass-lpi.c\nindex 6d50e06ef..d108e7321 100644\n--- a/drivers/pinctrl/qcom/pinctrl-lpass-lpi.c\n+++ b/drivers/pinctrl/qcom/pinctrl-lpass-lpi.c\n@@ -39,22 +39,26 @@ struct lpi_pinctrl {\n };\n \n static int lpi_gpio_read(struct lpi_pinctrl *state, unsigned int pin,\n-\t\t\t unsigned int addr)\n+\t\t\t unsigned int addr, u32 *val)\n {\n \tu32 pin_offset;\n+\tint ret;\n \n \tif (state->data->flags & LPI_FLAG_USE_PREDEFINED_PIN_OFFSET)\n \t\tpin_offset = state->data->groups[pin].pin_offset;\n \telse\n \t\tpin_offset = LPI_TLMM_REG_OFFSET * pin;\n \n-\treturn ioread32(state->tlmm_base + pin_offset + addr);\n+\t*val = ioread32(state->tlmm_base + pin_offset + addr);\n+\n+\treturn 0;\n }\n \n static int lpi_gpio_write(struct lpi_pinctrl *state, unsigned int pin,\n \t\t\t  unsigned int addr, unsigned int val)\n {\n \tu32 pin_offset;\n+\tint ret;\n \n \tif (state->data->flags & LPI_FLAG_USE_PREDEFINED_PIN_OFFSET)\n \t\tpin_offset = state->data->groups[pin].pin_offset;\n@@ -107,7 +111,8 @@ static int lpi_gpio_set_mux(struct pinctrl_dev *pctldev, unsigned int function,\n {\n \tstruct lpi_pinctrl *pctrl = pinctrl_dev_get_drvdata(pctldev);\n \tconst struct lpi_pingroup *g = &pctrl->data->groups[group];\n-\tu32 val;\n+\tu32 val, io_val;\n+\tint ret;\n \tint i, pin = g->pin;\n \n \tfor (i = 0; i < g->nfuncs; i++) {\n@@ -119,7 +124,9 @@ static int lpi_gpio_set_mux(struct pinctrl_dev *pctldev, unsigned int function,\n \t\treturn -EINVAL;\n \n \tmutex_lock(&pctrl->lock);\n-\tval = lpi_gpio_read(pctrl, pin, LPI_GPIO_CFG_REG);\n+\tret = lpi_gpio_read(pctrl, pin, LPI_GPIO_CFG_REG, &val);\n+\tif (ret)\n+\t\tgoto out_unlock;\n \n \t/*\n \t * If this is the first time muxing to GPIO and the direction is\n@@ -129,24 +136,28 @@ static int lpi_gpio_set_mux(struct pinctrl_dev *pctldev, unsigned int function,\n \t */\n \tif (i == GPIO_FUNC && (val & LPI_GPIO_OE_MASK) &&\n \t    !test_and_set_bit(group, pctrl->ever_gpio)) {\n-\t\tu32 io_val = lpi_gpio_read(pctrl, group, LPI_GPIO_VALUE_REG);\n+\t\tret = lpi_gpio_read(pctrl, group, LPI_GPIO_VALUE_REG, &io_val);\n+\t\tif (ret)\n+\t\t\tgoto out_unlock;\n \n \t\tif (io_val & LPI_GPIO_VALUE_IN_MASK) {\n \t\t\tif (!(io_val & LPI_GPIO_VALUE_OUT_MASK))\n-\t\t\t\tlpi_gpio_write(pctrl, group, LPI_GPIO_VALUE_REG,\n-\t\t\t\t\t       io_val | LPI_GPIO_VALUE_OUT_MASK);\n+\t\t\t\tret = lpi_gpio_write(pctrl, group, LPI_GPIO_VALUE_REG,\n+\t\t\t\t\t\t     io_val | LPI_GPIO_VALUE_OUT_MASK);\n \t\t} else {\n \t\t\tif (io_val & LPI_GPIO_VALUE_OUT_MASK)\n-\t\t\t\tlpi_gpio_write(pctrl, group, LPI_GPIO_VALUE_REG,\n-\t\t\t\t\t       io_val & ~LPI_GPIO_VALUE_OUT_MASK);\n+\t\t\t\tret = lpi_gpio_write(pctrl, group, LPI_GPIO_VALUE_REG,\n+\t\t\t\t\t\t     io_val & ~LPI_GPIO_VALUE_OUT_MASK);\n \t\t}\n \t}\n \n \tu32p_replace_bits(&val, i, LPI_GPIO_FUNCTION_MASK);\n-\tlpi_gpio_write(pctrl, pin, LPI_GPIO_CFG_REG, val);\n+\tret = lpi_gpio_write(pctrl, pin, LPI_GPIO_CFG_REG, val);\n+\n+out_unlock:\n \tmutex_unlock(&pctrl->lock);\n \n-\treturn 0;\n+\treturn ret;\n }\n \n static const struct pinmux_ops lpi_gpio_pinmux_ops = {\n@@ -165,8 +176,11 @@ static int lpi_config_get(struct pinctrl_dev *pctldev,\n \tint is_out;\n \tint pull;\n \tu32 ctl_reg;\n+\tint ret;\n \n-\tctl_reg = lpi_gpio_read(state, pin, LPI_GPIO_CFG_REG);\n+\tret = lpi_gpio_read(state, pin, LPI_GPIO_CFG_REG, &ctl_reg);\n+\tif (ret)\n+\t\treturn ret;\n \tis_out = ctl_reg & LPI_GPIO_OE_MASK;\n \tpull = FIELD_GET(LPI_GPIO_PULL_MASK, ctl_reg);\n \n@@ -293,17 +307,22 @@ static int lpi_config_set(struct pinctrl_dev *pctldev, unsigned int group,\n \t}\n \n \tmutex_lock(&pctrl->lock);\n-\tval = lpi_gpio_read(pctrl, group, LPI_GPIO_CFG_REG);\n+\tret = lpi_gpio_read(pctrl, group, LPI_GPIO_CFG_REG, &val);\n+\tif (ret) {\n+\t\tmutex_unlock(&pctrl->lock);\n+\t\tgoto out_unlock;\n+\t}\n \n \tu32p_replace_bits(&val, pullup, LPI_GPIO_PULL_MASK);\n \tu32p_replace_bits(&val, LPI_GPIO_DS_TO_VAL(strength),\n \t\t\t  LPI_GPIO_OUT_STRENGTH_MASK);\n \tu32p_replace_bits(&val, output_enabled, LPI_GPIO_OE_MASK);\n \n-\tlpi_gpio_write(pctrl, group, LPI_GPIO_CFG_REG, val);\n-\tmutex_unlock(&pctrl->lock);\n+\tret = lpi_gpio_write(pctrl, group, LPI_GPIO_CFG_REG, val);\n \n-\treturn 0;\n+out_unlock:\n+\tmutex_unlock(&pctrl->lock);\n+\treturn ret;\n }\n \n static const struct pinconf_ops lpi_gpio_pinconf_ops = {\n@@ -352,9 +371,13 @@ static int lpi_gpio_direction_output(struct gpio_chip *chip,\n static int lpi_gpio_get(struct gpio_chip *chip, unsigned int pin)\n {\n \tstruct lpi_pinctrl *state = gpiochip_get_data(chip);\n+\tu32 val;\n+\tint ret;\n \n-\treturn lpi_gpio_read(state, pin, LPI_GPIO_VALUE_REG) &\n-\t\tLPI_GPIO_VALUE_IN_MASK;\n+\tret = lpi_gpio_read(state, pin, LPI_GPIO_VALUE_REG, &val);\n+\tif (ret)\n+\t\treturn ret;\n+\treturn val & LPI_GPIO_VALUE_IN_MASK;\n }\n \n static int lpi_gpio_set(struct gpio_chip *chip, unsigned int pin, int value)\n@@ -387,6 +410,7 @@ static void lpi_gpio_dbg_show_one(struct seq_file *s,\n \tint drive;\n \tint pull;\n \tu32 ctl_reg;\n+\tint ret;\n \n \tstatic const char * const pulls[] = {\n \t\t\"no pull\",\n@@ -397,7 +421,11 @@ static void lpi_gpio_dbg_show_one(struct seq_file *s,\n \n \tpctldev = pctldev ? : state->ctrl;\n \tpindesc = pctldev->desc->pins[offset];\n-\tctl_reg = lpi_gpio_read(state, offset, LPI_GPIO_CFG_REG);\n+\tret = lpi_gpio_read(state, offset, LPI_GPIO_CFG_REG, &ctl_reg);\n+\tif (ret) {\n+\t\tseq_printf(s, \" %-8s: <read error %d>\", pindesc.name, ret);\n+\t\treturn;\n+\t}\n \tis_out = ctl_reg & LPI_GPIO_OE_MASK;\n \n \tfunc = FIELD_GET(LPI_GPIO_FUNCTION_MASK, ctl_reg);\n","prefixes":["v1","2/3"]}