mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2025-02-12 23:29:17 +08:00
[DM] Replace spinlock static init by RT_DEFINE_SPINLOCK
Signed-off-by: GuEe-GUI <2991707448@qq.com>
This commit is contained in:
parent
f20e8973be
commit
f506076281
@ -26,7 +26,7 @@
|
||||
#define DBG_LVL DBG_INFO
|
||||
#include <rtdbg.h>
|
||||
|
||||
static struct rt_spinlock _clk_lock = { 0 };
|
||||
static RT_DEFINE_SPINLOCK(_clk_lock);
|
||||
static rt_list_t _clk_nodes = RT_LIST_OBJECT_INIT(_clk_nodes);
|
||||
static rt_list_t _clk_notifier_nodes = RT_LIST_OBJECT_INIT(_clk_notifier_nodes);
|
||||
|
||||
|
@ -86,7 +86,7 @@ rt_err_t rt_device_bus_destroy(rt_device_t dev)
|
||||
#ifdef RT_USING_DM
|
||||
#include <drivers/core/bus.h>
|
||||
|
||||
static struct rt_spinlock bus_lock = {};
|
||||
static RT_DEFINE_SPINLOCK(bus_lock);
|
||||
static rt_list_t bus_nodes = RT_LIST_OBJECT_INIT(bus_nodes);
|
||||
|
||||
static void _dm_bus_lock(struct rt_spinlock *spinlock)
|
||||
|
@ -191,7 +191,7 @@ struct prefix_track
|
||||
int uid;
|
||||
const char *prefix;
|
||||
};
|
||||
static struct rt_spinlock _prefix_nodes_lock = { 0 };
|
||||
static RT_DEFINE_SPINLOCK(_prefix_nodes_lock);
|
||||
static rt_list_t _prefix_nodes = RT_LIST_OBJECT_INIT(_prefix_nodes);
|
||||
|
||||
int rt_dm_dev_set_name_auto(rt_device_t dev, const char *prefix)
|
||||
|
@ -17,7 +17,7 @@
|
||||
#include <rtdbg.h>
|
||||
|
||||
static rt_list_t dmac_nodes = RT_LIST_OBJECT_INIT(dmac_nodes);
|
||||
static struct rt_spinlock dmac_nodes_lock = {};
|
||||
static RT_DEFINE_SPINLOCK(dmac_nodes_lock);
|
||||
|
||||
rt_err_t rt_dma_controller_register(struct rt_dma_controller *ctrl)
|
||||
{
|
||||
|
@ -19,7 +19,7 @@
|
||||
#include <mm_aspace.h>
|
||||
#include <dt-bindings/size.h>
|
||||
|
||||
static struct rt_spinlock dma_pools_lock = {};
|
||||
static RT_DEFINE_SPINLOCK(dma_pools_lock);
|
||||
static rt_list_t dma_pool_nodes = RT_LIST_OBJECT_INIT(dma_pool_nodes);
|
||||
|
||||
static struct rt_dma_pool *dma_pool_install(rt_region_t *region);
|
||||
|
@ -20,7 +20,7 @@
|
||||
#include <drivers/platform.h>
|
||||
#include <drivers/core/dm.h>
|
||||
|
||||
static struct rt_spinlock mbox_ops_lock = {};
|
||||
static RT_DEFINE_SPINLOCK(mbox_ops_lock);
|
||||
static rt_list_t mbox_nodes = RT_LIST_OBJECT_INIT(mbox_nodes);
|
||||
|
||||
static void mbox_chan_timeout(void *param);
|
||||
|
@ -17,7 +17,7 @@
|
||||
#include <drivers/core/dm.h>
|
||||
#include <drivers/platform.h>
|
||||
|
||||
static struct rt_spinlock _syscon_nodes_lock = { 0 };
|
||||
static RT_DEFINE_SPINLOCK(_syscon_nodes_lock);
|
||||
static rt_list_t _syscon_nodes = RT_LIST_OBJECT_INIT(_syscon_nodes);
|
||||
|
||||
rt_err_t rt_syscon_read(struct rt_syscon *syscon, rt_off_t offset, rt_uint32_t *out_val)
|
||||
|
@ -19,7 +19,7 @@
|
||||
static struct rt_dm_ida nvme_controller_ida = RT_DM_IDA_INIT(CUSTOM);
|
||||
static struct rt_dm_ida nvme_ida = RT_DM_IDA_INIT(NVME);
|
||||
|
||||
static struct rt_spinlock nvme_lock = {};
|
||||
static RT_DEFINE_SPINLOCK(nvme_lock);
|
||||
static rt_list_t nvme_nodes = RT_LIST_OBJECT_INIT(nvme_nodes);
|
||||
|
||||
rt_inline rt_uint32_t nvme_readl(struct rt_nvme_controller *nvme, int offset)
|
||||
|
@ -84,7 +84,7 @@ rt_err_t ofw_phandle_hash_reset(rt_phandle min, rt_phandle max)
|
||||
static rt_phandle ofw_phandle_next(void)
|
||||
{
|
||||
rt_phandle next;
|
||||
static struct rt_spinlock op_lock = {};
|
||||
static RT_DEFINE_SPINLOCK(op_lock);
|
||||
|
||||
rt_hw_spin_lock(&op_lock.lock);
|
||||
|
||||
|
@ -15,7 +15,7 @@
|
||||
#include <rtdbg.h>
|
||||
|
||||
static rt_list_t _ep_nodes = RT_LIST_OBJECT_INIT(_ep_nodes);
|
||||
static struct rt_spinlock _ep_lock = { 0 };
|
||||
static RT_DEFINE_SPINLOCK(_ep_lock);
|
||||
|
||||
rt_err_t rt_pci_ep_write_header(struct rt_pci_ep *ep, rt_uint8_t func_no,
|
||||
struct rt_pci_ep_header *hdr)
|
||||
|
@ -14,7 +14,7 @@
|
||||
#define DBG_LVL DBG_INFO
|
||||
#include <rtdbg.h>
|
||||
|
||||
static struct rt_spinlock msi_irq_map_lock = {};
|
||||
static RT_DEFINE_SPINLOCK(msi_irq_map_lock);
|
||||
static RT_BITMAP_DECLARE(msi_irq_map, MAX_HANDLERS) = {};
|
||||
|
||||
rt_err_t rt_pci_msi_setup_irqs(struct rt_pci_device *pdev, int nvec, int type)
|
||||
|
@ -87,7 +87,7 @@ rt_err_t gic_common_configure_irq(void *base, int irq, rt_uint32_t mode, void (*
|
||||
rt_uint32_t val, oldval;
|
||||
rt_uint32_t confoff = (irq / 16) * 4;
|
||||
rt_uint32_t confmask = 0x2 << ((irq % 16) * 2);
|
||||
static struct rt_spinlock ic_lock = { 0 };
|
||||
static RT_DEFINE_SPINLOCK(ic_lock);
|
||||
|
||||
level = rt_spin_lock_irqsave(&ic_lock);
|
||||
|
||||
|
@ -224,7 +224,7 @@ static rt_err_t gicv2_irq_set_affinity(struct rt_pic_irq *pirq, rt_bitmap_t *aff
|
||||
rt_uint32_t val;
|
||||
rt_ubase_t level;
|
||||
rt_ubase_t offset = (rt_ubase_t)io_addr & 3UL, shift = offset * 8;
|
||||
static struct rt_spinlock rmw_lock = {};
|
||||
static RT_DEFINE_SPINLOCK(rmw_lock);
|
||||
|
||||
level = rt_spin_lock_irqsave(&rmw_lock);
|
||||
|
||||
|
@ -121,7 +121,8 @@ static rt_uint32_t lpi_id_bits;
|
||||
static void *lpi_table;
|
||||
static void *lpi_pending_table;
|
||||
static rt_bitmap_t *lpis_vectors = RT_NULL;
|
||||
static struct rt_spinlock lpis_lock = {}, map_lock = {};
|
||||
static RT_DEFINE_SPINLOCK(lpis_lock);
|
||||
static RT_DEFINE_SPINLOCK(map_lock);
|
||||
static rt_list_t its_nodes = RT_LIST_OBJECT_INIT(its_nodes);
|
||||
static rt_list_t map_nodes = RT_LIST_OBJECT_INIT(map_nodes);
|
||||
|
||||
|
@ -51,7 +51,7 @@ static struct rt_pic_irq _pirq_hash[MAX_HANDLERS] =
|
||||
}
|
||||
};
|
||||
|
||||
static struct rt_spinlock _pic_lock = { };
|
||||
static RT_DEFINE_SPINLOCK(_pic_lock);
|
||||
static rt_size_t _pic_name_max = sizeof("PIC");
|
||||
static rt_list_t _pic_nodes = RT_LIST_OBJECT_INIT(_pic_nodes);
|
||||
static rt_list_t _traps_nodes = RT_LIST_OBJECT_INIT(_traps_nodes);
|
||||
|
@ -11,7 +11,7 @@
|
||||
#include "dev_pin_dm.h"
|
||||
|
||||
static rt_size_t pin_total_nr = 0;
|
||||
static struct rt_spinlock pin_lock = {};
|
||||
static RT_DEFINE_SPINLOCK(pin_lock);
|
||||
static rt_list_t pin_nodes = RT_LIST_OBJECT_INIT(pin_nodes);
|
||||
|
||||
static struct rt_device_pin *pin_device_find(rt_ubase_t pin)
|
||||
|
@ -24,7 +24,7 @@ struct rt_regulator
|
||||
struct rt_regulator_node *reg_np;
|
||||
};
|
||||
|
||||
static struct rt_spinlock _regulator_lock = { 0 };
|
||||
static RT_DEFINE_SPINLOCK(_regulator_lock);
|
||||
|
||||
static rt_err_t regulator_enable(struct rt_regulator_node *reg_np);
|
||||
static rt_err_t regulator_disable(struct rt_regulator_node *reg_np);
|
||||
|
@ -23,7 +23,7 @@
|
||||
#define device_list(dev) (dev)->parent.parent.list
|
||||
#define device_foreach(dev, nodes) rt_list_for_each_entry(dev, nodes, parent.parent.list)
|
||||
|
||||
static struct rt_spinlock nodes_lock = {};
|
||||
static RT_DEFINE_SPINLOCK(nodes_lock);
|
||||
static rt_list_t thermal_zone_device_nodes = RT_LIST_OBJECT_INIT(thermal_zone_device_nodes);
|
||||
static rt_list_t thermal_cooling_device_nodes = RT_LIST_OBJECT_INIT(thermal_cooling_device_nodes);
|
||||
static rt_list_t thermal_cooling_governor_nodes = RT_LIST_OBJECT_INIT(thermal_cooling_governor_nodes);
|
||||
|
Loading…
x
Reference in New Issue
Block a user