Skip to content

Commit

Permalink
xrp-kernel: replace of_property_read* with device_property_read*
Browse files Browse the repository at this point in the history
Prepare simple HW driver to be used on ACPI systems: use generic
configuration data accessors instead of OF-specific.

Signed-off-by: Max Filippov <[email protected]>
  • Loading branch information
jcmvbkbc committed Jul 15, 2021
1 parent df3c7a9 commit 8265983
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions xrp-kernel/xrp_hw_simple.c
Original file line number Diff line number Diff line change
Expand Up @@ -294,16 +294,16 @@ static long init_hw(struct platform_device *pdev, struct xrp_hw_simple *hw,
pr_debug("%s: regs = %pap/%p\n",
__func__, &mem->start, hw->regs);

ret = of_property_read_u32_array(pdev->dev.of_node,
"device-irq",
hw->device_irq,
ARRAY_SIZE(hw->device_irq));
ret = device_property_read_u32_array(&pdev->dev,
"device-irq",
hw->device_irq,
ARRAY_SIZE(hw->device_irq));
if (ret == 0) {
u32 device_irq_host_offset;

ret = of_property_read_u32(pdev->dev.of_node,
"device-irq-host-offset",
&device_irq_host_offset);
ret = device_property_read_u32(&pdev->dev,
"device-irq-host-offset",
&device_irq_host_offset);
if (ret == 0) {
hw->device_irq_host_offset = device_irq_host_offset;
} else {
Expand All @@ -314,9 +314,9 @@ static long init_hw(struct platform_device *pdev, struct xrp_hw_simple *hw,
if (ret == 0) {
u32 device_irq_mode;

ret = of_property_read_u32(pdev->dev.of_node,
"device-irq-mode",
&device_irq_mode);
ret = device_property_read_u32(&pdev->dev,
"device-irq-mode",
&device_irq_mode);
if (device_irq_mode < XRP_IRQ_MAX)
hw->device_irq_mode = device_irq_mode;
else
Expand All @@ -333,15 +333,15 @@ static long init_hw(struct platform_device *pdev, struct xrp_hw_simple *hw,
"using polling mode on the device side\n");
}

ret = of_property_read_u32_array(pdev->dev.of_node, "host-irq",
hw->host_irq,
ARRAY_SIZE(hw->host_irq));
ret = device_property_read_u32_array(&pdev->dev, "host-irq",
hw->host_irq,
ARRAY_SIZE(hw->host_irq));
if (ret == 0) {
u32 host_irq_mode;

ret = of_property_read_u32(pdev->dev.of_node,
"host-irq-mode",
&host_irq_mode);
ret = device_property_read_u32(&pdev->dev,
"host-irq-mode",
&host_irq_mode);
if (host_irq_mode < XRP_IRQ_MAX)
hw->host_irq_mode = host_irq_mode;
else
Expand Down

0 comments on commit 8265983

Please sign in to comment.