powerpc/mpic: Remove MPIC_BROKEN_FRR_NIRQS and duplicate irq_count
The mpic->irq_count variable is only used as a software error-checking limit to determine whether or not an IRQ number is valid. In board code which does not manually specify an IRQ count to mpic_alloc(), i.e. 0, it is automatically detected from the number of ISUs and the ISU size. In practice, all hardware ends up with irq_count == num_sources, so all of the runtime checks on mpic->irq_count should just check the value of mpic->num_sources instead. When platform hardware does not correctly report the number of IRQs, which only happens on the MPC85xx/MPC86xx, the MPIC_BROKEN_FRR_NIRQS flag is used to override the detected value of num_sources with the manual irq_count parameter. Since there's no need to manually specify the number of IRQs except in this case, the extra flag can be eliminated and the test changed to "irq_count != 0". Signed-off-by: Kyle Moffett <Kyle.D.Moffett@boeing.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
This commit is contained in:
committed by
Benjamin Herrenschmidt
parent
9ca163c860
commit
5019609fce
@@ -54,7 +54,7 @@ static int mpic_msi_reserve_u3_hwirqs(struct mpic *mpic)
|
||||
for (i = 100; i < 105; i++)
|
||||
msi_bitmap_reserve_hwirq(&mpic->msi_bitmap, i);
|
||||
|
||||
for (i = 124; i < mpic->irq_count; i++)
|
||||
for (i = 124; i < mpic->num_sources; i++)
|
||||
msi_bitmap_reserve_hwirq(&mpic->msi_bitmap, i);
|
||||
|
||||
|
||||
@@ -83,7 +83,7 @@ int mpic_msi_init_allocator(struct mpic *mpic)
|
||||
{
|
||||
int rc;
|
||||
|
||||
rc = msi_bitmap_alloc(&mpic->msi_bitmap, mpic->irq_count,
|
||||
rc = msi_bitmap_alloc(&mpic->msi_bitmap, mpic->num_sources,
|
||||
mpic->irqhost->of_node);
|
||||
if (rc)
|
||||
return rc;
|
||||
|
Reference in New Issue
Block a user