All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] serial: qcom_geni_serial: use DT aliases according to DT bindings
@ 2021-06-21 21:15 Dmitry Baryshkov
  2021-06-21 21:44 ` Bjorn Andersson
  0 siblings, 1 reply; 2+ messages in thread
From: Dmitry Baryshkov @ 2021-06-21 21:15 UTC (permalink / raw)
  To: Andy Gross, Bjorn Andersson
  Cc: linux-arm-msm, Greg Kroah-Hartman, linux-serial, Jiri Slaby, Rob Herring

Device tree bindings do not specify "hsuart" aliases, instead all serial
ports should use "serial" alias name as noted by Rob Herring [1].
Make qcom_geni_serial driver use "serial" alias and fallback to "hsuart"
if one is not found.

[1] https://lore.kernel.org/linux-arm-msm/6dd1f5cd-03c7-5945-9fa2-1c2698405110@linaro.org/

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Cc: Rob Herring <robh+dt@kernel.org>
---
 drivers/tty/serial/qcom_geni_serial.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/tty/serial/qcom_geni_serial.c b/drivers/tty/serial/qcom_geni_serial.c
index 23d729ed3bf6..85f1c1f96597 100644
--- a/drivers/tty/serial/qcom_geni_serial.c
+++ b/drivers/tty/serial/qcom_geni_serial.c
@@ -1354,7 +1354,9 @@ static int qcom_geni_serial_probe(struct platform_device *pdev)
 		line = of_alias_get_id(pdev->dev.of_node, "serial");
 	} else {
 		drv = &qcom_geni_uart_driver;
-		line = of_alias_get_id(pdev->dev.of_node, "hsuart");
+		line = of_alias_get_id(pdev->dev.of_node, "serial");
+		if (line == -ENODEV) /* compat with non-standard aliases */
+			line = of_alias_get_id(pdev->dev.of_node, "hsuart");
 	}
 
 	port = get_port_from_line(line, console);
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] serial: qcom_geni_serial: use DT aliases according to DT bindings
  2021-06-21 21:15 [PATCH] serial: qcom_geni_serial: use DT aliases according to DT bindings Dmitry Baryshkov
@ 2021-06-21 21:44 ` Bjorn Andersson
  0 siblings, 0 replies; 2+ messages in thread
From: Bjorn Andersson @ 2021-06-21 21:44 UTC (permalink / raw)
  To: Dmitry Baryshkov
  Cc: Andy Gross, linux-arm-msm, Greg Kroah-Hartman, linux-serial,
	Jiri Slaby, Rob Herring

On Mon 21 Jun 16:15 CDT 2021, Dmitry Baryshkov wrote:

> Device tree bindings do not specify "hsuart" aliases, instead all serial
> ports should use "serial" alias name as noted by Rob Herring [1].
> Make qcom_geni_serial driver use "serial" alias and fallback to "hsuart"
> if one is not found.
> 
> [1] https://lore.kernel.org/linux-arm-msm/6dd1f5cd-03c7-5945-9fa2-1c2698405110@linaro.org/
> 
> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> Cc: Rob Herring <robh+dt@kernel.org>

Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>

Regards,
Bjorn

> ---
>  drivers/tty/serial/qcom_geni_serial.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/tty/serial/qcom_geni_serial.c b/drivers/tty/serial/qcom_geni_serial.c
> index 23d729ed3bf6..85f1c1f96597 100644
> --- a/drivers/tty/serial/qcom_geni_serial.c
> +++ b/drivers/tty/serial/qcom_geni_serial.c
> @@ -1354,7 +1354,9 @@ static int qcom_geni_serial_probe(struct platform_device *pdev)
>  		line = of_alias_get_id(pdev->dev.of_node, "serial");
>  	} else {
>  		drv = &qcom_geni_uart_driver;
> -		line = of_alias_get_id(pdev->dev.of_node, "hsuart");
> +		line = of_alias_get_id(pdev->dev.of_node, "serial");
> +		if (line == -ENODEV) /* compat with non-standard aliases */
> +			line = of_alias_get_id(pdev->dev.of_node, "hsuart");
>  	}
>  
>  	port = get_port_from_line(line, console);
> -- 
> 2.30.2
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-06-21 21:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-21 21:15 [PATCH] serial: qcom_geni_serial: use DT aliases according to DT bindings Dmitry Baryshkov
2021-06-21 21:44 ` Bjorn Andersson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.