/* Returns the bank number and pin offset within the bank.  */
static void zynq_gpio_get_bank_pin(unsigned int pin_num, unsigned int *bank_num, unsigned int *bank_pin_num, struct udevice *dev)
/* Returns the bank number and pin offset within the bank.  */
static void zynq_gpio_get_bank_pin(unsigned int pin_num, unsigned int *bank_num, unsigned int *bank_pin_num, struct udevice *dev)
{
	struct zynq_gpio_platdata *platdata = dev_get_platdata(dev);
	u32 bank;
	for (bank = 0; bank < platdata->p_data->max_bank; bank++) {
		if (pin_num >= platdata->p_data->bank_min[bank] &&
		    pin_num <= platdata->p_data->bank_max[bank]) {
			*bank_num = bank;
			*bank_pin_num = pin_num -
					platdata->p_data->bank_min[bank];
			return;
		}
	}
	if (bank >= platdata->p_data->max_bank) {
		printf("Invalid bank and pin num\n");
		*bank_num = 0;
		*bank_pin_num = 0;
	}
}