From: Marcus Folkesson <marcus.folkesson@gmail.com>
To: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
Maxime Ripard <mripard@kernel.org>,
Thomas Zimmermann <tzimmermann@suse.de>,
David Airlie <airlied@gmail.com>,
Simona Vetter <simona@ffwll.ch>,
Javier Martinez Canillas <javierm@redhat.com>,
Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>
Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
devicetree@vger.kernel.org,
Marcus Folkesson <marcus.folkesson@gmail.com>
Subject: [PATCH v3 1/7] drm/sitronix/st7571-i2c: rename 'struct drm_device' in st7571_device
Date: Mon, 15 Dec 2025 10:46:43 +0100 [thread overview]
Message-ID: <20251215-st7571-split-v3-1-d5f3205c3138@gmail.com> (raw)
In-Reply-To: <20251215-st7571-split-v3-0-d5f3205c3138@gmail.com>
Rename st7571_device.dev to st7571_device.drm in preparation to
introduce a 'struct device' member to this structure.
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Signed-off-by: Marcus Folkesson <marcus.folkesson@gmail.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 4e73c8b415d6..71814a3eb93b 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.51.2
next prev parent reply other threads:[~2025-12-15 9:47 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-15 9:46 [PATCH v3 0/7] drm/sitronix/st7571: split up driver to support both I2C and SPI Marcus Folkesson
2025-12-15 9:46 ` Marcus Folkesson [this message]
2025-12-15 9:46 ` [PATCH v3 2/7] drm/sitronix/st7571-i2c: add 'struct device' to st7571_device Marcus Folkesson
2025-12-15 9:46 ` [PATCH v3 3/7] drm/sitronix/st7571-i2c: move common structures to st7571.h Marcus Folkesson
2025-12-15 9:46 ` [PATCH v3 4/7] drm/sitronix/st7571-i2c: make probe independent of hw interface Marcus Folkesson
2025-12-15 9:46 ` [PATCH v3 5/7] drm/sitronix/st7571: split up the driver into a common and an i2c part Marcus Folkesson
2025-12-15 9:46 ` [PATCH v3 6/7] drm/sitronix/st7571-spi: add support for SPI interface Marcus Folkesson
2025-12-15 9:46 ` [PATCH v3 7/7] dt-bindings: display: sitronix,st7571: add example for SPI Marcus Folkesson
2025-12-15 12:57 ` [PATCH v3 0/7] drm/sitronix/st7571: split up driver to support both I2C and SPI Javier Martinez Canillas
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20251215-st7571-split-v3-1-d5f3205c3138@gmail.com \
--to=marcus.folkesson@gmail.com \
--cc=airlied@gmail.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=javierm@redhat.com \
--cc=krzk+dt@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mripard@kernel.org \
--cc=robh@kernel.org \
--cc=simona@ffwll.ch \
--cc=tzimmermann@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).