diff options
| author | Thomas Zimmermann <tzimmermann@suse.de> | 2026-03-19 16:59:48 +0100 |
|---|---|---|
| committer | Thomas Zimmermann <tzimmermann@suse.de> | 2026-03-25 15:05:09 +0100 |
| commit | 0ffcfae5eab76b52eed2b8464cc588f98bd29c15 (patch) | |
| tree | 882c20b09a81dc7b063ce25490a7e9e89c12f790 /drivers/gpu | |
| parent | 078e60d90a70c14d9756d500ee20ce83e785175b (diff) | |
| download | linux-0ffcfae5eab76b52eed2b8464cc588f98bd29c15.tar.gz linux-0ffcfae5eab76b52eed2b8464cc588f98bd29c15.zip | |
drm/st7735r: Rename struct st7735r_priv to struct st7735r_device
Rename the driver's device struct according to DRM conventions. Also
add a helper to upcast from struct drm_device. No functional changes.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Acked-by: David Lechner <david@lechnology.com>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Link: https://patch.msgid.link/20260319160110.109610-13-tzimmermann@suse.de
Diffstat (limited to 'drivers/gpu')
| -rw-r--r-- | drivers/gpu/drm/sitronix/st7735r.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/drivers/gpu/drm/sitronix/st7735r.c b/drivers/gpu/drm/sitronix/st7735r.c index 1a34c7ba460b..9dd915765a6b 100644 --- a/drivers/gpu/drm/sitronix/st7735r.c +++ b/drivers/gpu/drm/sitronix/st7735r.c @@ -52,18 +52,22 @@ struct st7735r_cfg { unsigned int rgb:1; /* RGB (vs. BGR) */ }; -struct st7735r_priv { +struct st7735r_device { struct mipi_dbi_dev dbidev; /* Must be first for .release() */ const struct st7735r_cfg *cfg; }; +static struct st7735r_device *to_st7735r_device(struct drm_device *drm) +{ + return container_of(drm_to_mipi_dbi_dev(drm), struct st7735r_device, dbidev); +} + static void st7735r_pipe_enable(struct drm_simple_display_pipe *pipe, struct drm_crtc_state *crtc_state, struct drm_plane_state *plane_state) { - struct mipi_dbi_dev *dbidev = drm_to_mipi_dbi_dev(pipe->crtc.dev); - struct st7735r_priv *priv = container_of(dbidev, struct st7735r_priv, - dbidev); + struct st7735r_device *priv = to_st7735r_device(pipe->crtc.dev); + struct mipi_dbi_dev *dbidev = &priv->dbidev; struct mipi_dbi *dbi = &dbidev->dbi; int ret, idx; u8 addr_mode; @@ -184,7 +188,7 @@ static int st7735r_probe(struct spi_device *spi) struct device *dev = &spi->dev; const struct st7735r_cfg *cfg; struct mipi_dbi_dev *dbidev; - struct st7735r_priv *priv; + struct st7735r_device *priv; struct drm_device *drm; struct mipi_dbi *dbi; struct gpio_desc *dc; @@ -196,7 +200,7 @@ static int st7735r_probe(struct spi_device *spi) cfg = (void *)spi_get_device_id(spi)->driver_data; priv = devm_drm_dev_alloc(dev, &st7735r_driver, - struct st7735r_priv, dbidev.drm); + struct st7735r_device, dbidev.drm); if (IS_ERR(priv)) return PTR_ERR(priv); |
