serial: imx: Remove unused platform data support
Subsystems (2)
Fabio Estevam
reviewerPATCH 1/1 serial: imx: Remove unused platform data support
Since 5.10-rc1 i.MX is a devicetree-only platform and the existing platform data support in this driver was only useful for old non-devicetree platforms.
Get rid of the platform data support since it is no longer used.
--- drivers/tty/serial/imx.c | 32 +++--------------------- include/linux/platform_data/serial-imx.h | 15 ----------- 2 files changed, 3 insertions(+), 44 deletions(-) delete mode 100644 include/linux/platform_data/serial-imx.h
drivers/tty/serial/imx.c +3 -29
@@ -30,7 +30,6 @@#include <linux/dma-mapping.h> #include <asm/irq.h> -#include <linux/platform_data/serial-imx.h> #include <linux/platform_data/dma-imx.h> #include "serial_mctrl_gpio.h"
@@ -2191,10 +2190,9 @@ static struct uart_driver imx_uart_uart_driver = { .cons = IMX_CONSOLE, }; -#ifdef CONFIG_OF /* -* This function returns 1 iff pdev isn't a device instatiated by dt, 0 iff it -* could successfully get all information from dt or a negative errno. +* This function returns 0 iff it could successfully get all information +* from dt or a negative errno. */ static int imx_uart_probe_dt (struct imx_port *sport,struct platform_device *pdev)
@@ -2232,28 +2230,6 @@ static int imx_uart_probe_dt(struct imx_port *sport,return 0 ; } -#else -static inline int imx_uart_probe_dt (struct imx_port *sport, -struct platform_device *pdev) -{ -return 1 ; -} -#endif - -static void imx_uart_probe_pdata (struct imx_port *sport, -struct platform_device *pdev) -{ -struct imxuart_platform_data *pdata =dev_get_platdata (&pdev->dev); - - sport->port.line = pdev->id; - sport->devdata = (struct imx_uart_data *) pdev->id_entry->driver_data; - -if (!pdata) -return ; - -if (pdata->flags &IMXUART_HAVE_RTSCTS ) - sport->have_rtscts =1 ; -}static enum hrtimer_restart imx_trigger_start_tx (struct hrtimer *t) {
@@ -2295,9 +2271,7 @@ static int imx_uart_probe(struct platform_device *pdev)return -ENOMEM ; ret =imx_uart_probe_dt (sport, pdev); -if (ret >0 ) -imx_uart_probe_pdata (sport, pdev); -else if (ret <0 ) +if (ret <0 )return ret;if (sport->port.line >=ARRAY_SIZE (imx_uart_ports)) {
include/linux/platform_data/serial-imx.h deleted +0 -15
@@ -1,15 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-or-later */ -/* -* Copyright (C) 2008 by Sascha Hauer <[email protected]> -*/ - -#ifndef ASMARM_ARCH_UART_H -#define ASMARM_ARCH_UART_H - -#define IMXUART_HAVE_RTSCTS (1<<0) - -struct imxuart_platform_data { -unsigned int flags; -}; - -#endif
Signature · 1 line
2.17.1
From: Fabio Estevam <[email protected]> Sent: Wednesday, November 11, 2020 5:49 AM
Quoted 6 lines
Since 5.10-rc1 i.MX is a devicetree-only platform and the existing platform data support in this driver was only useful for old non-devicetree platforms.
Get rid of the platform data support since it is no longer used.
Signed-off-by Fabio Estevam <[email protected]>
Quoted 97 lines
--- drivers/tty/serial/imx.c | 32 +++--------------------- include/linux/platform_data/serial-imx.h | 15 ----------- 2 files changed, 3 insertions(+), 44 deletions(-) delete mode 100644
include/linux/platform_data/serial-imx.hdrivers/tty/serial/imx.c index renamed from drivers/tty/serial/imx.c +0
-0
1731d9728865..7ce38ade9a8e100644drivers/tty/serial/imx.c +3
-17@@ -30,7 +30,6 @@#include <linux/dma-mapping.h> #include <asm/irq.h> -#include <linux/platform_data/serial-imx.h> #include <linux/platform_data/dma-imx.h> #include "serial_mctrl_gpio.h" @@ -2191,10 +2190,9 @@ static struct uart_driver imx_uart_uart_driver = { .cons = IMX_CONSOLE, }; -#ifdef CONFIG_OF /* -* This function returns 1 iff pdev isn't a device instatiated by dt, 0 iff it -* could successfully get all information from dt or a negative errno. +* This function returns 0 iff it could successfully get all +information +* from dt or a negative errno. */ static int imx_uart_probe_dt (struct imx_port *sport, struct platform_device *pdev) @@ -2232,28 +2230,6 @@ static int imx_uart_probe_dt(struct imx_port *sport, return 0; } -#else -static inline int imx_uart_probe_dt(struct imx_port *sport, - struct platform_device *pdev) -{ -return 1 ; -} -#endif - -static void imx_uart_probe_pdata (struct imx_port *sport, -struct platform_device *pdev) -{ - struct imxuart_platform_data *pdata =
dev_get_platdata(&pdev->dev);drivers/tty/serial/imx.c +0
-3- - sport->port.line = pdev->id; - sport->devdata = (struct imx_uart_data *)
pdev->id_entry->driver_data;drivers/tty/serial/imx.c +1
-11- -if (!pdata) -return ; - -if (pdata->flags &IMXUART_HAVE_RTSCTS ) - sport->have_rtscts =1 ; -} static enum hrtimer_restart imx_trigger_start_tx(struct hrtimer *t) { @@ -2295,9 +2271,7 @@ static int imx_uart_probe(struct platform_device *pdev)return -ENOMEM ; ret =imx_uart_probe_dt (sport, pdev); -if (ret >0 ) -imx_uart_probe_pdata (sport, pdev); -else if (ret <0 ) +if (ret <0 )return ret; if (sport->port.line >= ARRAY_SIZE(imx_uart_ports)) { diff --git
a/include/linux/platform_data/serial-imx.hb/include/linux/platform_data/serial-imx.h
deleted file mode 100644
index 0844b21372c7..000000000000include/linux/platform_data/serial-imx.h deleted +0
-16@@ -1,15 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-or-later */ -/* -* Copyright (C) 2008 by Sascha Hauer <[email protected]> -*/ - -#ifndef ASMARM_ARCH_UART_H -#define ASMARM_ARCH_UART_H - -#define IMXUART_HAVE_RTSCTS (1<<0) - -struct imxuart_platform_data { -unsigned int flags; -}; - -#endif --2.17.1
Hello,
Quoted 5 lines · Fabio Estevam
Since 5.10-rc1 i.MX is a devicetree-only platform and the existing platform data support in this driver was only useful for old non-devicetree platforms.
Get rid of the platform data support since it is no longer used.
Great, I missed that platform data support is gone.
Is it a problem if you build with SERIAL_IMX=y, COMPILE_TEST=y and ARCH_MXC + CONFIG_OF unset?
Best regards
Uwe
Signature · 2 lines
Pengutronix e.K. | Uwe Kleine-König | Industrial Linux Solutions | https://www.pengutronix.de/ |
Fabio Estevam
reviewerHi Uwe,
Quoted 2 lines · Uwe Kleine-König
Is it a problem if you build with SERIAL_IMX=y, COMPILE_TEST=y and
ARCH_MXC+CONFIG_OFunset?
I tried your suggested combination and it built fine.
Regards,
Fabio Estevam
Uwe Kleine-König
Acked-byQuoted 9 lines · Fabio Estevam
Hi Uwe,
Quoted 2 lines · Uwe Kleine-König
Is it a problem if you build with SERIAL_IMX=y, COMPILE_TEST=y and
ARCH_MXC+CONFIG_OFunset?I tried your suggested combination and it built fine.
fine, then:
Best regards
Uwe
Signature · 2 lines
Pengutronix e.K. | Uwe Kleine-König | Industrial Linux Solutions | https://www.pengutronix.de/ |