summaryrefslogtreecommitdiffstats
path: root/drivers/serial/stm-serial.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/serial/stm-serial.c')
-rw-r--r--drivers/serial/stm-serial.c22
1 files changed, 7 insertions, 15 deletions
diff --git a/drivers/serial/stm-serial.c b/drivers/serial/stm-serial.c
index ea482415ce..af30bfa71d 100644
--- a/drivers/serial/stm-serial.c
+++ b/drivers/serial/stm-serial.c
@@ -1,21 +1,10 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
/*
* (C) Copyright 2010 Juergen Beisert - Pengutronix
*
* This code was inspired by some patches made for u-boot covered by:
* (c) 2007 Sascha Hauer <s.hauer@pengutronix.de>
* (C) Copyright 2009 Freescale Semiconductor, Inc.
- *
- * 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.
- *
- *
*/
/*
@@ -31,7 +20,6 @@
#include <malloc.h>
#include <linux/clk.h>
#include <linux/err.h>
-#include <mach/clock.h>
#define UARTDBGDR 0x00
#define UARTDBGFR 0x18
@@ -143,7 +131,7 @@ static int stm_serial_init_port(struct stm_priv *priv)
return 0;
}
-static int stm_serial_probe(struct device_d *dev)
+static int stm_serial_probe(struct device *dev)
{
struct resource *iores;
struct stm_priv *priv;
@@ -159,12 +147,15 @@ static int stm_serial_probe(struct device_d *dev)
cdev->flush = stm_serial_flush;
cdev->setbrg = stm_serial_setbaudrate;
cdev->dev = dev;
+ cdev->linux_console_name = "ttyAMA";
+ cdev->linux_earlycon_name = "pl011";
dev->priv = priv;
iores = dev_request_mem_resource(dev, 0);
if (IS_ERR(iores))
return PTR_ERR(iores);
priv->base = IOMEM(iores->start);
+ cdev->phys_base = priv->base;
priv->clk = clk_get(dev, NULL);
if (IS_ERR(priv->clk))
return PTR_ERR(priv->clk);
@@ -189,8 +180,9 @@ static __maybe_unused struct of_device_id stm_serial_dt_ids[] = {
/* sentinel */
}
};
+MODULE_DEVICE_TABLE(of, stm_serial_dt_ids);
-static struct driver_d stm_serial_driver = {
+static struct driver stm_serial_driver = {
.name = "stm_serial",
.probe = stm_serial_probe,
.of_compatible = DRV_OF_COMPAT(stm_serial_dt_ids),