omap: Eliminate OMAP_MAX_NR_PORTS
Eliminate OMAP_MAX_NR_PORTS Note that also the null terminator entry for omap1 serial_platform_data needs to be now removed to avoid oopsing. Note that mach-omap1 uses struct plat_serial8250_port array, which requires a null terminator at the end, and that's why we need to use ARRAY_SIZE - 1. This is not needed on mach-omap2 as the array used is struct omap_uart_state, and does not use a null terminator. Signed-off-by: Alexander Shishkin <virtuoso@slind.org> Acked-by: Kevin Hilman <khilman@deeprootsystems.com> Signed-off-by: Ladislav Michl <ladis@linux-mips.org> Signed-off-by: Tony Lindgren <tony@atomide.com>
This commit is contained in:
committed by
Tony Lindgren
parent
f014ee320e
commit
9d30b99f35
@@ -533,7 +533,7 @@ static inline void omap_uart_idle_init(struct omap_uart_state *uart) {}
|
||||
#define DEV_CREATE_FILE(dev, attr)
|
||||
#endif /* CONFIG_PM */
|
||||
|
||||
static struct omap_uart_state omap_uart[OMAP_MAX_NR_PORTS] = {
|
||||
static struct omap_uart_state omap_uart[] = {
|
||||
{
|
||||
.pdev = {
|
||||
.name = "serial8250",
|
||||
@@ -583,7 +583,7 @@ void __init omap_serial_early_init(void)
|
||||
* if not needed.
|
||||
*/
|
||||
|
||||
for (i = 0; i < OMAP_MAX_NR_PORTS; i++) {
|
||||
for (i = 0; i < ARRAY_SIZE(omap_uart); i++) {
|
||||
struct omap_uart_state *uart = &omap_uart[i];
|
||||
struct platform_device *pdev = &uart->pdev;
|
||||
struct device *dev = &pdev->dev;
|
||||
@@ -635,7 +635,7 @@ void __init omap_serial_init(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < OMAP_MAX_NR_PORTS; i++) {
|
||||
for (i = 0; i < ARRAY_SIZE(omap_uart); i++) {
|
||||
struct omap_uart_state *uart = &omap_uart[i];
|
||||
struct platform_device *pdev = &uart->pdev;
|
||||
struct device *dev = &pdev->dev;
|
||||
|
Reference in New Issue
Block a user