Re: [PATCH 4/6] device: add cmdmem support for MMIO address

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> +/**
> + * devm_cmdmem_remap - Managed wrapper for cmdmem ioremap()
> + * @dev: Generic device to remap IO address for
> + * @offset: Resource address to map
> + * @size: Size of map
> + *
> + * Managed cmdmem ioremap() wrapper.  Map is automatically unmapped on
> + * driver detach.
> + */
> +void __iomem *devm_cmdmem_remap(struct device *dev, resource_size_t offset,
> +				 resource_size_t size)
> +{
> +	if (!device_supports_cmdmem(dev))
> +		return NULL;
> +
> +	return devm_ioremap(dev, offset, size);

All this could be trivially open coded in the caller.



[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux