@@ -71,6 +71,8 @@ static bool mailbox_chan_available(struct device_node *of_node, int idx)
{
int num_mb;
+ if (!of_node)
+ return false;
/*
* Just check if bidirrectional channels are involved, and check the
* index accordingly; proper full validation will be made later
@@ -334,6 +334,9 @@ static bool scmi_optee_chan_available(struct device_node *of_node, int idx)
{
u32 channel_id;
+ if (!of_node)
+ return false;
+
return !of_property_read_u32_index(of_node, "linaro,optee-channel-id",
idx, &channel_id);
}
@@ -81,7 +81,12 @@ static irqreturn_t smc_msg_done_isr(int irq, void *data)
static bool smc_chan_available(struct device_node *of_node, int idx)
{
- struct device_node *np = of_parse_phandle(of_node, "shmem", 0);
+ struct device_node *np;
+
+ if (!of_node)
+ return false;
+
+ np = of_parse_phandle(of_node, "shmem", 0);
if (!np)
return false;
@@ -389,6 +389,9 @@ static bool virtio_chan_available(struct device_node *of_node, int idx)
{
struct scmi_vio_channel *channels, *vioch = NULL;
+ if (!of_node)
+ return false;
+
if (WARN_ON_ONCE(!scmi_vdev))
return false;