Thread (13 messages) 13 messages, 3 authors, 2025-02-22

Re: [PATCH v7 4/6] media: platform: synopsys: Add support for HDMI input driver

From: Dmitry Osipenko <dmitry.osipenko@collabora.com>
Date: 2025-02-22 21:26:16
Also in: linux-media, linux-rockchip, lkml

On 2/19/25 23:56, Markus Elfring wrote:
quoted
+++ b/drivers/media/platform/synopsys/hdmirx/snps_hdmirx.c
@@ -0,0 +1,2718 @@
quoted
+static u32 hdmirx_readl(struct snps_hdmirx_dev *hdmirx_dev, int reg)
+{
+	u32 val;
+
+	guard(spinlock_irqsave)(&hdmirx_dev->rst_lock);
+
+	val = readl(hdmirx_dev->regs + reg);
+
+	return val;
+}
May such a function implementation be simplified?

{
	guard(spinlock_irqsave)(&hdmirx_dev->rst_lock);
	return readl(hdmirx_dev->regs + reg);
}
That will work, thanks.
quoted
+static int hdmirx_get_detected_timings(struct snps_hdmirx_dev *hdmirx_dev,
+				       struct v4l2_dv_timings *timings)
+{
quoted
+	mutex_lock(&hdmirx_dev->work_lock);
+retry:
+	memset(timings, 0, sizeof(struct v4l2_dv_timings));
quoted
+	mutex_unlock(&hdmirx_dev->work_lock);
+
+	return ret;
+}
…

Would you become interested to apply a statement like “guard(mutex)(&hdmirx_dev->work_lock);”?
https://elixir.bootlin.com/linux/v6.14-rc3/source/include/linux/mutex.h#L201
That will make code less consistent and less intuitive to me. Anyways,
thanks for the suggestion.

-- 
Best regards,
Dmitry
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help