aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/tty/serial/amba-pl011.c
diff options
context:
space:
mode:
authorJongsung Kim <neidhard.kim@lge.com>2013-05-10 05:05:35 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-05-20 14:53:46 -0400
commitea33640a933e208301fea4fe7cbc6cc288e32cc6 (patch)
treecfe523f59d8c5d3cfb813535f9df75f9edddbbea /drivers/tty/serial/amba-pl011.c
parentcd97721a1b6bbf6eaa9ad050eb472c7f180bd0e0 (diff)
tty: serial: amba-pl011: revise to use amba_rev macro
This patch replaces the ugly bit-operations with the convenient amba_rev macro from the get_fifosize_arm function. The type of get_fifosize member function is also slightly changed to take a pointer to the amba_device. Signed-off-by: Jongsung Kim <neidhard.kim@lge.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/serial/amba-pl011.c')
-rw-r--r--drivers/tty/serial/amba-pl011.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c
index 8ab70a620919..85cfe116f423 100644
--- a/drivers/tty/serial/amba-pl011.c
+++ b/drivers/tty/serial/amba-pl011.c
@@ -79,13 +79,12 @@ struct vendor_data {
79 bool dma_threshold; 79 bool dma_threshold;
80 bool cts_event_workaround; 80 bool cts_event_workaround;
81 81
82 unsigned int (*get_fifosize)(unsigned int periphid); 82 unsigned int (*get_fifosize)(struct amba_device *dev);
83}; 83};
84 84
85static unsigned int get_fifosize_arm(unsigned int periphid) 85static unsigned int get_fifosize_arm(struct amba_device *dev)
86{ 86{
87 unsigned int rev = (periphid >> 20) & 0xf; 87 return amba_rev(dev) < 3 ? 16 : 32;
88 return rev < 3 ? 16 : 32;
89} 88}
90 89
91static struct vendor_data vendor_arm = { 90static struct vendor_data vendor_arm = {
@@ -98,7 +97,7 @@ static struct vendor_data vendor_arm = {
98 .get_fifosize = get_fifosize_arm, 97 .get_fifosize = get_fifosize_arm,
99}; 98};
100 99
101static unsigned int get_fifosize_st(unsigned int periphid) 100static unsigned int get_fifosize_st(struct amba_device *dev)
102{ 101{
103 return 64; 102 return 64;
104} 103}
@@ -2157,7 +2156,7 @@ static int pl011_probe(struct amba_device *dev, const struct amba_id *id)
2157 uap->lcrh_rx = vendor->lcrh_rx; 2156 uap->lcrh_rx = vendor->lcrh_rx;
2158 uap->lcrh_tx = vendor->lcrh_tx; 2157 uap->lcrh_tx = vendor->lcrh_tx;
2159 uap->old_cr = 0; 2158 uap->old_cr = 0;
2160 uap->fifosize = vendor->get_fifosize(dev->periphid); 2159 uap->fifosize = vendor->get_fifosize(dev);
2161 uap->port.dev = &dev->dev; 2160 uap->port.dev = &dev->dev;
2162 uap->port.mapbase = dev->res.start; 2161 uap->port.mapbase = dev->res.start;
2163 uap->port.membase = base; 2162 uap->port.membase = base;