/** * amba_device_register - register an AMBA device * @dev: AMBA device to register * @parent: parent memory resource * * Setup the AMBA device, reading the cell ID if present. * Claim the resource, and register the AMBA device with * the Linux device manager. */ int amba_device_register(struct amba_device *dev, struct resource *parent) { amba_device_initialize(dev, dev->dev.init_name); dev->dev.init_name = NULL; return amba_device_add(dev, parent); }
/** * amba_device_register - register an AMBA device * @dev: AMBA device to register * @parent: parent memory resource * * Setup the AMBA device, reading the cell ID if present. * Claim the resource, and register the AMBA device with * the Linux device manager. */ int amba_device_register(struct amba_device *dev, struct resource *parent) { amba_device_initialize(dev, dev->dev.init_name); dev->dev.init_name = NULL; if (!dev->dev.coherent_dma_mask && dev->dma_mask) dev_warn(&dev->dev, "coherent dma mask is unset\n"); return amba_device_add(dev, parent); }
/** * amba_device_alloc - allocate an AMBA device * @name: sysfs name of the AMBA device * @base: base of AMBA device * @size: size of AMBA device * * Allocate and initialize an AMBA device structure. Returns %NULL * on failure. */ struct amba_device *amba_device_alloc(const char *name, resource_size_t base, size_t size) { struct amba_device *dev; dev = kzalloc(sizeof(*dev), GFP_KERNEL); if (dev) { amba_device_initialize(dev, name); dev->res.start = base; dev->res.end = base + size - 1; dev->res.flags = IORESOURCE_MEM; } return dev; }