Skip to content

Commit 46a2bc8

Browse files
committed
bus: fsl-mc-msi: Switch to domain id aware interfaces
Switch to the new domain id aware interfaces to phase out the previous ones. Get rid of the MSI descriptor and domain checks as the core code detects these issues anyway. No functional change. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Kevin Tian <kevin.tian@intel.com> Acked-by: Marc Zyngier <maz@kernel.org> Link: https://lore.kernel.org/r/20221124230314.575538524@linutronix.de
1 parent b330ff9 commit 46a2bc8

File tree

1 file changed

+3
-22
lines changed

1 file changed

+3
-22
lines changed

drivers/bus/fsl-mc/fsl-mc-msi.c

Lines changed: 3 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -213,29 +213,16 @@ struct irq_domain *fsl_mc_find_msi_domain(struct device *dev)
213213

214214
int fsl_mc_msi_domain_alloc_irqs(struct device *dev, unsigned int irq_count)
215215
{
216-
struct irq_domain *msi_domain;
217-
int error;
218-
219-
msi_domain = dev_get_msi_domain(dev);
220-
if (!msi_domain)
221-
return -EINVAL;
222-
223-
error = msi_setup_device_data(dev);
224-
if (error)
225-
return error;
216+
int error = msi_setup_device_data(dev);
226217

227-
msi_lock_descs(dev);
228-
if (msi_first_desc(dev, MSI_DESC_ALL))
229-
error = -EINVAL;
230-
msi_unlock_descs(dev);
231218
if (error)
232219
return error;
233220

234221
/*
235222
* NOTE: Calling this function will trigger the invocation of the
236223
* its_fsl_mc_msi_prepare() callback
237224
*/
238-
error = msi_domain_alloc_irqs(msi_domain, dev, irq_count);
225+
error = msi_domain_alloc_irqs_range(dev, MSI_DEFAULT_DOMAIN, 0, irq_count - 1);
239226

240227
if (error)
241228
dev_err(dev, "Failed to allocate IRQs\n");
@@ -244,11 +231,5 @@ int fsl_mc_msi_domain_alloc_irqs(struct device *dev, unsigned int irq_count)
244231

245232
void fsl_mc_msi_domain_free_irqs(struct device *dev)
246233
{
247-
struct irq_domain *msi_domain;
248-
249-
msi_domain = dev_get_msi_domain(dev);
250-
if (!msi_domain)
251-
return;
252-
253-
msi_domain_free_irqs(msi_domain, dev);
234+
msi_domain_free_irqs_all(dev, MSI_DEFAULT_DOMAIN);
254235
}

0 commit comments

Comments
 (0)