Skip to contentSkip to conversation

drm/st7735r: simplify with spi_get_device_match_data()

PATCH Superseded Andy Shevchenko 2 participants 2 messages May 10 – May 12

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

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

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

---
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(-)
drivers/gpu/drm/sitronix/st7735r.c +2 -5
index bd763871dca0..165ebfb13006 100644
@@ -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;
 
Signature · 1 line
2.50.1