/* defines four GPIOs (so this function will return 4), two of which are not specified.  */
unsigned int of_gpio_count(struct device_node *np)
/* defines four GPIOs (so this function will return 4), two of which are not specified.  */
unsigned int of_gpio_count(struct device_node *np)
{
	unsigned int cnt = 0;
	do {
		int ret;
		ret = of_parse_phandles_with_args(np, "gpios", "#gpio-cells",
						  cnt, NULL, NULL);
		if (ret < 0 && ret != -EEXIST)
			break;
	} while (++cnt);
	return cnt;
}