serial: pl01x: disable as per type of pl01x
pl010 & pl011 have different control register offsets, setting it as per
the pl01x type.
Signed-off-by: Vikas Manocha <vikas.manocha@st.com>
Acked-by: Simon Glass <sjg@chromium.org>
diff --git a/drivers/serial/serial_pl01x.c b/drivers/serial/serial_pl01x.c
index fb11210..2a6b61d 100644
--- a/drivers/serial/serial_pl01x.c
+++ b/drivers/serial/serial_pl01x.c
@@ -82,13 +82,14 @@
}
#endif
- /* First, disable everything */
- writel(0, ®s->pl010_cr);
-
switch (type) {
case TYPE_PL010:
+ /* disable everything */
+ writel(0, ®s->pl010_cr);
break;
case TYPE_PL011:
+ /* disable everything */
+ writel(0, ®s->pl011_cr);
break;
default:
return -EINVAL;