zephyr/kernel
Armando Visconti 4b4068c948 kernel/device: add arg checking in z_device_ready()
If this call receives an invalid device pointer as argument it
assumes that the `device` is not ready for usage.

This routine is currently called by two device specific APIs:

    - device_usable_check(const struct device *dev)
    - device_is_ready(const struct device *dev)

The device-specific APIs documentation claims that these two
routines must be called with a device pointer captured from
DEVICE_DT_GET(). So passing NULL is a violation of the rule.

Nevertheless, is quite common in drivers to assign NULL to
a device pointer if the corresponding DT property has not been
found (e.g. a not used gpio interrupt declaration for a given
device instance) and seems legit to interpret this condition
same as the device is not ready for usage.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2021-05-18 11:29:46 -05:00
..
include kernel/swap: Add assertion to catch lock-breaking context switches 2021-05-17 15:27:37 -04:00
paging kernel: enable using timing subsys to collect paging histograms 2021-04-06 16:43:55 -04:00
CMakeLists.txt cache: Introduce external cache controller system support 2021-05-08 07:00:33 +02:00
Kconfig ztest: set thread name to test name 2021-05-17 18:45:57 -04:00
atomic_c.c kernel: atomic: consistently use named type for atomic pointer values 2021-04-19 15:22:13 +02:00
banner.c
cache_handlers.c cache: Rename sys_{dcache,icache}_* to sys_{data,instr}_cache_* 2021-05-08 07:00:33 +02:00
compiler_stack_protect.c
condvar.c Tracing: Conditional variable tracing 2021-05-07 22:10:21 -04:00
device.c kernel/device: add arg checking in z_device_ready() 2021-05-18 11:29:46 -05:00
errno.c
fatal.c kernel: fatal: Avoid thread api access when no multithreading 2021-04-29 14:50:35 +02:00
futex.c kernel: Fix 10.4 violations 2021-04-10 09:59:37 -04:00
idle.c kernel: replace power/power.h with pm/pm.h 2021-05-05 18:35:49 -04:00
init.c kernel: init.c: tag source for boot/pinned sections 2021-05-10 16:00:43 -05:00
kheap.c Tracing: Memory Heap tracing 2021-05-07 22:10:21 -04:00
mailbox.c kernel: remove object tracing 2021-05-07 22:10:21 -04:00
mem_domain.c kernel: Make both operands of operators of same essential type category 2021-04-01 05:34:17 -04:00
mem_slab.c kernel: remove object tracing 2021-05-07 22:10:21 -04:00
mempool.c Tracing: Memory Heap tracing 2021-05-07 22:10:21 -04:00
mmu.c kernel: mmu: remove un-needed call to virt_to_bitmap_offset 2021-05-13 09:00:54 -05:00
msg_q.c kernel: remove object tracing 2021-05-07 22:10:21 -04:00
mutex.c kernel: remove object tracing 2021-05-07 22:10:21 -04:00
pipes.c kernel: remove object tracing 2021-05-07 22:10:21 -04:00
poll.c Tracing: Poll API and Work Poll tracing 2021-05-07 22:10:21 -04:00
queue.c kernel: remove object tracing 2021-05-07 22:10:21 -04:00
sched.c Tracing: Thread tracing 2021-05-07 22:10:21 -04:00
sem.c kernel: remove object tracing 2021-05-07 22:10:21 -04:00
smp.c smp: move a preprocessor conditional from .c to cmake 2021-05-03 17:13:01 -04:00
stack.c kernel: remove object tracing 2021-05-07 22:10:21 -04:00
system_work_q.c
thread.c Tracing: Thread tracing 2021-05-07 22:10:21 -04:00
timeout.c Tracing: Thread tracing 2021-05-07 22:10:21 -04:00
timer.c kernel: remove object tracing 2021-05-07 22:10:21 -04:00
userspace.c coding guidelines rule 14_3_j: add explicit case check 2021-05-18 08:36:57 -04:00
userspace_handler.c
version.c
work.c kernel: work: fix race condition with cancel before work runs 2021-05-18 15:02:08 +02:00
xip.c