[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200401071935.GB31076@infradead.org>
Date: Wed, 1 Apr 2020 00:19:35 -0700
From: Christoph Hellwig <hch@...radead.org>
To: Dave Jiang <dave.jiang@...el.com>
Cc: vkoul@...nel.org, tglx@...utronix.de, mingo@...hat.com,
bp@...en8.de, hpa@...or.com, bhelgaas@...gle.com,
gregkh@...uxfoundation.org, arnd@...db.de,
linux-kernel@...r.kernel.org, x86@...nel.org,
dmaengine@...r.kernel.org, dan.j.williams@...el.com,
ashok.raj@...el.com, fenghua.yu@...el.com,
linux-pci@...r.kernel.org, tony.luck@...el.com, jing.lin@...el.com,
sanjay.k.kumar@...el.com
Subject: Re: [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.
Powered by blists - more mailing lists