Received: by 2002:a05:7412:e794:b0:fa:551:50a7 with SMTP id o20csp1204466rdd; Wed, 10 Jan 2024 11:51:53 -0800 (PST) X-Google-Smtp-Source: AGHT+IGi9hw4/cfQwlUrwMFNx6sgc0NDRsoTbL2FN5PjuUG0ISuonnHhY5gHk3/4Iv8KR2pUxFpZ X-Received: by 2002:a05:6a20:28a7:b0:19a:324e:c9a6 with SMTP id q39-20020a056a2028a700b0019a324ec9a6mr759069pzf.109.1704916313227; Wed, 10 Jan 2024 11:51:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704916313; cv=none; d=google.com; s=arc-20160816; b=lRynyiechND0NGZv6LpXMoY76DrenBfspdVQe1GH7OQpJHfd80iluypjz96d+Qrk6M gAU7PAuHkFgYl2FfNmEka8SEY0cf1V+lmFEyHh4RX07wsNoul4MiUr8k5W/PnpcSIz5Z JWlleEKnk1U/68Ij9S1TA71jWSsGcBsCXMN8Kc79/jdbdc7fAuzfFRzIjMOtO8jtqWPV 7i6JuolzPn0b8hMyEV7CaqADguFbr8AMBNQMYz6cPZbYHbmraCMqiaMIr914NqUkK+Mp dsWBjAnQNvzY0/Pl4J58D2USUeSjete5r0/vAllYLwFqDeUcidjTpDKLP2G3exRToyYv 83OA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=QGJNLPLyI0esp3kiyP6ekV4MJE/CQ1txcBdZozy1qY4=; fh=cIqT9NcZdjUqupo3CRF2zie7E78k65IMo1it3Fi0alA=; b=fQXODN5T/IcHb48l69glHz49JmJmDo/MaqRkF37kargXIjm1oKwbVLO3Gsw7Kvua1a SStE8XAEHIUd6rITqIzv0IWc5XltGY0k06L6evoXvFVEw9GYl3k3F2jOXWxwuSf8utSN gcjJh+DuQaOox/zm0hxrjbSq+DjR2wc34rCBWsk4LyzD8/ycG0I6+un7CFojnz3f0aCy idshod+TZW285AAv6Kn9mHZ1Wn1wMI+3PtBUFzLLrwWavZD43R/vaEy+kTqUGCnuHXEb fDZgAtSimNa+VEWuT55h4Pv1Z1Qt4kqofxa1hDcM9yOgmNAtOXDwDCCxJttwjDJOJc2p 2HPg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20230601.gappssmtp.com header.s=20230601 header.b=YdUX1Pq7; spf=pass (google.com: domain of linux-kernel+bounces-22674-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-22674-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id n5-20020a632705000000b005cda184c281si4252235pgn.199.2024.01.10.11.51.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Jan 2024 11:51:53 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-22674-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@baylibre-com.20230601.gappssmtp.com header.s=20230601 header.b=YdUX1Pq7; spf=pass (google.com: domain of linux-kernel+bounces-22674-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-22674-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 27BC4B21D5E for ; Wed, 10 Jan 2024 19:51:52 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A936D4F21B; Wed, 10 Jan 2024 19:51:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b="YdUX1Pq7" Received: from mail-oo1-f43.google.com (mail-oo1-f43.google.com [209.85.161.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 E64BF4EB3A for ; Wed, 10 Jan 2024 19:51:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baylibre.com Received: by mail-oo1-f43.google.com with SMTP id 006d021491bc7-598a2cb5a7cso229417eaf.2 for ; Wed, 10 Jan 2024 11:51:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1704916272; x=1705521072; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=QGJNLPLyI0esp3kiyP6ekV4MJE/CQ1txcBdZozy1qY4=; b=YdUX1Pq76By7xCBv/J0TNuqf+K4DeKMAjdxNFoln4YpV3JPYDimyHzZ9OKy0jWvPnv I9g5aFG2jnjg+0Ieg7J7KYEi77+9tGnr2EPFGJGj+ywmm0YYVDUeYUZCWOPErIzQOiCp ZXPcya2G/X44xaT0h8x4CSnCaryhgiO3diTTJJb3qcVenWhDiHySWTVb9ngvTmEkrnYT X8bsHNWnEie8hosmA2b0pmo4cLhPpkAquYaHubQu5kWkHYQyQDvGFDV1Cm9TE2Z6h4th GtP1YCNc2pZCZNMsWVH4QuLdJ88MvzSEEhda/L7k4sZKX180Ajiwm5VeOBTYa8tXLmsP iCkQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704916272; x=1705521072; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=QGJNLPLyI0esp3kiyP6ekV4MJE/CQ1txcBdZozy1qY4=; b=udDv6kErj6HTg0QNF8/sEOSB+WYq3mUqz/xMjjMYbBIb3Bovx7zu6o9nMKgWZ7Ku6w YrhEFLRDZerjPDEQxmw28mkG6fs5QSJMTxAzYlEDATt9eoFEEnaOv+0+37fnF8tb7yKe Qe5oSEBf+QBAqYlGm7TflIkxy0UisMUAI7L2baftd4lEHKXCR1bTRYrZZy65f32vC8to 035XSOjILZxMt8Py4V0ytAioa2tH1uJ3cSBArFi98TMdcG12wt+xS+2gchymKnZF3EFo GPAJIIAJ/ivRdoQO9IwvcF5UO6tv9gnpg/QfT5aTxKqvZ/+MYrXAvkBUiKAbfOr1IW3A eOWw== X-Gm-Message-State: AOJu0Yxf0U43KL2+b6ayn8KbyZD0veX/SZ86vldYm2ovEwLcA7TmszF1 R4r46O+bzl6Ns2MP1mfoanKhlJoJEr0gQw== X-Received: by 2002:a05:6820:2406:b0:598:6fb0:ba36 with SMTP id cp6-20020a056820240600b005986fb0ba36mr130528oob.1.1704916271980; Wed, 10 Jan 2024 11:51:11 -0800 (PST) Received: from freyr.lechnology.com (ip98-183-112-25.ok.ok.cox.net. [98.183.112.25]) by smtp.gmail.com with ESMTPSA id 187-20020a4a0dc4000000b00595b35927a3sm938513oob.39.2024.01.10.11.51.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Jan 2024 11:51:11 -0800 (PST) From: David Lechner To: Mark Brown , Jonathan Cameron , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Michael Hennerich , =?utf-8?q?Nuno_S=C3=A1?= , Frank Rowand Cc: David Lechner , Thierry Reding , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Jonathan Corbet , linux-spi@vger.kernel.org, linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-doc@vger.kernel.org, linux-pwm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 03/13] spi: do not attempt to register DT nodes without @ in name Date: Wed, 10 Jan 2024 13:49:44 -0600 Message-ID: <20240109-axi-spi-engine-series-3-v1-3-e42c6a986580@baylibre.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240109-axi-spi-engine-series-3-v1-0-e42c6a986580@baylibre.com> References: <20240109-axi-spi-engine-series-3-v1-0-e42c6a986580@baylibre.com> 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" X-Mailer: b4 0.12.4 Content-Transfer-Encoding: 8bit In the DT bindings for SPI devices, it is specified that peripheral nodes have the @ character in the node name. A SPI controller may need to create bindings with child nodes that are not peripherals. For example, the AXI SPI Engine bindings will use an "offloads" child node to describe what is connected to the offload interfaces of the SPI controller. Without this change, the SPI controller would attempt to register all child nodes as SPI devices. After this change, only nodes with '@' in the name will be registered as SPI devices. Signed-off-by: David Lechner --- drivers/spi/spi.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c index f1d66b5d5491..5be5e654284c 100644 --- a/drivers/spi/spi.c +++ b/drivers/spi/spi.c @@ -2379,7 +2379,9 @@ static void of_register_spi_devices(struct spi_controller *ctlr) struct device_node *nc; for_each_available_child_of_node(ctlr->dev.of_node, nc) { - if (of_node_test_and_set_flag(nc, OF_POPULATED)) + /* Only nodes with '@' in the name are peripheral nodes. */ + if (of_node_test_and_set_flag(nc, OF_POPULATED) || + !strchr(kbasename(nc->full_name), '@')) continue; spi = of_register_spi_device(ctlr, nc); if (IS_ERR(spi)) { -- 2.43.0