From d0145b87af99be65edabfdcfb3e436f3d5ed8d1e Mon Sep 17 00:00:00 2001 From: Andrea Calabrese Date: Thu, 16 May 2024 16:59:19 +0200 Subject: [PATCH] Changed title for devres.c and added comments Added comments in almost all slides. To review. Signed-off-by: Andrea Calabrese --- drivers/base/devres.md | 78 +++++++++++++++++++++++++++++++++++++----- 1 file changed, 69 insertions(+), 9 deletions(-) diff --git a/drivers/base/devres.md b/drivers/base/devres.md index 39ff3e8..d179e55 100644 --- a/drivers/base/devres.md +++ b/drivers/base/devres.md @@ -38,7 +38,7 @@ layout: cover Authors: Flavia Caforio, Andrea Calabrese --- @@ -59,17 +59,11 @@ layout: section # Peripheral mapping - - - --- layout: default --- -# devres.c - structures TODO +# Overview ## Handle resource management @@ -86,6 +80,9 @@ layout: default - MEM - ... + --- layout: default @@ -107,6 +104,10 @@ hideInToc: true - Foreach cycles - Everything is exported under GPL! + + ### Low level drivers can be simplified a lot by using devres! --- hideInToc: true @@ -162,6 +163,11 @@ It contains many data included: - whether it is removable or not + + --- hideInToc: true dragPos: @@ -194,6 +200,10 @@ In this list it is possible to: - Perform operations on all entries (devres_for_each_res) + + --- layout: default hideInToc: true @@ -208,6 +218,12 @@ hideInToc: true - ...automatically remove everything possible! After all, devices are still under a tree + + + --- layout: default hideInToc: true @@ -237,6 +253,11 @@ struct devres_node { }; ``` + + --- layout: default --- @@ -293,6 +314,10 @@ void *__devres_alloc_node(dr_release_t release, size_t size, gfp_t gfp, int nid, } ``` + + --- layout: default hideInToc: true @@ -322,6 +347,11 @@ static __always_inline struct devres * alloc_dr(dr_release_t release, return dr; } ``` + + + --- layout: default hideInToc: true @@ -355,6 +385,13 @@ struct spi_controller *__devm_spi_alloc_controller(struct device *dev, return ctlr; } ``` + + + --- layout: default hideInToc: true @@ -383,6 +420,10 @@ static void add_dr(struct device *dev, struct devres_node *node) } ``` + + ```c static inline void __list_add(struct list_head *new, struct list_head *prev, struct list_head *next) @@ -431,6 +472,10 @@ struct spi_controller *__devm_spi_alloc_controller(struct device *dev, return ctlr; } ``` + + --- layout: default hideInToc: true @@ -449,6 +494,13 @@ void devres_free(void *res) } } ``` + + + --- layout: default --- @@ -481,6 +533,10 @@ int devres_destroy(struct device *dev, dr_release_t release, } ``` + + --- layout: default hideInToc: true @@ -508,6 +564,11 @@ void * devres_remove(struct device *dev, dr_release_t release, return NULL; } ``` + + + --- layout: default hideInToc: true @@ -744,7 +805,6 @@ int devres_release_group(struct device *dev, void *id) int cnt = 0; spin_lock_irqsave(&dev->devres_lock, flags); - grp = find_group(dev, id); if (grp) { struct list_head *first = &grp->node[0].entry;