diff mbox series

[v3,03/15] serial: bcm283x_mu: Remove support for post-init disabling

Message ID 20180125110556.76352-4-agraf@suse.de
State Accepted
Commit fc8523a1474d33dcc5f7fd1823563fbd73aa1876
Headers show
Series RPi: Properly handle dynamic serial configuration | expand

Commit Message

Alexander Graf Jan. 25, 2018, 11:05 a.m. UTC
We are switching to a model where a serial device doesn't even get probed when
it's not muxed properly, so we don't need device specific disabling
functionality anymore.

Signed-off-by: Alexander Graf <agraf@suse.de>
---
 drivers/serial/serial_bcm283x_mu.c           | 18 +-----------------
 include/dm/platform_data/serial_bcm283x_mu.h |  1 -
 2 files changed, 1 insertion(+), 18 deletions(-)

Comments

Tom Rini Jan. 28, 2018, 6:54 p.m. UTC | #1
On Thu, Jan 25, 2018 at 12:05:44PM +0100, Alexander Graf wrote:

> We are switching to a model where a serial device doesn't even get probed when

> it's not muxed properly, so we don't need device specific disabling

> functionality anymore.

> 

> Signed-off-by: Alexander Graf <agraf@suse.de>


Applied to u-boot/master, thanks!

-- 
Tom
diff mbox series

Patch

diff --git a/drivers/serial/serial_bcm283x_mu.c b/drivers/serial/serial_bcm283x_mu.c
index 41c26b3d93..7ce990b9b8 100644
--- a/drivers/serial/serial_bcm283x_mu.c
+++ b/drivers/serial/serial_bcm283x_mu.c
@@ -59,7 +59,7 @@  static int bcm283x_mu_serial_setbrg(struct udevice *dev, int baudrate)
 	struct bcm283x_mu_regs *regs = priv->regs;
 	u32 divider;
 
-	if (plat->disabled || plat->skip_init)
+	if (plat->skip_init)
 		return 0;
 
 	divider = plat->clock / (baudrate * 8);
@@ -75,9 +75,6 @@  static int bcm283x_mu_serial_probe(struct udevice *dev)
 	struct bcm283x_mu_serial_platdata *plat = dev_get_platdata(dev);
 	struct bcm283x_mu_priv *priv = dev_get_priv(dev);
 
-	if (plat->disabled)
-		return -ENODEV;
-
 	priv->regs = (struct bcm283x_mu_regs *)plat->base;
 
 	return 0;
@@ -85,14 +82,10 @@  static int bcm283x_mu_serial_probe(struct udevice *dev)
 
 static int bcm283x_mu_serial_getc(struct udevice *dev)
 {
-	struct bcm283x_mu_serial_platdata *plat = dev_get_platdata(dev);
 	struct bcm283x_mu_priv *priv = dev_get_priv(dev);
 	struct bcm283x_mu_regs *regs = priv->regs;
 	u32 data;
 
-	if (plat->disabled)
-		return -EAGAIN;
-
 	/* Wait until there is data in the FIFO */
 	if (!(readl(&regs->lsr) & BCM283X_MU_LSR_RX_READY))
 		return -EAGAIN;
@@ -104,13 +97,9 @@  static int bcm283x_mu_serial_getc(struct udevice *dev)
 
 static int bcm283x_mu_serial_putc(struct udevice *dev, const char data)
 {
-	struct bcm283x_mu_serial_platdata *plat = dev_get_platdata(dev);
 	struct bcm283x_mu_priv *priv = dev_get_priv(dev);
 	struct bcm283x_mu_regs *regs = priv->regs;
 
-	if (plat->disabled)
-		return 0;
-
 	/* Wait until there is space in the FIFO */
 	if (!(readl(&regs->lsr) & BCM283X_MU_LSR_TX_EMPTY))
 		return -EAGAIN;
@@ -123,14 +112,10 @@  static int bcm283x_mu_serial_putc(struct udevice *dev, const char data)
 
 static int bcm283x_mu_serial_pending(struct udevice *dev, bool input)
 {
-	struct bcm283x_mu_serial_platdata *plat = dev_get_platdata(dev);
 	struct bcm283x_mu_priv *priv = dev_get_priv(dev);
 	struct bcm283x_mu_regs *regs = priv->regs;
 	unsigned int lsr;
 
-	if (plat->disabled)
-		return 0;
-
 	lsr = readl(&regs->lsr);
 
 	if (input) {
@@ -168,7 +153,6 @@  static int bcm283x_mu_serial_ofdata_to_platdata(struct udevice *dev)
 				     1);
 	plat->skip_init = fdtdec_get_bool(gd->fdt_blob, dev_of_offset(dev),
 	                                  "skip-init");
-	plat->disabled = false;
 	return 0;
 }
 #endif
diff --git a/include/dm/platform_data/serial_bcm283x_mu.h b/include/dm/platform_data/serial_bcm283x_mu.h
index c47d3c0e60..57ae6adc05 100644
--- a/include/dm/platform_data/serial_bcm283x_mu.h
+++ b/include/dm/platform_data/serial_bcm283x_mu.h
@@ -19,7 +19,6 @@  struct bcm283x_mu_serial_platdata {
 	unsigned long base;
 	unsigned int clock;
 	bool skip_init;
-	bool disabled;
 };
 
 #endif