* [PATCH] serial: imx: Fix for non-devicetree boards
@ 2014-08-15 9:10 Philipp Zabel
2014-09-05 5:48 ` Sascha Hauer
0 siblings, 1 reply; 2+ messages in thread
From: Philipp Zabel @ 2014-08-15 9:10 UTC (permalink / raw)
To: Sascha Hauer; +Cc: barebox
Commit 3843bfd0ab77eaf125ca617922927b61fc8ded74
"serial: imx: Determine device name from device tree"
broke this driver for non-devicetree boards, since
of_alias_get may not be called with a NULL pointer
as first argument.
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
---
drivers/serial/serial_imx.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/drivers/serial/serial_imx.c b/drivers/serial/serial_imx.c
index 474bfaf..e379f29 100644
--- a/drivers/serial/serial_imx.c
+++ b/drivers/serial/serial_imx.c
@@ -338,9 +338,11 @@ static int imx_serial_probe(struct device_d *dev)
cdev->flush = imx_serial_flush;
cdev->setbrg = imx_serial_setbaudrate;
cdev->linux_console_name = "ttymxc";
- devname = of_alias_get(dev->device_node);
- if (devname)
- cdev->devname = xstrdup(devname);
+ if (dev->device_node) {
+ devname = of_alias_get(dev->device_node);
+ if (devname)
+ cdev->devname = xstrdup(devname);
+ }
imx_serial_init_port(cdev);
--
2.0.1
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] serial: imx: Fix for non-devicetree boards
2014-08-15 9:10 [PATCH] serial: imx: Fix for non-devicetree boards Philipp Zabel
@ 2014-09-05 5:48 ` Sascha Hauer
0 siblings, 0 replies; 2+ messages in thread
From: Sascha Hauer @ 2014-09-05 5:48 UTC (permalink / raw)
To: Philipp Zabel; +Cc: barebox
On Fri, Aug 15, 2014 at 11:10:03AM +0200, Philipp Zabel wrote:
> Commit 3843bfd0ab77eaf125ca617922927b61fc8ded74
> "serial: imx: Determine device name from device tree"
> broke this driver for non-devicetree boards, since
> of_alias_get may not be called with a NULL pointer
> as first argument.
>
> Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Applied, thanks.
Damn, I missed this patch in my inbox, otherwise it would have been in
the last release.
Now it's in the stable/2014.09 branch.
Sascha
> ---
> drivers/serial/serial_imx.c | 8 +++++---
> 1 file changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/serial/serial_imx.c b/drivers/serial/serial_imx.c
> index 474bfaf..e379f29 100644
> --- a/drivers/serial/serial_imx.c
> +++ b/drivers/serial/serial_imx.c
> @@ -338,9 +338,11 @@ static int imx_serial_probe(struct device_d *dev)
> cdev->flush = imx_serial_flush;
> cdev->setbrg = imx_serial_setbaudrate;
> cdev->linux_console_name = "ttymxc";
> - devname = of_alias_get(dev->device_node);
> - if (devname)
> - cdev->devname = xstrdup(devname);
> + if (dev->device_node) {
> + devname = of_alias_get(dev->device_node);
> + if (devname)
> + cdev->devname = xstrdup(devname);
> + }
>
> imx_serial_init_port(cdev);
>
> --
> 2.0.1
>
>
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-09-05 5:49 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-15 9:10 [PATCH] serial: imx: Fix for non-devicetree boards Philipp Zabel
2014-09-05 5:48 ` Sascha Hauer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox