static int gpio_post_probe(struct udevice *dev) { struct gpio_dev_priv *uc_priv = dev_get_uclass_priv(dev); uc_priv->name = calloc(uc_priv->gpio_count, sizeof(char *)); if (!uc_priv->name) return -ENOMEM; return gpio_renumber(NULL); }
static int gpio_pre_remove(struct udevice *dev) { struct gpio_dev_priv *uc_priv = dev_get_uclass_priv(dev); int i; for (i = 0; i < uc_priv->gpio_count; i++) { if (uc_priv->name[i]) free(uc_priv->name[i]); } free(uc_priv->name); return gpio_renumber(dev); }
static int gpio_pre_remove(struct device *dev) { return gpio_renumber(); }
static int gpio_post_probe(struct device *dev) { return gpio_renumber(); }