Re: [PATCH v2] tty: serial: mvebu-uart: use device_get_match_data()

From: Jiri Slaby

Date: Sun Nov 01 2026 - 01:55:23 EST


On 30. 10. 26, 19:33, Bramwel Barack wrote:
Modernize the driver by replacing the legacy of_match_device() call
with the modern device_get_match_data() helper API. This cleans up
the boilerplate code by extracting the match driver data configuration
directly.

Consequently, drop the explicit inclusions of <linux/of_device.h> and
<linux/of_platform.h> as they are no longer required by the driver.
This allows us to also remove a now-redundant forward declaration and
drop the problematic of_match_ptr() macro wrapper.
...
diff --git a/drivers/tty/serial/mvebu-uart.c b/drivers/tty/serial/mvebu-uart.c
index 33ea496c93b2..1e980dd26465 100644
--- a/drivers/tty/serial/mvebu-uart.c
+++ b/drivers/tty/serial/mvebu-uart.c
...
@@ -919,7 +914,7 @@ static int mvebu_uart_probe(struct platform_device *pdev)
return -ENOMEM;
/* Get controller data depending on the compatible string */
- mvuart->data = (struct mvebu_uart_driver_data *)match->data;
+ mvuart->data = (struct mvebu_uart_driver_data *)device_get_match_data(&pdev->dev);

Perhaps remove the cast too?

thanks,
--
js
suse labs