Thread (18 messages) 18 messages, 6 authors, 2015-01-26

[PATCH 07/16] ARM: integrator: convert PCI to use generic config accesses

From: Linus Walleij <hidden>
Date: 2015-01-12 00:05:15
Also in: linux-pci, lkml

On Sat, Jan 10, 2015 at 10:53 PM, Arnd Bergmann [off-list ref] wrote:
On Saturday 10 January 2015 22:40:22 Linus Walleij wrote:
quoted
quoted
 static int v3_read_config(struct pci_bus *bus, unsigned int devfn, int where,
                          int size, u32 *val)
 {
-       addr = v3_open_config_window(bus, devfn, where);
+       int ret = pci_generic_config_read(bus, devfn, where, size, val);
        v3_close_config_window();
+       return ret;
 }

 static int v3_write_config(struct pci_bus *bus, unsigned int devfn, int where,
                           int size, u32 val)
 {
+       int ret = pci_generic_config_write(bus, devfn, where, size, val);
        v3_close_config_window();
-       raw_spin_unlock_irqrestore(&v3_lock, flags);
+       return ret;
 }

 static struct pci_ops pci_v3_ops = {
+       .map_bus = v3_open_config_window,
        .read   = v3_read_config,
        .write  = v3_write_config,
So .map_bus is called before every .read/.write operation I take it.

Wouldn't it be proper to call the v3_close_config_window() from a
matching .unmap_bus() callback for symmetry?
It would be nicer for integrator but useless for anything else, so
I'd vote for leaving it the way Rob posted.
OK I buy that, throw in a comment about it in the code if there
is some time for iterating the patch.

Yours,
Linus Walleij
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help