From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Thomas Zimmermann <tzimmermann@suse.de>,
dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org
Cc: Alex Lanzano <lanzano.alex@gmail.com>,
Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
Maxime Ripard <mripard@kernel.org>,
David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Subject: [PATCH v1 1/1] drm/repaper: simplify with spi_get_device_match_data()
Date: Fri, 8 May 2026 10:02:43 +0200 [thread overview]
Message-ID: <20260508080243.1144046-1-andriy.shevchenko@linux.intel.com> (raw)
Use spi_get_device_match_data() helper to simplify a bit the driver.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
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..a05b81992d47 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(dev);
switch (model) {
case E1144CS021:
mode = &repaper_e1144cs021_mode;
--
2.50.1
next reply other threads:[~2026-05-08 8:02 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-08 8:02 Andy Shevchenko [this message]
2026-05-10 8:50 ` [PATCH v1 1/1] drm/repaper: simplify with spi_get_device_match_data() kernel test robot
2026-05-10 11:07 ` kernel test robot
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=20260508080243.1144046-1-andriy.shevchenko@linux.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=airlied@gmail.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=lanzano.alex@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mripard@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