All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Glass <sjg@chromium.org>
To: U-Boot Mailing List <u-boot@lists.denx.de>
Cc: "Heinrich Schuchardt" <xypron.glpk@gmx.de>,
	"Sean Anderson" <seanga2@gmail.com>,
	"Marek Behún" <marek.behun@nic.cz>,
	"U-Boot Custodians" <u-boot-custodians@lists.denx.de>,
	"Tom Rini" <trini@konsulko.com>, "Simon Glass" <sjg@chromium.org>,
	"Marek Vasut" <marex@denx.de>,
	"Pavel Herrmann" <morpheus.ibis@gmail.com>
Subject: [PATCH 07/10] dm: core: Allow devres to be disabled in SPL
Date: Sun, 27 Mar 2022 14:26:19 -0600	[thread overview]
Message-ID: <20220327142415.7.I1c802c77c131021c932f0fd418b837e2efbd5bbc@changeid> (raw)
In-Reply-To: <20220327202622.3438333-1-sjg@chromium.org>

At present if devres is enabled in U-Boot proper it is enabled in SPL.
We don't normally want it there, so disable it.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

 drivers/core/Makefile        | 2 +-
 drivers/core/device.c        | 2 +-
 include/dm/device-internal.h | 6 +++---
 include/dm/device.h          | 2 +-
 include/dm/devres.h          | 4 ++--
 test/dm/Makefile             | 2 +-
 6 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/core/Makefile b/drivers/core/Makefile
index 5edd4e41357..0cbc3ab217e 100644
--- a/drivers/core/Makefile
+++ b/drivers/core/Makefile
@@ -4,7 +4,7 @@
 
 obj-y	+= device.o fdtaddr.o lists.o root.o uclass.o util.o
 obj-$(CONFIG_$(SPL_TPL_)ACPIGEN) += acpi.o
-obj-$(CONFIG_DEVRES) += devres.o
+obj-$(CONFIG_$(SPL_TPL_)DEVRES) += devres.o
 obj-$(CONFIG_$(SPL_)DM_DEVICE_REMOVE)	+= device-remove.o
 obj-$(CONFIG_$(SPL_)SIMPLE_BUS)	+= simple-bus.o
 obj-$(CONFIG_SIMPLE_PM_BUS)	+= simple-pm-bus.o
