/* @priv: IRQ router driver's priv data @reg: PIRQ routing register offset from the base address  */
static int pirq_reg_to_linkno(struct irq_router *priv, int reg)
/* @priv: IRQ router driver's priv data @reg: PIRQ routing register offset from the base address  */
static int pirq_reg_to_linkno(struct irq_router *priv, int reg)
{
	int linkno = 0;
	if (priv->has_regmap) {
		struct pirq_regmap *map = priv->regmap;
		int i;
		for (i = 0; i < priv->link_num; i++) {
			if (reg - priv->link_base == map->offset) {
				linkno = map->link;
				break;
			}
			map++;
		}
	} else {
		linkno = reg - priv->link_base;
	}
	return linkno;
}