diff options
Diffstat (limited to 'drivers/serial/serial_imx.c')
-rw-r--r-- | drivers/serial/serial_imx.c | 30 |
1 files changed, 11 insertions, 19 deletions
diff --git a/drivers/serial/serial_imx.c b/drivers/serial/serial_imx.c index d1329ca1eb..0f91028605 100644 --- a/drivers/serial/serial_imx.c +++ b/drivers/serial/serial_imx.c @@ -1,17 +1,6 @@ +// SPDX-License-Identifier: GPL-2.0-or-later /* * (c) 2004 Sascha Hauer <sascha@saschahauer.de> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * */ #include <common.h> @@ -208,7 +197,7 @@ static int imx_clocksource_clock_change(struct notifier_block *nb, return 0; } -static int imx_serial_probe(struct device_d *dev) +static int imx_serial_probe(struct device *dev) { struct resource *iores; struct console_device *cdev; @@ -245,19 +234,21 @@ static int imx_serial_probe(struct device_d *dev) cdev->flush = imx_serial_flush; cdev->setbrg = imx_serial_setbaudrate; cdev->linux_console_name = "ttymxc"; - if (dev->device_node) { - devname = of_alias_get(dev->device_node); + cdev->linux_earlycon_name = "ec_imx6q"; + cdev->phys_base = priv->regs; + if (dev->of_node) { + devname = of_alias_get(dev->of_node); if (devname) { cdev->devname = xstrdup(devname); cdev->devid = DEVICE_ID_SINGLE; } } - if (of_property_read_bool(dev->device_node, "fsl,dte-mode")) + if (of_property_read_bool(dev->of_node, "fsl,dte-mode")) priv->dte_mode = 1; - if (of_property_read_bool(dev->device_node, "linux,rs485-enabled-at-boot-time") && - !of_property_read_bool(dev->device_node, "rs485-rts-active-low")) + if (of_property_read_bool(dev->of_node, "linux,rs485-enabled-at-boot-time") && + !of_property_read_bool(dev->of_node, "rs485-rts-active-low")) priv->rs485_mode = 1; imx_serial_init_port(cdev); @@ -308,6 +299,7 @@ static __maybe_unused struct of_device_id imx_serial_dt_ids[] = { /* sentinel */ } }; +MODULE_DEVICE_TABLE(of, imx_serial_dt_ids); static struct platform_device_id imx_serial_ids[] = { { @@ -321,7 +313,7 @@ static struct platform_device_id imx_serial_ids[] = { }, }; -static struct driver_d imx_serial_driver = { +static struct driver imx_serial_driver = { .name = "imx_serial", .probe = imx_serial_probe, .of_compatible = DRV_OF_COMPAT(imx_serial_dt_ids), |