/*
* Manually set the parent of the SPI flash to SPI, since dtoc doesn't. We also
* need to allocate the parent_platdata since by the time this function is
- * called device_bind() has already gone past that step.
+ * called device_bind_offset() has already gone past that step.
*/
static int apl_flash_bind(struct udevice *dev)
{
return -ENOENT;
}
- ret = device_bind(parent, drv, name, NULL, -1, &clk->dev);
+ ret = device_bind_offset(parent, drv, name, NULL, -1, &clk->dev);
if (ret) {
printf("%s: CLK: %s driver bind error [%d]!\n", __func__, name,
ret);
0, devp);
}
-int device_bind(struct udevice *parent, const struct driver *drv,
- const char *name, void *platdata, int of_offset,
- struct udevice **devp)
+int device_bind_offset(struct udevice *parent, const struct driver *drv,
+ const char *name, void *platdata, int of_offset,
+ struct udevice **devp)
{
return device_bind_common(parent, drv, name, platdata, 0,
offset_to_ofnode(of_offset), 0, devp);
plat->gpio_count = MTK_BANK_WIDTH;
plat->bank = bank;
- ret = device_bind(parent, parent->driver,
- plat->bank_name, plat, -1, &dev);
+ ret = device_bind_offset(parent, parent->driver,
+ plat->bank_name, plat, -1, &dev);
if (ret)
return ret;
return -ENOMEM;
plat->bank_name = fdt_get_name(blob, node, NULL);
- ret = device_bind(parent, parent->driver,
- plat->bank_name, plat, -1, &dev);
+ ret = device_bind_offset(parent, parent->driver,
+ plat->bank_name, plat, -1, &dev);
if (ret)
return ret;
plat->bank_name = gpio_bank_name(soc_data->start + bank);
plat->gpio_count = SUNXI_GPIOS_PER_BANK;
- ret = device_bind(parent, parent->driver,
- plat->bank_name, plat, -1, &dev);
+ ret = device_bind_offset(parent, parent->driver,
+ plat->bank_name, plat, -1, &dev);
if (ret)
return ret;
dev_set_of_offset(dev, dev_of_offset(parent));
plat->name = ctlr_data->ports[port].name;
plat->regs = &(regs[ctlr_data->ports[port].offset / 4]);
- ret = device_bind(parent, parent->driver, plat->name, plat,
- -1, &dev);
+ ret = device_bind_offset(parent, parent->driver, plat->name,
+ plat, -1, &dev);
if (ret)
return ret;
dev_set_of_offset(dev, dev_of_offset(parent));
plat->base_gpio = TEGRA_GPIOS_PER_PORT * base_port;
plat->port_name = gpio_port_name(base_port);
- ret = device_bind(parent, parent->driver,
- plat->port_name, plat, -1, &dev);
+ ret = device_bind_offset(parent, parent->driver,
+ plat->port_name, plat, -1,
+ &dev);
if (ret)
return ret;
dev_set_of_offset(dev, dev_of_offset(parent));
sprintf(name, "mvpp2-%d", id);
/* Create child device UCLASS_ETH and bind it */
- device_bind(parent, &mvpp2_driver, name, plat, subnode, &dev);
+ device_bind_offset(parent, &mvpp2_driver, name, plat, subnode, &dev);
dev_set_of_offset(dev, subnode);
}
struct udevice *pdev;
/* Create GPIO device as well */
- ret = device_bind(dev, lists_driver_lookup_name("gpio_bcm2835"),
- "gpio_bcm2835", NULL, dev_of_offset(dev), &pdev);
+ ret = device_bind_offset(dev, lists_driver_lookup_name("gpio_bcm2835"),
+ "gpio_bcm2835", NULL, dev_of_offset(dev),
+ &pdev);
if (ret) {
/*
* While we really want the pinctrl driver to work to make
sprintf(name, "meson-gpio");
/* Create child device UCLASS_GPIO and bind it */
- device_bind(dev, priv->data->gpio_driver, name, NULL, gpio, &gpio_dev);
+ device_bind_offset(dev, priv->data->gpio_driver, name, NULL, gpio, &gpio_dev);
dev_set_of_offset(gpio_dev, gpio);
return 0;
if (ret)
return ret;
- ret = device_bind(dev, &jr2_gpio_driver, "jr2-gpio", NULL,
- dev_of_offset(dev), NULL);
+ ret = device_bind_offset(dev, &jr2_gpio_driver, "jr2-gpio", NULL,
+ dev_of_offset(dev), NULL);
if (ret)
return ret;
if (ret)
return ret;
- ret = device_bind(dev, &luton_gpio_driver, "luton-gpio", NULL,
- dev_of_offset(dev), NULL);
+ ret = device_bind_offset(dev, &luton_gpio_driver, "luton-gpio", NULL,
+ dev_of_offset(dev), NULL);
return 0;
}
if (ret)
return ret;
- ret = device_bind(dev, &ocelot_gpio_driver, "ocelot-gpio", NULL,
- dev_of_offset(dev), NULL);
+ ret = device_bind_offset(dev, &ocelot_gpio_driver, "ocelot-gpio", NULL,
+ dev_of_offset(dev), NULL);
return ret;
}
if (ret)
return ret;
- ret = device_bind(dev, &serval_gpio_driver, "serval-gpio", NULL,
- dev_of_offset(dev), NULL);
+ ret = device_bind_offset(dev, &serval_gpio_driver, "serval-gpio", NULL,
+ dev_of_offset(dev), NULL);
if (ret)
return ret;
if (ret)
return ret;
- ret = device_bind(dev, &servalt_gpio_driver, "servalt-gpio", NULL,
- dev_of_offset(dev), NULL);
+ ret = device_bind_offset(dev, &servalt_gpio_driver, "servalt-gpio", NULL,
+ dev_of_offset(dev), NULL);
if (ret)
return ret;
sprintf(name, "armada-37xx-gpio");
/* Create child device UCLASS_GPIO and bind it */
- device_bind(parent, &armada_37xx_gpio_driver, name, NULL, subnode,
- &dev);
+ device_bind_offset(parent, &armada_37xx_gpio_driver, name, NULL,
+ subnode, &dev);
dev_set_of_offset(dev, subnode);
return 0;
- 'include/power/regulator.h'
- 'drivers/power/pmic/pmic-uclass.c'
- 'drivers/power/pmic/regulator-uclass.c'
- It's important to call the device_bind() with the proper node offset,
+ It's important to call the device_bind_offset() with the proper node offset,
when binding the regulator devices. The pmic_bind_childs() can be used
for this purpose if PMIC I/O driver is implemented or dm_scan_fdt_dev()
otherwise. Detailed information can be found in the header file.
struct udevice;
/**
- * device_bind() - Create a device and bind it to a driver
+ * device_bind_offset() - Create a device and bind it to a driver
*
* Called to set up a new device attached to a driver. The device will either
* have platdata, or a device tree node which can be used to create the
* @devp: if non-NULL, returns a pointer to the bound device
* @return 0 if OK, -ve on error
*/
-int device_bind(struct udevice *parent, const struct driver *drv,
- const char *name, void *platdata, int of_offset,
- struct udevice **devp);
+int device_bind_offset(struct udevice *parent, const struct driver *drv,
+ const char *name, void *platdata, int of_offset,
+ struct udevice **devp);
int device_bind_ofnode(struct udevice *parent, const struct driver *drv,
const char *name, void *platdata, ofnode node,
* If regulator-name property is not provided, node name will be chosen.
*
* Regulator bind:
- * For each regulator device, the device_bind() should be called with passed
+ * For each regulator device, the device_bind_offset() should be called with passed
* device tree offset. This is required for this uclass's '.post_bind' method,
* which does the scan on the device node, for the 'regulator-name' constraint.
* If the parent is not a PMIC device, and the child is not bind by function: