/* Check that the given (port, pin) pair is a valid Kinetis GPIO pin. Returns 0 on success, -EINVAL otherwise.  */
static int kinetis_validate_gpio(const struct kinetis_gpio_dsc *dsc)
/* Check that the given (port, pin) pair is a valid Kinetis GPIO pin. Returns 0 on success, -EINVAL otherwise.  */
static int kinetis_validate_gpio(const struct kinetis_gpio_dsc *dsc)
{
	int rv;
	rv = 0;
	if (!dsc || dsc->port >= KINETIS_GPIO_PORTS ||
	    dsc->pin >= KINETIS_GPIO_PORT_PINS) {
		printk(KERN_ERR "%s: incorrect params %d.%d.\n", __func__,
			dsc ? dsc->port : -1,
			dsc ? dsc->pin  : -1);
		rv = -EINVAL;
	}
	return rv;
}