From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-dl1-f47.google.com (mail-dl1-f47.google.com [74.125.82.47]) (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 5E1AE34CFCD for ; Thu, 21 May 2026 05:13:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.82.47 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779340425; cv=none; b=ZkhtVBz/o41Wd+LX/oyS38Cm3q6iHc/C8oQ4xcKC2rRPDiYqaak5JC4A8MUZcQOfMF+zSE2F6sJ3lzCCXE4BxDA1WBHH5moT4VqLcsO8J9cDboDC3U2EiLrpX+DaJulWIEcc0JwUYDGnaU8JtjoXuvpzPj4ma77dTXQNGEPHjok= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779340425; c=relaxed/simple; bh=an2XKnw/6oNRYjivHk/fQLnrkcFYlk+CGyiYpwsGnhE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=RlhSW8yYjlx2uoqqM8p+R+mhAJhm4Fnglf3BCdoHMjA9XlHy9P9FMf3J4v/u6WlUrqXgkREQmoT8pjKRC2+9hO5bzhdsyntfNeD/HLVsnXkmtiVO/VlJta9nCWsdjKlPUpCjPnxwy1rGS11JfSHG5V5WpvFl3oodn8Vpl8fQYbM= 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=KezolyL+; arc=none smtp.client-ip=74.125.82.47 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="KezolyL+" Received: by mail-dl1-f47.google.com with SMTP id a92af1059eb24-135e88b8e55so5933612c88.0 for ; Wed, 20 May 2026 22:13:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1779340423; x=1779945223; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=pXtisoK8i0cyvAoaHE4OQcmxs5XHz2jUEn0crM4CfGY=; b=KezolyL+vcKcS0eaIMl9nVTayU0vlKDWYQzWJSUqrlkQYefXHEWVu6Az4W+gq2njSz E+mK3BZA9DLp+bpJg+AbWc7o82rCzuIkoNrj3RtaMm0Yp753kn0XJ3DFsdVTj8Hw+e7z n4Vd8T7kZC89snFgCjMtiNrnk644CM1gf7WWPI4yvs+VVkNiF3t/biR7Rbozw0EaHNfz Ge7aWvxCiViZLkKOafU5ZZHLWfuGIuqsVvFuDdMN6oCYo8QMPRoeJCPlzr+FvRRyahEp lBEKI5YoUyncn3q+QE0h9NeVdtCIQy7NkimmBT6lK3KzN/9H0jBYqZtxEsAYOvY9s3mS o/Mg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779340423; x=1779945223; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=pXtisoK8i0cyvAoaHE4OQcmxs5XHz2jUEn0crM4CfGY=; b=RgH9PpfehSUfBHVgpuNhm0IFhqomQtDJR2XXPwO7COJoZk3Kxg/l4m0QK/nlqCpLKx I81IpT+ZpbE5aP+f98sgsN75yI4CZzXblU7NkslzZc7pkOSgR+XQ9tYRb18FL2E33yY6 x3SPpzKQnlXZS55jj+CLcF8hVn4cbXFTsOP1C3EhUsLW/9IX9akrLev9B5DXRej6wu6F rA9qxu9rvfmiA/swNNtxS5e4rexYm9coIK9jZcMjQA0eNjltmaHWsMuyjlrgT9qFzmph 8lCB+WtqglHl/9IxuvY37ZbAo68VO+nhTAGk/lrqKo3YhOwfU2kC0eP/8QGukflYtPJg QmqQ== X-Forwarded-Encrypted: i=1; AFNElJ/yTndq8xcpiHpRo+oTsfEARQLNL2WdrYJdxD8WsEeknPAABqFc0vNXf0itjX3/5fcS8Wko+xv+iVyFe/s=@vger.kernel.org X-Gm-Message-State: AOJu0YxQ72rzYMjk2agdPuGYwQB0z2/6Cz55LdOb+BemHYwgnt8rs+/y q4s7dOxGDa237OMMPxzH6xBBedyWZ7+5JBq/5PBP0TkVAlo/VwKkbT05 X-Gm-Gg: Acq92OGJmXcGvRwRv3IbI+mFqTbN4FtcXkcXs0Gpd6rVXhoLJLWkYCZupxoS3pxXLms +n4cYsxoWnNOc4EihTQmeXffxI2OEjGDUOr9qhVRmxV1V1zoFoiL+QXnthvlNzOfuAxKfg3SJUO /4GPorO6NaMVZluI4RJ0R/0lJ1aDyTZ6dqbrRc8uzDuTXuhdBDsDeEMjqSXGqLpE/VudDjI/d/8 BSmqmN/dQTpEEUOsw/y219GIPOUl484JUsVqJoB8NNm4VZ20vSxMvjl7Oup6jmVrjCWs3n+EZqy l7TInKWKuXxF4h6dStB9D1LqQ2MsusJOmz0Vt6VQLP65Mp9vQfqfJvOU8wtfVYPYGOBGvvqpt7f xNglcNj9NDux6gUJtkx8t//nv4YeuU+30idmNnlXkGLAoLvvhUOsMfclhlTWJ1PnXsMeD1vwXjh 64/j38wquQ9+Yw2ecJ4vToRmOwdwGbx5wAV25Mfs5/kLa2Ajp34RM7QQy388aoR8R6PZDWwgDCa dMyqZgIt6fhrQ== X-Received: by 2002:a05:7022:61a1:b0:12d:b26f:cafd with SMTP id a92af1059eb24-13632a02cf3mr857042c88.5.1779340423478; Wed, 20 May 2026 22:13:43 -0700 (PDT) Received: from dtor-ws.sjc.corp.google.com ([2a00:79e0:2ebe:8:d457:597:d576:1eb8]) by smtp.gmail.com with ESMTPSA id a92af1059eb24-135e5c0a918sm6231360c88.14.2026.05.20.22.13.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 May 2026 22:13:42 -0700 (PDT) From: Dmitry Torokhov Date: Wed, 20 May 2026 22:13:18 -0700 Subject: [PATCH v2 2/5] sh: pfc: attach software node to the GPIO chip Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20260520-rsk7203-properties-v2-2-465f3308021b@gmail.com> References: <20260520-rsk7203-properties-v2-0-465f3308021b@gmail.com> In-Reply-To: <20260520-rsk7203-properties-v2-0-465f3308021b@gmail.com> To: Rich Felker , John Paul Adrian Glaubitz Cc: Yoshinori Sato , Geert Uytterhoeven , Linus Walleij , Bartosz Golaszewski , Andy Shevchenko , Arnd Bergmann , linux-sh@vger.kernel.org, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-gpio@vger.kernel.org X-Mailer: b4 0.16-dev-6911d With commit e5d527be7e69 ("gpio: swnode: don't use the swnode's name as the key for GPIO lookup") gpiolib requires that firmware nodes from the GPIO references to match firmware node in gpiochip structure. Define a software node for the pfc gpiochip so that it can be referenced by boards using static device properties. Signed-off-by: Dmitry Torokhov --- arch/sh/include/cpu-common/cpu/pfc.h | 3 +++ arch/sh/kernel/cpu/pfc.c | 20 ++++++++++++++------ 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/arch/sh/include/cpu-common/cpu/pfc.h b/arch/sh/include/cpu-common/cpu/pfc.h index 879d2c9da537..d57e38c05bdb 100644 --- a/arch/sh/include/cpu-common/cpu/pfc.h +++ b/arch/sh/include/cpu-common/cpu/pfc.h @@ -11,6 +11,9 @@ #include struct resource; +struct software_node; + +extern const struct software_node pfc_gpiochip_node; int sh_pfc_register(const char *name, struct resource *resource, u32 num_resources); diff --git a/arch/sh/kernel/cpu/pfc.c b/arch/sh/kernel/cpu/pfc.c index 062056ede88d..5a8d804d607b 100644 --- a/arch/sh/kernel/cpu/pfc.c +++ b/arch/sh/kernel/cpu/pfc.c @@ -5,21 +5,29 @@ * Copyright (C) 2012 Renesas Solutions Corp. */ +#include #include #include +#include #include -static struct platform_device sh_pfc_device = { - .id = -1, +const struct software_node pfc_gpiochip_node = { + .name = "sh-pfc", }; int __init sh_pfc_register(const char *name, struct resource *resource, u32 num_resources) { - sh_pfc_device.name = name; - sh_pfc_device.num_resources = num_resources; - sh_pfc_device.resource = resource; + struct platform_device_info pdev_info = { + .name = name, + .id = PLATFORM_DEVID_NONE, + .res = resource, + .num_res = num_resources, + .swnode = &pfc_gpiochip_node, + }; + struct platform_device *pdev; - return platform_device_register(&sh_pfc_device); + pdev = platform_device_register_full(&pdev_info); + return PTR_ERR_OR_ZERO(pdev); } -- 2.54.0.669.g59709faab0-goog