unsigned cider;
int gpio;
- netdev = alloc_etherdev(sizeof(struct ks8851_net));
+ netdev = devm_alloc_etherdev(dev, sizeof(struct ks8851_net));
if (!netdev)
return -ENOMEM;
ks->tx_space = 6144;
gpio = of_get_named_gpio_flags(dev->of_node, "reset-gpios", 0, NULL);
- if (gpio == -EPROBE_DEFER) {
- ret = gpio;
- goto err_gpio;
- }
+ if (gpio == -EPROBE_DEFER)
+ return gpio;
ks->gpio = gpio;
if (gpio_is_valid(gpio)) {
GPIOF_OUT_INIT_LOW, "ks8851_rst_n");
if (ret) {
dev_err(dev, "reset gpio request failed\n");
- goto err_gpio;
+ return ret;
}
}
err_reg:
regulator_disable(ks->vdd_io);
err_reg_io:
-err_gpio:
- free_netdev(netdev);
return ret;
}
gpio_set_value(priv->gpio, 0);
regulator_disable(priv->vdd_reg);
regulator_disable(priv->vdd_io);
- free_netdev(priv->netdev);
return 0;
}