mirror of
https://github.com/torvalds/linux.git
synced 2026-11-29 10:07:52 +00:00
firmware: arm_scmi: Add compatibility checks for shmem node
The shared memory node used for communication between the firmware and the OS should be compatible with "arm,scmi-shmem". Add the check for the same while parsing the node before fetching the memory regions. Link: https://lore.kernel.org/r/[email protected] Cc: Rob Herring <[email protected]> Cc: Cristian Marussi <[email protected]> Cc: Florian Fainelli <[email protected]> Cc: Jim Quinlan <[email protected]> Cc: Etienne Carriere <[email protected]> Reviewed-by: Florian Fainelli <[email protected]> Tested-by: Florian Fainelli <[email protected]> Reviewed-by: Cristian Marussi <[email protected]> Tested-by: Cristian Marussi <[email protected]> Signed-off-by: Sudeep Holla <[email protected]>
This commit is contained in:
@@ -69,6 +69,9 @@ static int mailbox_chan_setup(struct scmi_chan_info *cinfo, struct device *dev,
|
||||
return -ENOMEM;
|
||||
|
||||
shmem = of_parse_phandle(cdev->of_node, "shmem", idx);
|
||||
if (!of_device_is_compatible(shmem, "arm,scmi-shmem"))
|
||||
return -ENXIO;
|
||||
|
||||
ret = of_address_to_resource(shmem, 0, &res);
|
||||
of_node_put(shmem);
|
||||
if (ret) {
|
||||
|
||||
@@ -76,6 +76,9 @@ static int smc_chan_setup(struct scmi_chan_info *cinfo, struct device *dev,
|
||||
return -ENOMEM;
|
||||
|
||||
np = of_parse_phandle(cdev->of_node, "shmem", 0);
|
||||
if (!of_device_is_compatible(np, "arm,scmi-shmem"))
|
||||
return -ENXIO;
|
||||
|
||||
ret = of_address_to_resource(np, 0, &res);
|
||||
of_node_put(np);
|
||||
if (ret) {
|
||||
|
||||
Reference in New Issue
Block a user