[PATCH v2 1/9] drm/tinydrm/mipi-dbi: Move cmdlock mutex init

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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: Sam Ravnborg <sam@xxxxxxxxxxxx>
Signed-off-by: Noralf Trønnes <noralf@xxxxxxxxxxx>
---
 drivers/gpu/drm/tinydrm/mipi-dbi.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/tinydrm/mipi-dbi.c b/drivers/gpu/drm/tinydrm/mipi-dbi.c
index 42465228129c..37a73b4c0f85 100644
--- a/drivers/gpu/drm/tinydrm/mipi-dbi.c
+++ b/drivers/gpu/drm/tinydrm/mipi-dbi.c
@@ -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;
-- 
2.20.1

_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/dri-devel




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux