Message ID | 20210315172537.v4.8.Icde748d3063580acf92b185f675701c077b72ba8@changeid |
---|---|
State | Accepted |
Commit | 91bcfdf0b6683681c557db55e1d74424fb1cc4fe |
Delegated to: | Simon Glass |
Headers | show
Return-Path: <u-boot-bounces@lists.denx.de> X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=<UNKNOWN>) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=VJyuvu0f; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4DzNhh5jB5z9sR4 for <incoming@patchwork.ozlabs.org>; Mon, 15 Mar 2021 15:28:36 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 2BFEB82977; Mon, 15 Mar 2021 05:27:51 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="VJyuvu0f"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 240FC82965; Mon, 15 Mar 2021 05:27:44 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pl1-x633.google.com (mail-pl1-x633.google.com [IPv6:2607:f8b0:4864:20::633]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id B917182932 for <u-boot@lists.denx.de>; Mon, 15 Mar 2021 05:27:40 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-pl1-x633.google.com with SMTP id u18so14631938plc.12 for <u-boot@lists.denx.de>; Sun, 14 Mar 2021 21:27:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=USwER676+/ERqCZrzEib2NEVcyBCFgnCbazOcbA+c/A=; b=VJyuvu0fSmo1Dj4+wlR/vEgkw5CJFxSNNrz0ZF0nCv/DnOfPjGqW2DZK/inR3fgxd2 Lj7jNvtVotSmlNoy8E1qVtMfhmhRSwMOEjbViZT/R/3vFop6pMQ+/V4jRLEhro7Ilxpx Hhu13+ZfqMG/dt+do6b6jdZyS47dEi9x8EasM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=USwER676+/ERqCZrzEib2NEVcyBCFgnCbazOcbA+c/A=; b=cEy80xTZDlgYOJxmolwPMThS/QMFbkLeXUOKebwc4P7tNqDLr9NvDghP2GBxqK0SVv xf3IZ7p3VvR/nun9fARndY+4tD+AqMO0P8LaUfMeTxqZuqZ1gQBY7+U+DtLMMWUwjK8j q1lFO2mZLnkJdN7OjlTQq78Ec/AabnPHRnZiQtQ7GUviPoqvt4gIc9oFB6GEd+IEJxtT kfTsqz9gFLU1LgKFFTztby8nYR8AqXdnxZTs4OLclT77TCCdgrTDjTh2wgvC3Ayorlet 37funFJulunhan8cA/dQMMN+/a55TILU21vVbX9YfbMFkQJpTJO+AMfDgHpADMmcXy/i xndA== X-Gm-Message-State: AOAM532AN8eXjPUO+/eq4U26P4tOXE+bFYe+gBQYUx6YMppLtVsyRtuE LHFVXQ4domvQrf2o7yM0SNMm6TCwOQvheM8c X-Google-Smtp-Source: ABdhPJyNlOqMMyXFkFxleFuJhBUlAfFbDcezqQU3FtiBk9vMOKsx6qdcyEtrm22GvM1qY14fjrPT7w== X-Received: by 2002:a17:90a:a4cb:: with SMTP id l11mr10478875pjw.144.1615782459171; Sun, 14 Mar 2021 21:27:39 -0700 (PDT) Received: from sjg1.roam.corp.google.com (85.72.69.111.dynamic.snap.net.nz. [111.69.72.85]) by smtp.gmail.com with ESMTPSA id u22sm11239481pgh.20.2021.03.14.21.27.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 14 Mar 2021 21:27:38 -0700 (PDT) From: Simon Glass <sjg@chromium.org> To: U-Boot Mailing List <u-boot@lists.denx.de> Cc: Tom Rini <trini@konsulko.com>, Heinrich Schuchardt <xypron.glpk@gmx.de>, Marek Vasut <marex@denx.de>, Bin Meng <bmeng.cn@gmail.com>, Walter Lozano <walter.lozano@collabora.com>, Bernhard Messerklinger <bernhard.messerklinger@br-automation.com>, Simon Glass <sjg@chromium.org>, Pavel Herrmann <morpheus.ibis@gmail.com> Subject: [PATCH v4 08/42] dm: core: Skip adding uclasses with OF_PLATDATA_INST Date: Mon, 15 Mar 2021 17:25:18 +1300 Message-Id: <20210315172537.v4.8.Icde748d3063580acf92b185f675701c077b72ba8@changeid> X-Mailer: git-send-email 2.31.0.rc2.261.g7f71774620-goog In-Reply-To: <20210315042553.1932494-1-sjg@chromium.org> References: <20210315042553.1932494-1-sjg@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion <u-boot.lists.denx.de> List-Unsubscribe: <https://lists.denx.de/options/u-boot>, <mailto:u-boot-request@lists.denx.de?subject=unsubscribe> List-Archive: <https://lists.denx.de/pipermail/u-boot/> List-Post: <mailto:u-boot@lists.denx.de> List-Help: <mailto:u-boot-request@lists.denx.de?subject=help> List-Subscribe: <https://lists.denx.de/listinfo/u-boot>, <mailto:u-boot-request@lists.denx.de?subject=subscribe> Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" <u-boot-bounces@lists.denx.de> X-Virus-Scanned: clamav-milter 0.102.4 at phobos.denx.de X-Virus-Status: Clean |
Series |
dm: Implement OF_PLATDATA_INST in driver model (part E)
|
expand
|
There is no need to ever add new uclasses since these are set up at build
time. Update the code to return an error if this is attempted.
Signed-off-by: Simon Glass <sjg@chromium.org>
---
(no changes since v1)
drivers/core/uclass.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
Applied to u-boot-dm/next, thanks!
diff --git a/drivers/core/uclass.c b/drivers/core/uclass.c index 1a4ea7a57a6..f753a1f91e7 100644 --- a/drivers/core/uclass.c +++ b/drivers/core/uclass.c @@ -148,8 +148,11 @@ int uclass_get(enum uclass_id id, struct uclass **ucp) *ucp = NULL; uc = uclass_find(id); - if (!uc) + if (!uc) { + if (CONFIG_IS_ENABLED(OF_PLATDATA_INST)) + return -ENOENT; return uclass_add(id, ucp); + } *ucp = uc; return 0;
There is no need to ever add new uclasses since these are set up at build time. Update the code to return an error if this is attempted. Signed-off-by: Simon Glass <sjg@chromium.org> --- (no changes since v1) drivers/core/uclass.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)