Skip to content

Commit 092d5c2

Browse files
sjg20trini
authored andcommitted
dm: core: Allow devres to be disabled in SPL
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 <[email protected]> Tested-by: Angus Ainslie <[email protected]>
1 parent 0c6be93 commit 092d5c2

File tree

6 files changed

+9
-9
lines changed

6 files changed

+9
-9
lines changed

drivers/core/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
obj-y += device.o fdtaddr.o lists.o root.o uclass.o util.o tag.o
66
obj-$(CONFIG_$(SPL_TPL_)ACPIGEN) += acpi.o
7-
obj-$(CONFIG_DEVRES) += devres.o
7+
obj-$(CONFIG_$(SPL_TPL_)DEVRES) += devres.o
88
obj-$(CONFIG_$(SPL_)DM_DEVICE_REMOVE) += device-remove.o
99
obj-$(CONFIG_$(SPL_)SIMPLE_BUS) += simple-bus.o
1010
obj-$(CONFIG_SIMPLE_PM_BUS) += simple-pm-bus.o

drivers/core/device.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ static int device_bind_common(struct udevice *parent, const struct driver *drv,
6868
INIT_LIST_HEAD(&dev->sibling_node);
6969
INIT_LIST_HEAD(&dev->child_head);
7070
INIT_LIST_HEAD(&dev->uclass_node);
71-
#ifdef CONFIG_DEVRES
71+
#if CONFIG_IS_ENABLED(DEVRES)
7272
INIT_LIST_HEAD(&dev->devres_head);
7373
#endif
7474
dev_set_plat(dev, plat);

include/dm/device-internal.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ fdt_addr_t simple_bus_translate(struct udevice *dev, fdt_addr_t addr);
397397
#define DM_UCLASS_ROOT_S_NON_CONST (((gd_t *)gd)->uclass_root_s)
398398

399399
/* device resource management */
400-
#ifdef CONFIG_DEVRES
400+
#if CONFIG_IS_ENABLED(DEVRES)
401401

402402
/**
403403
* devres_release_probe - Release managed resources allocated after probing
@@ -417,7 +417,7 @@ void devres_release_probe(struct udevice *dev);
417417
*/
418418
void devres_release_all(struct udevice *dev);
419419

420-
#else /* ! CONFIG_DEVRES */
420+
#else /* ! DEVRES */
421421

422422
static inline void devres_release_probe(struct udevice *dev)
423423
{
@@ -427,7 +427,7 @@ static inline void devres_release_all(struct udevice *dev)
427427
{
428428
}
429429

430-
#endif /* ! CONFIG_DEVRES */
430+
#endif /* DEVRES */
431431

432432
static inline int device_notify(const struct udevice *dev, enum event_t type)
433433
{

include/dm/device.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ struct udevice {
184184
#if CONFIG_IS_ENABLED(OF_REAL)
185185
ofnode node_;
186186
#endif
187-
#ifdef CONFIG_DEVRES
187+
#if CONFIG_IS_ENABLED(DEVRES)
188188
struct list_head devres_head;
189189
#endif
190190
#if CONFIG_IS_ENABLED(DM_DMA)

include/dm/devres.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ struct devres_stats {
3030
int total_size;
3131
};
3232

33-
#ifdef CONFIG_DEVRES
33+
#if CONFIG_IS_ENABLED(DEVRES)
3434

3535
#ifdef CONFIG_DEBUG_DEVRES
3636
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);
207207
/* Get basic stats on allocations */
208208
void devres_get_stats(const struct udevice *dev, struct devres_stats *stats);
209209

210-
#else /* ! CONFIG_DEVRES */
210+
#else /* ! DEVRES */
211211

212212
static inline void *devres_alloc(dr_release_t release, size_t size, gfp_t gfp)
213213
{

test/dm/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ obj-$(CONFIG_CLK) += clk.o clk_ccf.o
3232
obj-$(CONFIG_CPU) += cpu.o
3333
obj-$(CONFIG_CROS_EC) += cros_ec.o
3434
obj-$(CONFIG_PWM_CROS_EC) += cros_ec_pwm.o
35-
obj-$(CONFIG_DEVRES) += devres.o
35+
obj-$(CONFIG_$(SPL_TPL_)DEVRES) += devres.o
3636
obj-$(CONFIG_DMA) += dma.o
3737
obj-$(CONFIG_VIDEO_MIPI_DSI) += dsi_host.o
3838
obj-$(CONFIG_DM_DSA) += dsa.o

0 commit comments

Comments
 (0)