From nobody Sat Jul 25 18:53:28 2026 Received: from mail-pj1-f43.google.com (mail-pj1-f43.google.com [209.85.216.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A1C9E418A4A for ; Tue, 14 Jul 2026 23:42:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784072555; cv=none; b=Hy+lPDBv46/DkEqnMMYCjaqayQC0G8JXx6UEWjCSfLkUtsoB4gNTmwZbs2P2Z10/qto+wodGy5K/OBQW6v/axKjsW4aeRd2/py+ZULMurK7Ke4lQNgpmFcCJF9JltgVaFqBrbwyujCAZc6FEN98AvXvQP+v/UnXX1KdLRCCwFEo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784072555; c=relaxed/simple; bh=DIgognXgae4/GVNIoSHQv4tSnIRy6YAm2SspBfvmHtU=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=iwqKy8c1vdSl9/uZrfvJ06hf36GzJB8jXvLc8qNqWle4Y7rs0/Aj0aHEXjQ4GRiZXwdXt3P2wCwiQYWw1fz+dBLFkxO+tuVuVFTnyKQM0soyj6OaewVVaS6MGxE9ObdKq2V5DozTQZKiGCYK6Ky9GmcK9JIOONLE2un4fFelCzI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=FhCiFeDY; arc=none smtp.client-ip=209.85.216.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="FhCiFeDY" Received: by mail-pj1-f43.google.com with SMTP id 98e67ed59e1d1-38e1a9d9105so1079279a91.1 for ; Tue, 14 Jul 2026 16:42:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1784072554; x=1784677354; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=hLFUs5RlkL8vn6uwW0uOp3ziZXbVN3pyew+ndI5sC2g=; b=FhCiFeDYRK6Rbml29EFdXbobrcYczUiWho8Kq+AtG1aXix7ROdqWtjADYetvPy/8B2 T8ZfGc2Mb+gQ6j1sSDzQlYl3m0qI654GpHXsllOCbmzANHdxyjQpokUpAWcAdW+2bBRW RuX4xuPqUrvd3293w2eobtoS6eWeSaLPsl5+sglSd2L7f+CgJqlaz7QL720R9OTgsMlt mFQGsNWWtkGp+VtIvGakPXgwinxDXW06Yx/9PPJxxwi3/JQ6QpOscGKO3n8B+5ZUmvds V2A3SlGVnc3uVmOH3btFNMxaYV5Kxa7NyLQMsZW4d4TG4y//f/Q87SmW/XBggwEMo7Qy W/EQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784072554; x=1784677354; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=hLFUs5RlkL8vn6uwW0uOp3ziZXbVN3pyew+ndI5sC2g=; b=Z0R5MnIblzYj6jUMMgSeAKSDDEd7nmr40oXboJ3I/jmT6hodwOqkN08a4Hh1+oC04i +g2opZex1b7W8Vq2Vwhp8+Ig7FPBgaJ5mA3KkSogb17BhL9F/lRVaODPB0YFfUgg+47+ zu2jr1jTwOeGSCQpktQJmNLQdv4fMB35oq/czPsK1axBcJ8nlf7/mwtyYWBciWJ0xtXw Qn1n9hlNJATLauNSiauSMXGpbEL3klTjrldBU7+muFLy4oxs8zPeAOHKK9iUDiRx3mjr qMyItqi1pl8c5Y5IanVnZhMBopzSUjd1KundRVYy+SqaeijXZkA44th/rbl42OTuY625 vVEA== X-Forwarded-Encrypted: i=1; AHgh+RpC9lAv19YI7/PosojHEmnErQFU+XSiSgILvj3eGq6w8gMkUoo5oFspzb2AXliHqOuBqb+9gndbmrW5P8U=@vger.kernel.org X-Gm-Message-State: AOJu0Ywxo+fT/qCwcIao7gkRFCBI2/NINjMjwXwlXFHhEAHY9KLRdC9B XirmV5O/+zj9hd73efDYir0TnUwt4zIxRnw6ZtVMzVyPAuqdSaRcLzLq X-Gm-Gg: AfdE7ckj2W3q30UK/KtuIFJk8VJXnXhzklUGkffUJppWzw9rR/cg3ViL8snX3T8Gmu9 4U//5PnDRdCT4PXQBdtOXtRSCgGq5yjIM7o+pfwMPhjTOPxNUWBCpcwGTeMoN02SPUw1OC8XXaH +yFNwOQRD5QRmw4BFSFaXrRciOf9ILW/9UO++2MTtTQRDX8DzZiMVDQGzVf/mvk2MfuC4/o2f/Y Vu2QvrAwnj/Oh/J0yJVm5Lfuo0ivLfck733bSM612cwI2QKBv8crqoaapuogTjtO8rwq7p8tIRD Yv4fNbnSPuyZ1deYWFYcYUtkuITqdZsbe3oyWbJUHh5l46YcZgut3M6+RguSVdW9POuEFkjIUAZ R+qCcL96CTPQ85TT/lmDbkpHh7Okym5/e8isHiRCVQVlJ4GTOfslZsS7JrUkk6EKkV3ynB5m4Hb fFiq5x+k9SiBEbgz1AvHD7XeUl/47fYbBPrPd/zcq6v8QsX/63x2vBFBg2bVol5JHalsMuL9qIS O4xjYM0LqDsOPrT6YOEEY/LQ+papLie3mUolYHq3b556AnzSodhOYlZ3aiTRbli9Q== X-Received: by 2002:a17:90b:4c02:b0:36a:c4b:76cf with SMTP id 98e67ed59e1d1-38e2a0c346bmr532833a91.23.1784072553829; Tue, 14 Jul 2026 16:42:33 -0700 (PDT) Received: from ryzen.lan ([2601:644:8000:7a86::e34]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2ccc9d1e279sm124751785ad.45.2026.07.14.16.42.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Jul 2026 16:42:32 -0700 (PDT) From: Rosen Penev To: linux-gpio@vger.kernel.org Cc: Linus Walleij , Bartosz Golaszewski , Nathan Chancellor , Nick Desaulniers , Bill Wendling , Justin Stitt , linux-kernel@vger.kernel.org (open list), llvm@lists.linux.dev (open list:CLANG/LLVM BUILD SUPPORT:Keyword:\b(?i:clang|llvm)\b) Subject: [PATCH] gpio: logicvc: use devm_platform_get_and_ioremap_resource() Date: Tue, 14 Jul 2026 16:42:30 -0700 Message-ID: <20260714234230.886636-1-rosenp@gmail.com> X-Mailer: git-send-email 2.55.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" In the regmap fallback path, replace of_address_to_resource() plus devm_ioremap_resource() with devm_platform_get_and_ioremap_resource(), which looks up the resource and maps it in one call. The helper returns a pointer to the resource, so update resource_size() to dereference it. Drop the now-unused linux/of_address.h include; of_node is still used by syscon_node_to_regmap() and platform_get_resource() resolves the same MEM resource that of_address_to_resource(of_node, 0) did. Built for ARM (multi_v7_defconfig + CONFIG_GPIO_LOGICVC) with LLVM=3D1; drivers/gpio/gpio-logicvc.o compiles cleanly. Assisted-by: opencode:hy3-free Signed-off-by: Rosen Penev --- drivers/gpio/gpio-logicvc.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/drivers/gpio/gpio-logicvc.c b/drivers/gpio/gpio-logicvc.c index cb9dbcc290ad..54a7598c7384 100644 --- a/drivers/gpio/gpio-logicvc.c +++ b/drivers/gpio/gpio-logicvc.c @@ -8,7 +8,6 @@ #include #include #include -#include #include #include #include @@ -102,20 +101,14 @@ static int logicvc_gpio_probe(struct platform_device = *pdev) =20 /* Grab our own regmap if that fails. */ if (IS_ERR(logicvc->regmap)) { - struct resource res; + struct resource *res; void __iomem *base; =20 - ret =3D of_address_to_resource(of_node, 0, &res); - if (ret) { - dev_err(dev, "Failed to get resource from address\n"); - return ret; - } - - base =3D devm_ioremap_resource(dev, &res); + base =3D devm_platform_get_and_ioremap_resource(pdev, 0, &res); if (IS_ERR(base)) return PTR_ERR(base); =20 - logicvc_gpio_regmap_config.max_register =3D resource_size(&res) - + logicvc_gpio_regmap_config.max_register =3D resource_size(res) - logicvc_gpio_regmap_config.reg_stride; =20 logicvc->regmap =3D --=20 2.55.0