Commit 83192c71 authored by Celina Sophie Kalus's avatar Celina Sophie Kalus Committed by Fabio Baltieri
Browse files

drivers: ipm: esp32: Allow doorbell without data transfer



IPM drivers are commonly used to send notifications/cause interrupts
without any transfer of data. To add this use case in the ESP32 IPM
driver, the guard statement is appended so that the pointer to the
data buffer is allowed to be zero only if the size of the data to be
transferred is zero. If size is given as 0 and data is equal to NULL,
we are thus only using the IPM as a doorbell, not to transfer data.

Signed-off-by: default avatarCelina Sophie Kalus <hello@celinakalus.de>
parent a7ca6e5c
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -95,7 +95,7 @@ static int esp32_ipm_send(const struct device *dev, int wait, uint32_t id,
{
	struct esp32_ipm_data *dev_data = (struct esp32_ipm_data *)dev->data;

	if (data == NULL) {
	if (size > 0 && data == NULL) {
		LOG_ERR("Invalid data source");
		return -EINVAL;
	}