dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 1/1] drm/repaper: simplify with spi_get_device_match_data()
@ 2026-05-10  7:07 Andy Shevchenko
  0 siblings, 0 replies; only message in thread
From: Andy Shevchenko @ 2026-05-10  7:07 UTC (permalink / raw)
  To: Thomas Zimmermann, dri-devel, linux-kernel
  Cc: Alex Lanzano, Maarten Lankhorst, Maxime Ripard, David Airlie,
	Simona Vetter, Andy Shevchenko

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

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
v2: used correct parameter
 drivers/gpu/drm/tiny/repaper.c | 11 +----------
 1 file changed, 1 insertion(+), 10 deletions(-)

diff --git a/drivers/gpu/drm/tiny/repaper.c b/drivers/gpu/drm/tiny/repaper.c
index c8270591afc7..3885a57600c0 100644
--- a/drivers/gpu/drm/tiny/repaper.c
+++ b/drivers/gpu/drm/tiny/repaper.c
@@ -941,24 +941,14 @@ MODULE_DEVICE_TABLE(spi, repaper_id);
 static int repaper_probe(struct spi_device *spi)
 {
 	const struct drm_display_mode *mode;
-	const struct spi_device_id *spi_id;
 	struct device *dev = &spi->dev;
 	enum repaper_model model;
 	const char *thermal_zone;
 	struct repaper_epd *epd;
 	size_t line_buffer_size;
 	struct drm_device *drm;
-	const void *match;
 	int ret;
 
-	match = device_get_match_data(dev);
-	if (match) {
-		model = (enum repaper_model)(uintptr_t)match;
-	} else {
-		spi_id = spi_get_device_id(spi);
-		model = (enum repaper_model)spi_id->driver_data;
-	}
-
 	/* The SPI device is used to allocate dma memory */
 	if (!dev->coherent_dma_mask) {
 		ret = dma_coerce_mask_and_coherent(dev, DMA_BIT_MASK(32));
@@ -1023,6 +1013,7 @@ static int repaper_probe(struct spi_device *spi)
 		}
 	}
 
+	model = (enum repaper_model)(uintptr_t)spi_get_device_match_data(spi);
 	switch (model) {
 	case E1144CS021:
 		mode = &repaper_e1144cs021_mode;
-- 
2.50.1


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-05-10  7:12 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-10  7:07 [PATCH v2 1/1] drm/repaper: simplify with spi_get_device_match_data() Andy Shevchenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox