[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20251024-st7571-split-v1-1-d3092b98130f@gmail.com>
Date: Fri, 24 Oct 2025 12:56:52 +0200
From: Marcus Folkesson <marcus.folkesson@...il.com>
To: Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>,
Maxime Ripard <mripard@...nel.org>, Thomas Zimmermann <tzimmermann@...e.de>,
David Airlie <airlied@...il.com>, Simona Vetter <simona@...ll.ch>
Cc: dri-devel@...ts.freedesktop.org, linux-kernel@...r.kernel.org,
Marcus Folkesson <marcus.folkesson@...il.com>
Subject: [PATCH 1/6] drm/sitronix/st7571-i2c: rename 'struct drm_device' in
st7571_device
Rename st7571_device.dev to st7571_device.drm in preparation to
introduce a 'struct device' member to this structure.
Signed-off-by: Marcus Folkesson <marcus.folkesson@...il.com>
---
drivers/gpu/drm/sitronix/st7571-i2c.c | 60 +++++++++++++++++------------------
1 file changed, 30 insertions(+), 30 deletions(-)
diff --git a/drivers/gpu/drm/sitronix/st7571-i2c.c b/drivers/gpu/drm/sitronix/st7571-i2c.c
index 4e73c8b415d677dab5b421666b56f4bb3697b982..71814a3eb93b7adf554da082a0237da371e5f5b5 100644
--- a/drivers/gpu/drm/sitronix/st7571-i2c.c
+++ b/drivers/gpu/drm/sitronix/st7571-i2c.c
@@ -112,7 +112,7 @@ struct st7571_panel_format {
};
struct st7571_device {
- struct drm_device dev;
+ struct drm_device drm;
struct drm_plane primary_plane;
struct drm_crtc crtc;
@@ -166,9 +166,9 @@ struct st7571_device {
u8 *row;
};
-static inline struct st7571_device *drm_to_st7571(struct drm_device *dev)
+static inline struct st7571_device *drm_to_st7571(struct drm_device *drm)
{
- return container_of(dev, struct st7571_device, dev);
+ return container_of(drm, struct st7571_device, drm);
}
static int st7571_regmap_write(void *context, const void *data, size_t count)
@@ -467,7 +467,7 @@ static void st7571_primary_plane_helper_atomic_update(struct drm_plane *plane,
struct drm_shadow_plane_state *shadow_plane_state = to_drm_shadow_plane_state(plane_state);
struct drm_framebuffer *fb = plane_state->fb;
struct drm_atomic_helper_damage_iter iter;
- struct drm_device *dev = plane->dev;
+ struct drm_device *drm = plane->dev;
struct drm_rect damage;
struct st7571_device *st7571 = drm_to_st7571(plane->dev);
int ret, idx;
@@ -479,7 +479,7 @@ static void st7571_primary_plane_helper_atomic_update(struct drm_plane *plane,
if (ret)
return;
- if (!drm_dev_enter(dev, &idx))
+ if (!drm_dev_enter(drm, &idx))
goto out_drm_gem_fb_end_cpu_access;
drm_atomic_helper_damage_iter_init(&iter, old_plane_state, plane_state);
@@ -501,11 +501,11 @@ static void st7571_primary_plane_helper_atomic_update(struct drm_plane *plane,
static void st7571_primary_plane_helper_atomic_disable(struct drm_plane *plane,
struct drm_atomic_state *state)
{
- struct drm_device *dev = plane->dev;
+ struct drm_device *drm = plane->dev;
struct st7571_device *st7571 = drm_to_st7571(plane->dev);
int idx;
- if (!drm_dev_enter(dev, &idx))
+ if (!drm_dev_enter(drm, &idx))
return;
st7571_fb_clear_screen(st7571);
@@ -621,20 +621,20 @@ static struct drm_display_mode st7571_mode(struct st7571_device *st7571)
static int st7571_mode_config_init(struct st7571_device *st7571)
{
- struct drm_device *dev = &st7571->dev;
+ struct drm_device *drm = &st7571->drm;
const struct st7571_panel_constraints *constraints = &st7571->pdata->constraints;
int ret;
- ret = drmm_mode_config_init(dev);
+ ret = drmm_mode_config_init(drm);
if (ret)
return ret;
- dev->mode_config.min_width = constraints->min_ncols;
- dev->mode_config.min_height = constraints->min_nlines;
- dev->mode_config.max_width = constraints->max_ncols;
- dev->mode_config.max_height = constraints->max_nlines;
- dev->mode_config.preferred_depth = 24;
- dev->mode_config.funcs = &st7571_mode_config_funcs;
+ drm->mode_config.min_width = constraints->min_ncols;
+ drm->mode_config.min_height = constraints->min_nlines;
+ drm->mode_config.max_width = constraints->max_ncols;
+ drm->mode_config.max_height = constraints->max_nlines;
+ drm->mode_config.preferred_depth = 24;
+ drm->mode_config.funcs = &st7571_mode_config_funcs;
return 0;
}
@@ -643,10 +643,10 @@ static int st7571_plane_init(struct st7571_device *st7571,
const struct st7571_panel_format *pformat)
{
struct drm_plane *primary_plane = &st7571->primary_plane;
- struct drm_device *dev = &st7571->dev;
+ struct drm_device *drm = &st7571->drm;
int ret;
- ret = drm_universal_plane_init(dev, primary_plane, 0,
+ ret = drm_universal_plane_init(drm, primary_plane, 0,
&st7571_primary_plane_funcs,
pformat->formats,
pformat->nformats,
@@ -665,10 +665,10 @@ static int st7571_crtc_init(struct st7571_device *st7571)
{
struct drm_plane *primary_plane = &st7571->primary_plane;
struct drm_crtc *crtc = &st7571->crtc;
- struct drm_device *dev = &st7571->dev;
+ struct drm_device *drm = &st7571->drm;
int ret;
- ret = drm_crtc_init_with_planes(dev, crtc, primary_plane, NULL,
+ ret = drm_crtc_init_with_planes(drm, crtc, primary_plane, NULL,
&st7571_crtc_funcs, NULL);
if (ret)
return ret;
@@ -682,10 +682,10 @@ static int st7571_encoder_init(struct st7571_device *st7571)
{
struct drm_encoder *encoder = &st7571->encoder;
struct drm_crtc *crtc = &st7571->crtc;
- struct drm_device *dev = &st7571->dev;
+ struct drm_device *drm = &st7571->drm;
int ret;
- ret = drm_encoder_init(dev, encoder, &st7571_encoder_funcs, DRM_MODE_ENCODER_NONE, NULL);
+ ret = drm_encoder_init(drm, encoder, &st7571_encoder_funcs, DRM_MODE_ENCODER_NONE, NULL);
if (ret)
return ret;
@@ -700,10 +700,10 @@ static int st7571_connector_init(struct st7571_device *st7571)
{
struct drm_connector *connector = &st7571->connector;
struct drm_encoder *encoder = &st7571->encoder;
- struct drm_device *dev = &st7571->dev;
+ struct drm_device *drm = &st7571->drm;
int ret;
- ret = drm_connector_init(dev, connector, &st7571_connector_funcs,
+ ret = drm_connector_init(drm, connector, &st7571_connector_funcs,
DRM_MODE_CONNECTOR_Unknown);
if (ret)
return ret;
@@ -934,15 +934,15 @@ static int st7571_lcd_init(struct st7571_device *st7571)
static int st7571_probe(struct i2c_client *client)
{
struct st7571_device *st7571;
- struct drm_device *dev;
+ struct drm_device *drm;
int ret;
st7571 = devm_drm_dev_alloc(&client->dev, &st7571_driver,
- struct st7571_device, dev);
+ struct st7571_device, drm);
if (IS_ERR(st7571))
return PTR_ERR(st7571);
- dev = &st7571->dev;
+ drm = &st7571->drm;
st7571->client = client;
i2c_set_clientdata(client, st7571);
st7571->pdata = device_get_match_data(&client->dev);
@@ -1010,14 +1010,14 @@ static int st7571_probe(struct i2c_client *client)
return dev_err_probe(&client->dev, ret,
"Failed to initialize connector\n");
- drm_mode_config_reset(dev);
+ drm_mode_config_reset(drm);
- ret = drm_dev_register(dev, 0);
+ ret = drm_dev_register(drm, 0);
if (ret)
return dev_err_probe(&client->dev, ret,
"Failed to register DRM device\n");
- drm_client_setup(dev, NULL);
+ drm_client_setup(drm, NULL);
return 0;
}
@@ -1025,7 +1025,7 @@ static void st7571_remove(struct i2c_client *client)
{
struct st7571_device *st7571 = i2c_get_clientdata(client);
- drm_dev_unplug(&st7571->dev);
+ drm_dev_unplug(&st7571->drm);
}
static const struct st7571_panel_data st7567_config = {
--
2.50.1
Powered by blists - more mailing lists