[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20240503164106.1172650-9-sui.jingfeng@linux.dev>
Date: Sat, 4 May 2024 00:41:04 +0800
From: Sui Jingfeng <sui.jingfeng@...ux.dev>
To: Andrzej Hajda <andrzej.hajda@...el.com>
Cc: Neil Armstrong <neil.armstrong@...aro.org>,
Robert Foss <rfoss@...nel.org>,
Laurent Pinchart <Laurent.pinchart@...asonboard.com>,
Jonas Karlman <jonas@...boo.se>,
Jernej Skrabec <jernej.skrabec@...il.com>,
Maxime Ripard <mripard@...nel.org>,
Thomas Zimmermann <tzimmermann@...e.de>,
David Airlie <airlied@...il.com>,
Daniel Vetter <daniel@...ll.ch>,
dri-devel@...ts.freedesktop.org,
linux-kernel@...r.kernel.org,
Sui Jingfeng <sui.jingfeng@...ux.dev>
Subject: [PATCH v5 08/10] drm/bridge: sii9234: Use fwnode APIs to abstract DT dependent API away
Switch to use the freshly created drm_bridge_set_node() helper, no
functional changes. The reason behind of this introduction is that
the name 'of_node' itself has a smell of DT dependent, and it is a
internal memeber, when there has helper function, we should use the
revelant helper and avoid directly referencing and/or dereferencing
it.
Signed-off-by: Sui Jingfeng <sui.jingfeng@...ux.dev>
---
drivers/gpu/drm/bridge/sii9234.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/bridge/sii9234.c b/drivers/gpu/drm/bridge/sii9234.c
index d8373d918324..19b09634a134 100644
--- a/drivers/gpu/drm/bridge/sii9234.c
+++ b/drivers/gpu/drm/bridge/sii9234.c
@@ -817,10 +817,11 @@ static int sii9234_init_resources(struct sii9234 *ctx,
struct i2c_client *client)
{
struct i2c_adapter *adapter = client->adapter;
+ struct fwnode_handle *fwnode = dev_fwnode(ctx->dev);
int ret;
- if (!ctx->dev->of_node) {
- dev_err(ctx->dev, "not DT device\n");
+ if (!fwnode) {
+ dev_err(ctx->dev, "firmware data is missing\n");
return -ENODEV;
}
@@ -886,6 +887,7 @@ static int sii9234_probe(struct i2c_client *client)
struct i2c_adapter *adapter = client->adapter;
struct sii9234 *ctx;
struct device *dev = &client->dev;
+ struct fwnode_handle *fwnode = dev_fwnode(dev);
int ret;
ctx = devm_kzalloc(dev, sizeof(*ctx), GFP_KERNEL);
@@ -922,7 +924,7 @@ static int sii9234_probe(struct i2c_client *client)
i2c_set_clientdata(client, ctx);
ctx->bridge.funcs = &sii9234_bridge_funcs;
- ctx->bridge.of_node = dev->of_node;
+ drm_bridge_set_node(&ctx->bridge, fwnode);
drm_bridge_add(&ctx->bridge);
sii9234_cable_in(ctx);
--
2.34.1
Powered by blists - more mailing lists