From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-vk1-f179.google.com (mail-vk1-f179.google.com [209.85.221.179]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2EAE730BB94 for ; Fri, 5 Dec 2025 11:06:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.179 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764932784; cv=none; b=JguhREhHVXh9LvI1TomdergJxGITCy895R1AMMzGKS6lB5MwkWIJy1y15ZtMPY8+N27bDsC3q23U+yU9u964rty6Xrx5NIyhie16oqU26DDzRbQfMn2C0jltf0rPRncE0iWag3Iwtjfgfwtnz9yjkFlLBTN99LFueG0uRpc7LT4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764932784; c=relaxed/simple; bh=VYSDlK+wO3E5LHx9wHLxp5XNwDhXtCkLn4TZNQfl3Mk=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=ZJjVie/IES96HXhU+s9HaMJEPLL/t4s8gkpD37h/yoL4NluZCOnsyECWegumIWCcIvtq9yRNC42horOm957FS0TZS9j6IM/qEvY03/hkGH8G9dSm5U5SDkg2FW9/rz/PC4wEoN1yxVXIBR41XiMhH21tvLnCkt+HCBGKOuiBNHA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=B4Ezku8v; arc=none smtp.client-ip=209.85.221.179 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="B4Ezku8v" Received: by mail-vk1-f179.google.com with SMTP id 71dfb90a1353d-55b26461e78so614214e0c.3 for ; Fri, 05 Dec 2025 03:06:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1764932780; x=1765537580; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=KZhvelUTNVQjpCwZjkIiRYWFFb4bmI4pkoHsXqQN7X4=; b=B4Ezku8vvck1amJfbUzY7k3ixBHgpgM6ZS3RGZtChvCeoPhaOdOr4RmVgU9vsaweqm v9QJz9NGHW+sU7rdQS66C8bKy/GuOH7pj+Aki/QJlzL0ZX7NQKA+5ZSXuQwl52e7V/ix OSdi9OU9nBZyMF+F3iHKuqW+22qg3zz54cPHkRhN7efWIW7ZlqKnJ+AKBIygkvxafjSH LPfgr85dy+Qs5EQ+XGjRP5ChMiJh/IItIdaNnTK5tBlLv13TH+IDAUFNITATe1K9wL3z xj7uKbHFBiB5yDXI/zm8m5B0PAiu9J4RjP4fmkmwJih/7HgpOKN/4ehujvJ7IokV8dAK Lepg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1764932780; x=1765537580; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=KZhvelUTNVQjpCwZjkIiRYWFFb4bmI4pkoHsXqQN7X4=; b=RTPD2BaZOnrIMUFfr+VsY/8CQloBUCKQXUNkHMuNBuLpRGDd3kVww9E1iG2K7zhQJd WihiqIkX4dWSuwiBu7SwqWWnyDsIZJ/pZtj5OxocwRSFulIFuASrzL0a2y1A6Pcckseg 0KJq4/p7hbX+R2TLcgkSkUK6IsUuSRHCbXqncazK57ZeeqLbXBMUvj3PdMAs/rXdYT+R IlqhcLD7dTAL+IsLdDo7TTuNBScVECfDLX5rqJPsimvn8a9T8xuT2fRdZWBXb7rDsCEQ XTwQ2qJS8VBFbpKn0iv/uR6NvkC7q6WzOyMHuHe1bwbSseec/W/tTaKWr5Ee7bIpgakJ 29fg== X-Forwarded-Encrypted: i=1; AJvYcCWiUXMHD0vmb3mbwc4cliqNPdzwDVutmbep6c9Wx+rVk3oTwwYGRs+cl+e1OYFFwSndE1hxaHNS4wIiEu4=@vger.kernel.org X-Gm-Message-State: AOJu0YwHYZjWr6okvUbgQMUFkqgY8Ei9KhvA11gSnOamLZYZN8rz4qUc IICLT0XMxl2CksBnHx2wt2efxTZbk/Ibzn+JCXcLCHZvVoBDIx2lksvL X-Gm-Gg: ASbGncv80xC62hrbJjfgFdBnl2YNJ76qD+e45i6pOwGZCR5e0egFt1v78YEQCKZlcJK KFpkRQ9JRPHQFML4XB+Asj4nAIHB5h5a51Dw6O0v8JHBkku0RUcYwk2t7Wh2Tuqk6s/daldNkeR fLb+bCCSCSQjJ4hiXwyTxQ4G7kYG/2h8Z491IQARzddPUw+J47j+gVag4ZFrQ2Hfauv8QOiq1Ts uzrh9ylCweWMyYFN4dgjA/JUbwYSqAFmaJq7c05xn8jKYkgOxSbUPCTdBHai0gpiQGYFNxqJ0tG j7WUb8t+ZBX8KjEe8xFn/B1NLkjm0o+g0jsKsIZXCL34E7CgO7dP9lCTx1Bw+VyXf1g3vC9LPzX GTxsH8v5SqibN07AxIWrHiIBGbp28hdRVxW8/EqbD4LrT/kfUy7dg2Nu8dV3jWMZVumj3r6dCWy UWSdzETYl2TtFVzwNEvwbR2Cs= X-Google-Smtp-Source: AGHT+IEkt8HW36gyLR1l2wdTY0ESpus9ypRrB4cqHbD2NMCLXH7kTrxq5PT359t4Ljci47BAN9TkQA== X-Received: by 2002:a05:6122:660d:b0:55b:305b:4e3d with SMTP id 71dfb90a1353d-55e5c043be0mr3726432e0c.19.1764932779670; Fri, 05 Dec 2025 03:06:19 -0800 (PST) Received: from archlinux ([2804:1b2:9545:c615:2358:ef44:78a3:f69a]) by smtp.gmail.com with ESMTPSA id a1e0cc1a2514c-93f01d022a4sm245598241.3.2025.12.05.03.06.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Dec 2025 03:06:19 -0800 (PST) From: Julio Cesar Carvalho de Paula Souza To: hvaibhav.linux@gmail.com, johan@kernel.org, elder@kernel.org, gregkh@linuxfoundation.org, dan.carpenter@linaro.org Cc: greybus-dev@lists.linaro.org, linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, Julio Cesar Carvalho de Paula Souza Subject: [PATCH v5] staging: greybus: arche-apb-ctrl: switch to device_property_read_bool Date: Fri, 5 Dec 2025 08:06:07 -0300 Message-ID: <20251205110607.2438-1-julio191096@gmail.com> X-Mailer: git-send-email 2.52.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 --- Changes in v5: - Fixed 'From' header mismatch(updated git config user.name) - Fixed indentation aligment in function declaration as pointed out by Dan Carpenter Changes in v4: - Fixed a typo in the v3 commit Changes in v3: - Added changelog history as requested by the maintainer bot. Changes in v2: - Shortened the subject line to match subsystem standards. - Updated Signed-off-by to use full real name. 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 90ab32638d3f..6a4efa9a9e0e 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.52.0