diff --git a/drivers/core/device.c b/drivers/core/device.c
index 1b356f12dd8..b7ce8544140 100644
--- a/drivers/core/device.c
+++ b/drivers/core/device.c
@@ -68,7 +68,7 @@ static int device_bind_common(struct udevice *parent, const struct driver *drv,
 	INIT_LIST_HEAD(&dev->sibling_node);
 	INIT_LIST_HEAD(&dev->child_head);
 	INIT_LIST_HEAD(&dev->uclass_node);
-#ifdef CONFIG_DEVRES
+#if CONFIG_IS_ENABLED(DEVRES)
 	INIT_LIST_HEAD(&dev->devres_head);
 #endif
 	dev_set_plat(dev, plat);
diff --git a/include/dm/device-internal.h b/include/dm/device-internal.h
index c420726287e..2fc41f31f5a 100644
--- a/include/dm/device-internal.h
+++ b/include/dm/device-internal.h
@@ -396,7 +396,7 @@ fdt_addr_t simple_bus_translate(struct udevice *dev, fdt_addr_t addr);
 #define DM_UCLASS_ROOT_S_NON_CONST	(((gd_t *)gd)->uclass_root_s)
 
 /* device resource management */
-#ifdef CONFIG_DEVRES
+#if CONFIG_IS_ENABLED(DEVRES)
 
 /**
  * devres_release_probe - Release managed resources allocated after probing
@@ -416,7 +416,7 @@ void devres_release_probe(struct udevice *dev);
  */
 void devres_release_all(struct udevice *dev);
 
-#else /* ! CONFIG_DEVRES */
+#else /* ! DEVRES */
 
 static inline void devres_release_probe(struct udevice *dev)
 {
@@ -426,7 +426,7 @@ static inline void devres_release_all(struct udevice *dev)
 {
 }
 
-#endif /* ! CONFIG_DEVRES */
+#endif /* DEVRES */
 
 static inline int device_notify(const struct udevice *dev, enum event_t type)
 {
diff --git a/include/dm/device.h b/include/dm/device.h
index cb52a0997c8..3d8961f9ac6 100644
--- a/include/dm/device.h
+++ b/include/dm/device.h
@@ -184,7 +184,7 @@ struct udevice {
 #if CONFIG_IS_ENABLED(OF_REAL)
 	ofnode node_;
 #endif
-#ifdef CONFIG_DEVRES
+#if CONFIG_IS_ENABLED(DEVRES)
 	struct list_head devres_head;
 #endif
 #if CONFIG_IS_ENABLED(DM_DMA)
diff --git a/include/dm/devres.h b/include/dm/devres.h
index 0ab277ec38e..697534aa5be 100644
--- a/include/dm/devres.h
+++ b/include/dm/devres.h
@@ -30,7 +30,7 @@ struct devres_stats {
 	int total_size;
 };
 
-#ifdef CONFIG_DEVRES
+#if CONFIG_IS_ENABLED(DEVRES)
 
 #ifdef CONFIG_DEBUG_DEVRES
 void *__devres_alloc(dr_release_t release, size_t size, gfp_t gfp,
@@ -207,7 +207,7 @@ void devm_kfree(struct udevice *dev, void *ptr);
 /* Get basic stats on allocations */
 void devres_get_stats(const struct udevice *dev, struct devres_stats *stats);
 
-#else /* ! CONFIG_DEVRES */
+#else /* ! DEVRES */
 
 static inline void *devres_alloc(dr_release_t release, size_t size, gfp_t gfp)
 {
diff --git a/test/dm/Makefile b/test/dm/Makefile
index d46552fbf32..9a1a904d906 100644
--- a/test/dm/Makefile
+++ b/test/dm/Makefile
@@ -32,7 +32,7 @@ obj-$(CONFIG_CLK) += clk.o clk_ccf.o
 obj-$(CONFIG_CPU) += cpu.o
 obj-$(CONFIG_CROS_EC) += cros_ec.o
 obj-$(CONFIG_PWM_CROS_EC) += cros_ec_pwm.o
-obj-$(CONFIG_DEVRES) += devres.o
+obj-$(CONFIG_$(SPL_TPL_)DEVRES) += devres.o
 obj-$(CONFIG_DMA) += dma.o
 obj-$(CONFIG_VIDEO_MIPI_DSI) += dsi_host.o
 obj-$(CONFIG_DM_DSA) += dsa.o
-- 
2.35.1.1021.g381101b075-goog


  parent reply	other threads:[~2022-03-27 20:28 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-27 20:26 [PATCH 00/10] dm: Experiments for reducing SPL memory usage Simon Glass
2022-03-27 20:26 ` [PATCH 01/10] Makefile: v2 Allow LTO to be disabled for a build Simon Glass
2022-03-31 10:29   ` Andrew Scull
2022-04-11 21:46     ` Simon Glass
2022-04-11 21:53       ` Tom Rini
2022-05-15 18:52       ` Andrew Scull
2022-03-27 20:26 ` [PATCH 02/10] sandbox: Correct loss of early output in SPL Simon Glass
2022-04-19 12:49   ` Tom Rini
2022-03-27 20:26 ` [PATCH 03/10] Makefile: Drop a stale comment about linking Simon Glass
2022-04-19 12:49   ` Tom Rini
2022-03-27 20:26 ` [PATCH 04/10] Makefile: Avoid resetting link flags in config.mk Simon Glass
2022-04-19 12:49   ` Tom Rini
2022-03-27 20:26 ` [PATCH 05/10] sandbox: Allow link flags to be given Simon Glass
2022-04-19 12:49   ` Tom Rini
2022-03-27 20:26 ` [PATCH 06/10] sandbox: Align linker lists to a 32-byte boundary Simon Glass
2022-04-19 12:49   ` Tom Rini
2022-03-27 20:26 ` Simon Glass [this message]
2022-04-12 19:07   ` [PATCH 07/10] dm: core: Allow devres to be disabled in SPL Angus Ainslie
2022-04-19 12:49   ` Tom Rini
2022-03-27 20:26 ` [PATCH 08/10] dm: core: Deal with a wrinkle with linker lists Simon Glass
2022-04-19 12:50   ` Tom Rini
2022-03-27 20:26 ` [PATCH 09/10] RFC: dm: add tag support Simon Glass
2022-03-27 20:26 ` [PATCH 10/10] WIP: dm: core: Add a command to calculate memory usage Simon Glass

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220327142415.7.I1c802c77c131021c932f0fd418b837e2efbd5bbc@changeid \
    --to=sjg@chromium.org \
    --cc=marek.behun@nic.cz \
    --cc=marex@denx.de \
    --cc=morpheus.ibis@gmail.com \
    --cc=seanga2@gmail.com \
    --cc=trini@konsulko.com \
    --cc=u-boot-custodians@lists.denx.de \
    --cc=u-boot@lists.denx.de \
    --cc=xypron.glpk@gmx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.