[PATCH v2 1/1] drm/st7735r: simplify with spi_get_device_match_data()

From: Andy Shevchenko

Date: Sun May 10 2026 - 03:06:36 EST


Use spi_get_device_match_data() helper to simplify a bit the driver.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>
---
v2: used correct parameter, no tags were picked up due to that
drivers/gpu/drm/sitronix/st7735r.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/sitronix/st7735r.c b/drivers/gpu/drm/sitronix/st7735r.c
index bd763871dca0..165ebfb13006 100644
--- a/drivers/gpu/drm/sitronix/st7735r.c
+++ b/drivers/gpu/drm/sitronix/st7735r.c
@@ -248,17 +248,14 @@ static int st7735r_probe(struct spi_device *spi)
u32 rotation = 0;
int ret;

- cfg = device_get_match_data(&spi->dev);
- if (!cfg)
- cfg = (void *)spi_get_device_id(spi)->driver_data;
-
st7735r = devm_drm_dev_alloc(dev, &st7735r_driver, struct st7735r_device, dbidev.drm);
if (IS_ERR(st7735r))
return PTR_ERR(st7735r);

- dbidev = &st7735r->dbidev;
+ cfg = spi_get_device_match_data(spi);
st7735r->cfg = cfg;

+ dbidev = &st7735r->dbidev;
dbi = &dbidev->dbi;
drm = &dbidev->drm;

--
2.50.1