/* Check that the given (pin group, pin) pair is a valid LPC18xx pin. Returns 0 on success, -EINVAL otherwise.  */
static int lpc18xx_validate_pin(const struct lpc18xx_iomux_dsc *dsc)
/* Check that the given (pin group, pin) pair is a valid LPC18xx pin. Returns 0 on success, -EINVAL otherwise.  */
static int lpc18xx_validate_pin(const struct lpc18xx_iomux_dsc *dsc)
{
	int rv;
	rv = 0;
	if (!dsc ||
		((dsc->group >= LPC18XX_IOMUX_GROUPS ||
			dsc->pin >= LPC18XX_IOMUX_GROUP_PINS) &&
		(dsc->group != LPC18XX_IOMUX_CLK_GROUP ||
			dsc->pin >= LPC18XX_IOMUX_CLK_PINS))) {
		if (gd->have_console) {
			printf("IOMUX: incorrect params %d.%d.\n",
				dsc ? dsc->group : -1,
				dsc ? dsc->pin : -1);
		}
		rv = -EINVAL;
	}
	return rv;
}