From 852710d9fd9f2e59fcec65cc701867db4e801bc7 Mon Sep 17 00:00:00 2001 From: Matthew Wilcox Date: Fri, 19 Jun 2009 09:36:15 -0400 Subject: yenta: Use pci_claim_resource Instead of open-coding pci_find_parent_resource and request_resource, just call pci_claim_resource. Signed-off-by: Matthew Wilcox Signed-off-by: Jesse Barnes --- drivers/pcmcia/yenta_socket.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'drivers/pcmcia') diff --git a/drivers/pcmcia/yenta_socket.c b/drivers/pcmcia/yenta_socket.c index 3ecd7c99d8eb..737fe5d87c40 100644 --- a/drivers/pcmcia/yenta_socket.c +++ b/drivers/pcmcia/yenta_socket.c @@ -622,11 +622,12 @@ static int yenta_search_res(struct yenta_socket *socket, struct resource *res, static int yenta_allocate_res(struct yenta_socket *socket, int nr, unsigned type, int addr_start, int addr_end) { - struct resource *root, *res; + struct pci_dev *dev = socket->dev; + struct resource *res; struct pci_bus_region region; unsigned mask; - res = socket->dev->resource + PCI_BRIDGE_RESOURCES + nr; + res = dev->resource + PCI_BRIDGE_RESOURCES + nr; /* Already allocated? */ if (res->parent) return 0; @@ -636,17 +637,16 @@ static int yenta_allocate_res(struct yenta_socket *socket, int nr, unsigned type if (type & IORESOURCE_IO) mask = ~3; - res->name = socket->dev->subordinate->name; + res->name = dev->subordinate->name; res->flags = type; region.start = config_readl(socket, addr_start) & mask; region.end = config_readl(socket, addr_end) | ~mask; if (region.start && region.end > region.start && !override_bios) { - pcibios_bus_to_resource(socket->dev, res, ®ion); - root = pci_find_parent_resource(socket->dev, res); - if (root && (request_resource(root, res) == 0)) + pcibios_bus_to_resource(dev, res, ®ion); + if (pci_claim_resource(dev, PCI_BRIDGE_RESOURCES + nr) == 0) return 0; - dev_printk(KERN_INFO, &socket->dev->dev, + dev_printk(KERN_INFO, &dev->dev, "Preassigned resource %d busy or not available, " "reconfiguring...\n", nr); @@ -672,7 +672,7 @@ static int yenta_allocate_res(struct yenta_socket *socket, int nr, unsigned type return 1; } - dev_printk(KERN_INFO, &socket->dev->dev, + dev_printk(KERN_INFO, &dev->dev, "no resource of type %x available, trying to continue...\n", type); res->start = res->end = res->flags = 0; -- cgit v1.2.3 From a0779327d25bc74a50b23136e278dba24c628741 Mon Sep 17 00:00:00 2001 From: Roel Kluin Date: Tue, 9 Dec 2008 22:12:50 +0100 Subject: pcmcia: drivers/pcmcia: Make static Sparse asked whether these could be static. Signed-off-by: Roel Kluin Signed-off-by: Wolfram Sang Signed-off-by: Greg Kroah-Hartman --- drivers/pcmcia/pcmcia_ioctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/pcmcia') diff --git a/drivers/pcmcia/pcmcia_ioctl.c b/drivers/pcmcia/pcmcia_ioctl.c index 6095f8daecd7..7b424e0b0449 100644 --- a/drivers/pcmcia/pcmcia_ioctl.c +++ b/drivers/pcmcia/pcmcia_ioctl.c @@ -286,7 +286,7 @@ static int pccard_get_status(struct pcmcia_socket *s, return 0; } /* pccard_get_status */ -int pccard_get_configuration_info(struct pcmcia_socket *s, +static int pccard_get_configuration_info(struct pcmcia_socket *s, struct pcmcia_device *p_dev, config_info_t *config) { -- cgit v1.2.3 From d598de02187e4de89595537f69dffe8334f9a066 Mon Sep 17 00:00:00 2001 From: Joe Perches Date: Sun, 28 Jun 2009 09:26:41 -0700 Subject: pcmcia: drivers/pcmcia/pcmcia_resource.c: Remove unnecessary semicolons Signed-off-by: Joe Perches Signed-off-by: Wolfram Sang Signed-off-by: Greg Kroah-Hartman --- drivers/pcmcia/pcmcia_resource.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/pcmcia') diff --git a/drivers/pcmcia/pcmcia_resource.c b/drivers/pcmcia/pcmcia_resource.c index f5d0ba8e22d5..8c2db2ac8f8a 100644 --- a/drivers/pcmcia/pcmcia_resource.c +++ b/drivers/pcmcia/pcmcia_resource.c @@ -489,7 +489,7 @@ int pcmcia_request_configuration(struct pcmcia_device *p_dev, pccard_io_map iomap; if (!(s->state & SOCKET_PRESENT)) - return -ENODEV;; + return -ENODEV; if (req->IntType & INT_CARDBUS) { ds_dbg(p_dev->socket, 0, "IntType may not be INT_CARDBUS\n"); -- cgit v1.2.3 From b4b3d7bbe1e1d924dc5f3b48b6c06977aee2d494 Mon Sep 17 00:00:00 2001 From: Wolfram Sang Date: Mon, 20 Jul 2009 10:58:59 +0200 Subject: pcmcia: fix incorrect argument order to list_add_tail() Commit a56bc69a182f501582557af7fad5bc882b1c856c fixed a wrong usage of list_add_tail() within store_new_id() for PCI. Port the fix to PCMCIA, which adapted this function from PCI. Signed-off-by: Wolfram Sang Cc: Dominik Brodowski Cc: Greg Kroah-Hartman --- drivers/pcmcia/ds.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'drivers/pcmcia') diff --git a/drivers/pcmcia/ds.c b/drivers/pcmcia/ds.c index 304ff6d5cf3b..9f300d3cb125 100644 --- a/drivers/pcmcia/ds.c +++ b/drivers/pcmcia/ds.c @@ -236,7 +236,6 @@ pcmcia_store_new_id(struct device_driver *driver, const char *buf, size_t count) if (!dynid) return -ENOMEM; - INIT_LIST_HEAD(&dynid->node); dynid->id.match_flags = match_flags; dynid->id.manf_id = manf_id; dynid->id.card_id = card_id; @@ -246,7 +245,7 @@ pcmcia_store_new_id(struct device_driver *driver, const char *buf, size_t count) memcpy(dynid->id.prod_id_hash, prod_id_hash, sizeof(__u32) * 4); spin_lock(&pdrv->dynids.lock); - list_add_tail(&pdrv->dynids.list, &dynid->node); + list_add_tail(&dynid->node, &pdrv->dynids.list); spin_unlock(&pdrv->dynids.lock); if (get_driver(&pdrv->drv)) { -- cgit v1.2.3 From 1ff84890b62b20823b3697a6041bbec1b5280cee Mon Sep 17 00:00:00 2001 From: Tomas Kovacik Date: Sun, 26 Jul 2009 22:04:58 +0200 Subject: pcmcia: disable prefetch/burst for OZ6933 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Problems have been reported [1], so disable prefetch/burst, to be on the safe side. [1] http://www.mail-archive.com/linux-pcmcia@lists.infradead.org/msg02048.html Signed-off-by: Tomáš Kováčik Signed-off-by: Wolfram Sang Signed-off-by: Greg Kroah-Hartman --- drivers/pcmcia/o2micro.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'drivers/pcmcia') diff --git a/drivers/pcmcia/o2micro.h b/drivers/pcmcia/o2micro.h index 5554015a7813..72188c462c9c 100644 --- a/drivers/pcmcia/o2micro.h +++ b/drivers/pcmcia/o2micro.h @@ -48,6 +48,9 @@ #ifndef PCI_DEVICE_ID_O2_6812 #define PCI_DEVICE_ID_O2_6812 0x6872 #endif +#ifndef PCI_DEVICE_ID_O2_6933 +#define PCI_DEVICE_ID_O2_6933 0x6933 +#endif /* Additional PCI configuration registers */ @@ -154,6 +157,7 @@ static int o2micro_override(struct yenta_socket *socket) case PCI_DEVICE_ID_O2_6812: case PCI_DEVICE_ID_O2_6832: case PCI_DEVICE_ID_O2_6836: + case PCI_DEVICE_ID_O2_6933: dev_printk(KERN_INFO, &socket->dev->dev, "Yenta O2: old bridge, disabling read " "prefetch/write burst\n"); -- cgit v1.2.3 From cc677441007a48f56117e74ac8cfc19c7851fac7 Mon Sep 17 00:00:00 2001 From: Wolfram Sang Date: Mon, 27 Jul 2009 11:35:07 +0200 Subject: pcmcia: drop non-existant includes See http://lists.infradead.org/pipermail/linux-pcmcia/2009-April/006109.html Reported-by: Robert P. J. Day Signed-off-by: Wolfram Sang Signed-off-by: Greg Kroah-Hartman --- drivers/pcmcia/au1000_pb1x00.c | 1 - drivers/pcmcia/au1000_xxs1500.c | 1 - 2 files changed, 2 deletions(-) (limited to 'drivers/pcmcia') diff --git a/drivers/pcmcia/au1000_pb1x00.c b/drivers/pcmcia/au1000_pb1x00.c index d6b4bd1db7d7..b1984ed72d1d 100644 --- a/drivers/pcmcia/au1000_pb1x00.c +++ b/drivers/pcmcia/au1000_pb1x00.c @@ -26,7 +26,6 @@ #include #include #include -#include #include #include #include diff --git a/drivers/pcmcia/au1000_xxs1500.c b/drivers/pcmcia/au1000_xxs1500.c index 9627390835ca..b43d47b50819 100644 --- a/drivers/pcmcia/au1000_xxs1500.c +++ b/drivers/pcmcia/au1000_xxs1500.c @@ -30,7 +30,6 @@ #include #include #include -#include #include #include #include -- cgit v1.2.3 From 889c27744c30eb7a43b68c11e33e679cfafc8cd5 Mon Sep 17 00:00:00 2001 From: Wolfram Sang Date: Wed, 29 Jul 2009 14:25:37 +0200 Subject: pcmcia: document return value of pcmcia_loop_config Hopefully it will be harder to get it wrong now. Also fix an unneeded initialization while we are here. Signed-off-by: Wolfram Sang Signed-off-by: Greg Kroah-Hartman --- drivers/pcmcia/pcmcia_resource.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers/pcmcia') diff --git a/drivers/pcmcia/pcmcia_resource.c b/drivers/pcmcia/pcmcia_resource.c index 8c2db2ac8f8a..d919e96c0afd 100644 --- a/drivers/pcmcia/pcmcia_resource.c +++ b/drivers/pcmcia/pcmcia_resource.c @@ -902,7 +902,7 @@ struct pcmcia_cfg_mem { * * pcmcia_loop_config() loops over all configuration options, and calls * the driver-specific conf_check() for each one, checking whether - * it is a valid one. + * it is a valid one. Returns 0 on success or errorcode otherwise. */ int pcmcia_loop_config(struct pcmcia_device *p_dev, int (*conf_check) (struct pcmcia_device *p_dev, @@ -915,7 +915,7 @@ int pcmcia_loop_config(struct pcmcia_device *p_dev, struct pcmcia_cfg_mem *cfg_mem; tuple_t *tuple; - int ret = -ENODEV; + int ret; unsigned int vcc; cfg_mem = kzalloc(sizeof(struct pcmcia_cfg_mem), GFP_KERNEL); -- cgit v1.2.3