Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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

+3 -22
+3 -22
drivers/bus/fsl-mc/fsl-mc-msi.c
··· 213 213 214 214 int fsl_mc_msi_domain_alloc_irqs(struct device *dev, unsigned int irq_count) 215 215 { 216 - struct irq_domain *msi_domain; 217 - int error; 216 + int error = msi_setup_device_data(dev); 218 217 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; 226 - 227 - msi_lock_descs(dev); 228 - if (msi_first_desc(dev, MSI_DESC_ALL)) 229 - error = -EINVAL; 230 - msi_unlock_descs(dev); 231 218 if (error) 232 219 return error; 233 220 ··· 222 235 * NOTE: Calling this function will trigger the invocation of the 223 236 * its_fsl_mc_msi_prepare() callback 224 237 */ 225 - error = msi_domain_alloc_irqs(msi_domain, dev, irq_count); 238 + error = msi_domain_alloc_irqs_range(dev, MSI_DEFAULT_DOMAIN, 0, irq_count - 1); 226 239 227 240 if (error) 228 241 dev_err(dev, "Failed to allocate IRQs\n"); ··· 231 244 232 245 void fsl_mc_msi_domain_free_irqs(struct device *dev) 233 246 { 234 - struct irq_domain *msi_domain; 235 - 236 - msi_domain = dev_get_msi_domain(dev); 237 - if (!msi_domain) 238 - return; 239 - 240 - msi_domain_free_irqs(msi_domain, dev); 247 + msi_domain_free_irqs_all(dev, MSI_DEFAULT_DOMAIN); 241 248 }