From c177eabc12b5ea713fbf479c477f11bfe9c68dd1 Mon Sep 17 00:00:00 2001 From: Murali Nalajala Date: Wed, 18 Mar 2020 16:59:27 -0700 Subject: [PATCH] haven: rm: Use local dt properites for RM capids Use local dt properites for RM capability IDs per RM specification. Change-Id: I4a615194882970c6cfd16af52ba1deeb916ec7cc Signed-off-by: Elliot Berman Signed-off-by: Murali Nalajala --- drivers/virt/haven/hh_rm_core.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/drivers/virt/haven/hh_rm_core.c b/drivers/virt/haven/hh_rm_core.c index 4e35e84ea571..1852af316782 100644 --- a/drivers/virt/haven/hh_rm_core.c +++ b/drivers/virt/haven/hh_rm_core.c @@ -726,21 +726,20 @@ static const struct of_device_id hh_rm_drv_of_match[] = { static int hh_rm_drv_probe(struct platform_device *pdev) { - struct resource *rm_tx_res, *rm_rx_res; + struct device_node *node = pdev->dev.of_node; + hh_capid_t tx_cap_id, rx_cap_id; int tx_irq, rx_irq; u32 owner_vmid; int ret; - rm_tx_res = platform_get_resource_byname(pdev, IORESOURCE_MEM, - "rm-tx-cap-id"); - if (!rm_tx_res) { + ret = of_property_read_u64(node, "qcom,tx-cap", &tx_cap_id); + if (ret) { dev_err(&pdev->dev, "Failed to get the Tx cap-id\n"); return -EINVAL; } - rm_rx_res = platform_get_resource_byname(pdev, IORESOURCE_MEM, - "rm-rx-cap-id"); - if (!rm_rx_res) { + ret = of_property_read_u64(node, "qcom,rx-cap", &rx_cap_id); + if (ret) { dev_err(&pdev->dev, "Failed to get the Rx cap-id\n"); return -EINVAL; } @@ -771,12 +770,12 @@ static int hh_rm_drv_probe(struct platform_device *pdev) return -ENXIO; } - ret = hh_msgq_populate_cap_info(HH_MSGQ_LABEL_RM, rm_tx_res->start, + ret = hh_msgq_populate_cap_info(HH_MSGQ_LABEL_RM, tx_cap_id, HH_MSGQ_DIRECTION_TX, tx_irq); if (ret) return ret; - ret = hh_msgq_populate_cap_info(HH_MSGQ_LABEL_RM, rm_rx_res->start, + ret = hh_msgq_populate_cap_info(HH_MSGQ_LABEL_RM, rx_cap_id, HH_MSGQ_DIRECTION_RX, rx_irq); if (ret) return ret;