/* Returns an error if attempting to stop a wdt  */
int mpc52xx_gpt_stop_timer(struct mpc52xx_gpt_priv *gpt)
/* Returns an error if attempting to stop a wdt  */
int mpc52xx_gpt_stop_timer(struct mpc52xx_gpt_priv *gpt)
{
	unsigned long flags;
	spin_lock_irqsave(&gpt->lock, flags);
	if ((gpt->wdt_mode & MPC52xx_GPT_IS_WDT) != 0) {
		spin_unlock_irqrestore(&gpt->lock, flags);
		return -EBUSY;
	}
	clrbits32(&gpt->regs->mode, MPC52xx_GPT_MODE_COUNTER_ENABLE);
	spin_unlock_irqrestore(&gpt->lock, flags);
	return 0;
}