From 1b92242888d7162dcd80efe907685394012e9565 Mon Sep 17 00:00:00 2001 From: Julio Cesar Carvalho de Paula Souza Date: Fri, 5 Dec 2025 08:21:38 -0300 Subject: [PATCH] staging: greybus: arche-apb-ctrl: switch to device_property_read_bool Switch from the deprecated of_property_read_bool() to the common device_property_read_bool() API. This makes the driver agnostic to the underlying firmware interface (DT or ACPI) and simplifies the logic. Since the driver is no longer strictly dependent on Device Tree, include directly for the struct of_device_id definition, instead of relying on implicit inclusion via , which has been removed as it is unused. Also rename apb_ctrl_get_devtree_data() to apb_ctrl_get_fw_data() to better reflect the agnostic nature of the new implementation. Signed-off-by: Julio Cesar Carvalho de Paula Souza Link: https://patch.msgid.link/20251205112138.3431-1-julio191096@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/greybus/arche-apb-ctrl.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/drivers/staging/greybus/arche-apb-ctrl.c b/drivers/staging/greybus/arche-apb-ctrl.c index 90ab32638d3f5..33f26a65f0cc0 100644 --- a/drivers/staging/greybus/arche-apb-ctrl.c +++ b/drivers/staging/greybus/arche-apb-ctrl.c @@ -10,13 +10,14 @@ #include #include #include -#include #include #include #include #include +#include #include #include +#include #include "arche_platform.h" static void apb_bootret_deassert(struct device *dev); @@ -314,8 +315,8 @@ static ssize_t state_show(struct device *dev, static DEVICE_ATTR_RW(state); -static int apb_ctrl_get_devtree_data(struct platform_device *pdev, - struct arche_apb_ctrl_drvdata *apb) +static int apb_ctrl_get_fw_data(struct platform_device *pdev, + struct arche_apb_ctrl_drvdata *apb) { struct device *dev = &pdev->dev; int ret; @@ -378,7 +379,7 @@ static int apb_ctrl_get_devtree_data(struct platform_device *pdev, } /* Only applicable for platform >= V2 */ - if (of_property_read_bool(pdev->dev.of_node, "gb,spi-en-active-high")) + if (device_property_read_bool(&pdev->dev, "gb,spi-en-active-high")) apb->spi_en_polarity_high = true; return 0; @@ -394,7 +395,7 @@ static int arche_apb_ctrl_probe(struct platform_device *pdev) if (!apb) return -ENOMEM; - ret = apb_ctrl_get_devtree_data(pdev, apb); + ret = apb_ctrl_get_fw_data(pdev, apb); if (ret) { dev_err(dev, "failed to get apb devicetree data %d\n", ret); return ret; @@ -403,7 +404,7 @@ static int arche_apb_ctrl_probe(struct platform_device *pdev) /* Initially set APB to OFF state */ apb->state = ARCHE_PLATFORM_STATE_OFF; /* Check whether device needs to be enabled on boot */ - if (of_property_read_bool(pdev->dev.of_node, "arche,init-disable")) + if (device_property_read_bool(&pdev->dev, "arche,init-disable")) apb->init_disabled = true; platform_set_drvdata(pdev, apb); -- 2.47.3