diff options
author | Christophe Leroy <christophe.leroy@csgroup.eu> | 2023-08-03 15:56:49 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2023-08-04 15:08:30 +0200 |
commit | 8d1bd031ba152115461b3326eb3bdf7ca1f9bb3d (patch) | |
tree | 28ee175b98df4b60d5e9eb7b39c61e1e4d3922de /drivers/tty/serial/cpm_uart/cpm_uart_cpm1.c | |
parent | 86f0a9c8e3de2341e5d1150a3d0dfae72de38a4a (diff) |
serial: cpm_uart: Refactor cpm_uart_[un]map_pram()
cpm_uart_map_pram() and cpm_uart_unmap_pram() are very
similar for CPM1 and CPM2.
On CPM1 cpm_uart_map_pram() uses of_iomap() while CPM2 uses
of_address_to_resource()/ioremap(). CPM2 version will also
work on CPM1.
On CPM2 cpm_uart_map_pram() and cpm_uart_unmap_pram() has a special
handling for SMC. Just gate it by an IS_ENABLED(CONFIG_CPM2).
So move the CPM2 version into cpm_uart_core.c which is the only
user of those two fonctions and refactor to also handle CPM1 as
mentionned above.
PROFF_SMC_SIZE is only defined for SMC2 and used only there. To make
it simple, just use the numerical value 64, this is the only place
it is used and anyway there's already the same numerical value for
the alignment.
Use cpm_muram_alloc() instead of cpm_dpalloc() macro.
Then cpm_uart_cpm1.c and cpm_uart_cpm2.c are now empty and go away.
Replace printk(KERN_WARN by pr_warn( to make checkpatch happier.
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Link: https://lore.kernel.org/r/44a266106c421319aa8e700c2db52d5dcd652c0f.1691068700.git.christophe.leroy@csgroup.eu
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/serial/cpm_uart/cpm_uart_cpm1.c')
-rw-r--r-- | drivers/tty/serial/cpm_uart/cpm_uart_cpm1.c | 48 |
1 files changed, 0 insertions, 48 deletions
diff --git a/drivers/tty/serial/cpm_uart/cpm_uart_cpm1.c b/drivers/tty/serial/cpm_uart/cpm_uart_cpm1.c deleted file mode 100644 index 3fe436dc2f95..000000000000 --- a/drivers/tty/serial/cpm_uart/cpm_uart_cpm1.c +++ /dev/null @@ -1,48 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0+ -/* - * Driver for CPM (SCC/SMC) serial ports; CPM1 definitions - * - * Maintainer: Kumar Gala (galak@kernel.crashing.org) (CPM2) - * Pantelis Antoniou (panto@intracom.gr) (CPM1) - * - * Copyright (C) 2004 Freescale Semiconductor, Inc. - * (C) 2004 Intracom, S.A. - * (C) 2006 MontaVista Software, Inc. - * Vitaly Bordug <vbordug@ru.mvista.com> - */ - -#include <linux/module.h> -#include <linux/tty.h> -#include <linux/gfp.h> -#include <linux/ioport.h> -#include <linux/serial.h> -#include <linux/console.h> -#include <linux/sysrq.h> -#include <linux/device.h> -#include <linux/memblock.h> -#include <linux/dma-mapping.h> - -#include <asm/io.h> -#include <asm/irq.h> -#include <asm/fs_pd.h> - -#include <linux/serial_core.h> -#include <linux/kernel.h> - -#include <linux/of.h> -#include <linux/of_address.h> - -#include "cpm_uart.h" - -/**************************************************************/ - -void __iomem *cpm_uart_map_pram(struct uart_cpm_port *port, - struct device_node *np) -{ - return of_iomap(np, 1); -} - -void cpm_uart_unmap_pram(struct uart_cpm_port *port, void __iomem *pram) -{ - iounmap(pram); -} |