Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 771ea160 authored by Noralf Trønnes's avatar Noralf Trønnes
Browse files

drm/tinydrm/mipi-dbi: Move cmdlock mutex init



cmdlock protects command execution so put it in mipi_dbi_spi_init()
where it conceptually belongs.
This is prep work for the splitting of struct mipi_dbi.

Reviewed-by: default avatarSam Ravnborg <sam@ravnborg.org>
Acked-by: default avatarEric Anholt <eric@anholt.net>
Signed-off-by: default avatarNoralf Trønnes <noralf@tronnes.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20190722104312.16184-2-noralf@tronnes.org
parent a9c342ab
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -506,8 +506,6 @@ int mipi_dbi_init_with_formats(struct mipi_dbi *mipi,
	if (!mipi->command)
		return -EINVAL;

	mutex_init(&mipi->cmdlock);

	mipi->tx_buf = devm_kmalloc(drm->dev, tx_buf_size, GFP_KERNEL);
	if (!mipi->tx_buf)
		return -ENOMEM;
@@ -1120,6 +1118,8 @@ int mipi_dbi_spi_init(struct spi_device *spi, struct mipi_dbi *mipi,
			return -ENOMEM;
	}

	mutex_init(&mipi->cmdlock);

	DRM_DEBUG_DRIVER("SPI speed: %uMHz\n", spi->max_speed_hz / 1000000);

	return 0;