There is 'platform_get_irq', which does the check, or returns the correct error code otherwise.