[u-boot] rkplat: irqs: NR_IRQS instead of NR_IRQS_MAXNUM.
Change-Id: I2976a05c039aefad8d5c44ff869f4c2959efb188 Signed-off-by: Firefly <service@t-firefly.com> (cherry picked from commit 719f7dd4a3f66d498011fb010b8928e59e0fd8ae)
This commit is contained in:
@ -20,7 +20,7 @@ struct s_irq_handler {
|
||||
void (*m_func)(void *data);
|
||||
};
|
||||
|
||||
static struct s_irq_handler g_irq_handler[NR_IRQS_MAXNUM];
|
||||
static struct s_irq_handler g_irq_handler[NR_IRQS];
|
||||
|
||||
|
||||
/* general interrupt server handler for gpio chip */
|
||||
@ -90,7 +90,7 @@ static inline int irq_init(void)
|
||||
gd->flags |= GD_FLG_IRQINIT;
|
||||
|
||||
debug("rk irq version: %s, initialized.\n", RKIRQ_VERSION);
|
||||
for (i = 0; i < NR_IRQS_MAXNUM; i++)
|
||||
for (i = 0; i < NR_IRQS; i++)
|
||||
g_irq_handler[i].m_func = NULL;
|
||||
|
||||
/* gic irq init */
|
||||
@ -117,7 +117,7 @@ void enable_imprecise_aborts(void)
|
||||
/* enable irq handler */
|
||||
int irq_handler_enable(int irq)
|
||||
{
|
||||
if (irq >= NR_IRQS_MAXNUM)
|
||||
if (irq >= NR_IRQS)
|
||||
return -1;
|
||||
|
||||
if (irq < NR_GIC_IRQS)
|
||||
@ -134,7 +134,7 @@ int irq_handler_enable(int irq)
|
||||
/* disable irq handler */
|
||||
int irq_handler_disable(int irq)
|
||||
{
|
||||
if (irq >= NR_IRQS_MAXNUM)
|
||||
if (irq >= NR_IRQS)
|
||||
return -1;
|
||||
|
||||
if (irq < NR_GIC_IRQS)
|
||||
@ -155,7 +155,7 @@ int irq_handler_disable(int irq)
|
||||
*/
|
||||
int irq_set_irq_type(int irq, unsigned int type)
|
||||
{
|
||||
if (irq >= NR_IRQS_MAXNUM)
|
||||
if (irq >= NR_IRQS)
|
||||
return -1;
|
||||
|
||||
if (irq < NR_GIC_IRQS)
|
||||
@ -172,7 +172,7 @@ int irq_set_irq_type(int irq, unsigned int type)
|
||||
/* irq interrupt install handle */
|
||||
void irq_install_handler(int irq, interrupt_handler_t *handler, void *data)
|
||||
{
|
||||
if (irq >= NR_IRQS_MAXNUM || !handler) {
|
||||
if (irq >= NR_IRQS || !handler) {
|
||||
printf("error: irq = %d, handler = 0x%p, data = 0x%p.\n", irq, handler, data);
|
||||
return;
|
||||
}
|
||||
@ -185,7 +185,7 @@ void irq_install_handler(int irq, interrupt_handler_t *handler, void *data)
|
||||
/* interrupt uninstall handler */
|
||||
void irq_uninstall_handler(int irq)
|
||||
{
|
||||
if (irq >= NR_IRQS_MAXNUM)
|
||||
if (irq >= NR_IRQS)
|
||||
return;
|
||||
|
||||
g_irq_handler[irq].m_func = NULL;
|
||||
|
||||
@ -18,7 +18,7 @@ struct s_irq_handler {
|
||||
void (*m_func)(void *data);
|
||||
};
|
||||
|
||||
static struct s_irq_handler g_irq_handler[NR_IRQS_MAXNUM];
|
||||
static struct s_irq_handler g_irq_handler[NR_IRQS];
|
||||
|
||||
|
||||
/* general interrupt server handler for gpio chip */
|
||||
@ -75,7 +75,7 @@ static inline int irq_init(void)
|
||||
gd->flags |= GD_FLG_IRQINIT;
|
||||
|
||||
debug("rk irq version: %s, initialized.\n", RKIRQ_VERSION);
|
||||
for (i = 0; i < NR_IRQS_MAXNUM; i++)
|
||||
for (i = 0; i < NR_IRQS; i++)
|
||||
g_irq_handler[i].m_func = NULL;
|
||||
|
||||
gic_get_cpumask();
|
||||
@ -107,7 +107,7 @@ void enable_imprecise_aborts(void)
|
||||
/* enable irq handler */
|
||||
int irq_handler_enable(int irq)
|
||||
{
|
||||
if (irq >= NR_IRQS_MAXNUM)
|
||||
if (irq >= NR_IRQS)
|
||||
return -1;
|
||||
|
||||
if (irq < NR_GIC_IRQS)
|
||||
@ -124,7 +124,7 @@ int irq_handler_enable(int irq)
|
||||
/* disable irq handler */
|
||||
int irq_handler_disable(int irq)
|
||||
{
|
||||
if (irq >= NR_IRQS_MAXNUM)
|
||||
if (irq >= NR_IRQS)
|
||||
return -1;
|
||||
|
||||
if (irq < NR_GIC_IRQS)
|
||||
@ -145,7 +145,7 @@ int irq_handler_disable(int irq)
|
||||
*/
|
||||
int irq_set_irq_type(int irq, unsigned int type)
|
||||
{
|
||||
if (irq >= NR_IRQS_MAXNUM)
|
||||
if (irq >= NR_IRQS)
|
||||
return -1;
|
||||
|
||||
if (irq < NR_GIC_IRQS)
|
||||
@ -162,7 +162,7 @@ int irq_set_irq_type(int irq, unsigned int type)
|
||||
/* irq interrupt install handle */
|
||||
void irq_install_handler(int irq, interrupt_handler_t *handler, void *data)
|
||||
{
|
||||
if (irq >= NR_IRQS_MAXNUM || !handler) {
|
||||
if (irq >= NR_IRQS || !handler) {
|
||||
printf("error: irq = %d, handler = 0x%p, data = 0x%p.\n", irq, handler, data);
|
||||
return ;
|
||||
}
|
||||
@ -175,7 +175,7 @@ void irq_install_handler(int irq, interrupt_handler_t *handler, void *data)
|
||||
/* interrupt uninstall handler */
|
||||
void irq_uninstall_handler(int irq)
|
||||
{
|
||||
if (irq >= NR_IRQS_MAXNUM)
|
||||
if (irq >= NR_IRQS)
|
||||
return ;
|
||||
|
||||
g_irq_handler[irq].m_func = NULL;
|
||||
|
||||
@ -69,10 +69,6 @@
|
||||
|
||||
#define NR_GIC_IRQS (4 * 32)
|
||||
#define NR_GPIO_IRQS (3 * 32)
|
||||
#define NR_BOARD_IRQS 64
|
||||
#define NR_IRQS (NR_GIC_IRQS + NR_GPIO_IRQS + NR_BOARD_IRQS)
|
||||
|
||||
|
||||
#define NR_IRQS_MAXNUM (NR_GIC_IRQS + NR_GPIO_IRQS)
|
||||
#define NR_IRQS (NR_GIC_IRQS + NR_GPIO_IRQS)
|
||||
|
||||
#endif /* __RK3036_IRQS_H */
|
||||
|
||||
@ -87,10 +87,6 @@
|
||||
|
||||
#define NR_GIC_IRQS (4 * 32)
|
||||
#define NR_GPIO_IRQS (4 * 32)
|
||||
#define NR_BOARD_IRQS 64
|
||||
#define NR_IRQS (NR_GIC_IRQS + NR_GPIO_IRQS + NR_BOARD_IRQS)
|
||||
|
||||
|
||||
#define NR_IRQS_MAXNUM (NR_GIC_IRQS + NR_GPIO_IRQS)
|
||||
#define NR_IRQS (NR_GIC_IRQS + NR_GPIO_IRQS)
|
||||
|
||||
#endif /* __RK3036_IRQS_H */
|
||||
|
||||
@ -88,10 +88,6 @@
|
||||
|
||||
#define NR_GIC_IRQS (4 * 32)
|
||||
#define NR_GPIO_IRQS (4 * 32)
|
||||
#define NR_BOARD_IRQS 64
|
||||
#define NR_IRQS (NR_GIC_IRQS + NR_GPIO_IRQS + NR_BOARD_IRQS)
|
||||
|
||||
|
||||
#define NR_IRQS_MAXNUM (NR_GIC_IRQS + NR_GPIO_IRQS)
|
||||
#define NR_IRQS (NR_GIC_IRQS + NR_GPIO_IRQS)
|
||||
|
||||
#endif /* __RK322X_IRQS_H */
|
||||
|
||||
@ -131,10 +131,6 @@
|
||||
|
||||
#define NR_GIC_IRQS (5 * 32)
|
||||
#define NR_GPIO_IRQS (9 * 32)
|
||||
#define NR_BOARD_IRQS 64
|
||||
#define NR_IRQS (NR_GIC_IRQS + NR_GPIO_IRQS + NR_BOARD_IRQS)
|
||||
|
||||
|
||||
#define NR_IRQS_MAXNUM (NR_GIC_IRQS + NR_GPIO_IRQS)
|
||||
#define NR_IRQS (NR_GIC_IRQS + NR_GPIO_IRQS)
|
||||
|
||||
#endif /* __RK3288_IRQS_H */
|
||||
|
||||
@ -124,11 +124,7 @@
|
||||
|
||||
#define NR_GIC_IRQS (5 * 32)
|
||||
#define NR_GPIO_IRQS (4 * 32)
|
||||
#define NR_BOARD_IRQS 64
|
||||
#define NR_IRQS (NR_GIC_IRQS + NR_GPIO_IRQS + NR_BOARD_IRQS)
|
||||
|
||||
|
||||
#define NR_IRQS_MAXNUM (NR_GIC_IRQS + NR_GPIO_IRQS)
|
||||
#define NR_IRQS (NR_GIC_IRQS + NR_GPIO_IRQS)
|
||||
|
||||
|
||||
#endif /* __RK3368_IRQS_H */
|
||||
|
||||
Reference in New Issue
Block a user