drm/st7735r: simplify with spi_get_device_match_data()
Subsystems (3)
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.
Signed-off-by Andy Shevchenko <[email protected]>
---
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
@@ -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
Quoted 4 lines · Andy Shevchenko
Use
spi_get_device_match_data()helper to simplify a bit the driver.Signed-off-by Andy Shevchenko <[email protected]>---
Reviewed-by David Lechner <[email protected]>