lkml.org 
[lkml]   [2020]   [Apr]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 4/6] device: add cmdmem support for MMIO address
> +/**
> + * 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.

\
 
 \ /
  Last update: 2020-04-01 09:20    [W:0.088 / U:8.912 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site