On Fri, Mar 20, 2015 at 4:17 PM, Luis R. Rodriguez <mcg...@do-not-panic.com> wrote: > From: "Luis R. Rodriguez" <mcg...@suse.com> > > We have devm_ioremap_nocache() but no devm_ioremap_wc() > so add that. This will be used later. > > Cc: Suresh Siddha <suresh.b.sid...@intel.com> > Cc: Venkatesh Pallipadi <venkatesh.pallip...@intel.com> > Cc: Ingo Molnar <mi...@elte.hu> > Cc: Thomas Gleixner <t...@linutronix.de> > Cc: Juergen Gross <jgr...@suse.com> > Cc: Daniel Vetter <daniel.vet...@ffwll.ch> > Cc: Andy Lutomirski <l...@amacapital.net> > Cc: Dave Airlie <airl...@redhat.com> > Cc: Antonino Daplas <adap...@gmail.com> > Cc: Jean-Christophe Plagniol-Villard <plagn...@jcrosoft.com> > Cc: Tomi Valkeinen <tomi.valkei...@ti.com> > Cc: linux-fb...@vger.kernel.org > Cc: linux-ker...@vger.kernel.org > Signed-off-by: Luis R. Rodriguez <mcg...@suse.com>
Looks good to me. > --- > Documentation/driver-model/devres.txt | 1 + > include/linux/io.h | 2 ++ > lib/devres.c | 29 +++++++++++++++++++++++++++++ > 3 files changed, 32 insertions(+) > > diff --git a/Documentation/driver-model/devres.txt > b/Documentation/driver-model/devres.txt > index e1e2bbd..831a536 100644 > --- a/Documentation/driver-model/devres.txt > +++ b/Documentation/driver-model/devres.txt > @@ -276,6 +276,7 @@ IOMAP > devm_ioport_unmap() > devm_ioremap() > devm_ioremap_nocache() > + devm_ioremap_wc() > devm_ioremap_resource() : checks resource, requests memory region, ioremaps > devm_iounmap() > pcim_iomap() > diff --git a/include/linux/io.h b/include/linux/io.h > index 4cc299c..91101a1 100644 > --- a/include/linux/io.h > +++ b/include/linux/io.h > @@ -72,6 +72,8 @@ void __iomem *devm_ioremap(struct device *dev, > resource_size_t offset, > resource_size_t size); > void __iomem *devm_ioremap_nocache(struct device *dev, resource_size_t > offset, > resource_size_t size); > +void __iomem *devm_ioremap_wc(struct device *dev, resource_size_t offset, > + resource_size_t size); > void devm_iounmap(struct device *dev, void __iomem *addr); > int check_signature(const volatile void __iomem *io_addr, > const unsigned char *signature, int length); > diff --git a/lib/devres.c b/lib/devres.c > index 0f1dd2e..2eb2bfe 100644 > --- a/lib/devres.c > +++ b/lib/devres.c > @@ -72,6 +72,35 @@ void __iomem *devm_ioremap_nocache(struct device *dev, > resource_size_t offset, > EXPORT_SYMBOL(devm_ioremap_nocache); > > /** > + * devm_ioremap_wc - Managed ioremap_wc() > + * @dev: Generic device to remap IO address for > + * @offset: BUS offset to map > + * @size: Size of map > + * > + * Managed ioremap_wc(). Map is automatically unmapped on driver > + * detach. > + */ > +void __iomem *devm_ioremap_wc(struct device *dev, resource_size_t offset, > + resource_size_t size) > +{ > + void __iomem **ptr, *addr; > + > + ptr = devres_alloc(devm_ioremap_release, sizeof(*ptr), GFP_KERNEL); > + if (!ptr) > + return NULL; > + > + addr = ioremap_wc(offset, size); > + if (addr) { > + *ptr = addr; > + devres_add(dev, ptr); > + } else > + devres_free(ptr); > + > + return addr; > +} > +EXPORT_SYMBOL_GPL(devm_ioremap_wc); > + > +/** > * devm_iounmap - Managed iounmap() > * @dev: Generic device to unmap for > * @addr: Address to unmap > -- > 2.3.2.209.gd67f9d5.dirty > -- Andy Lutomirski AMA Capital Management, LLC _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel