Skip to contentSkip to conversation

pcmcia: bugfixes for 2.6.19-rc3

RFC PATCH New Dominik Brodowski 1 participant 12 messages Oct 26, 2006

Subsystems (5)
lore
Share & tools
lore

Dominik Brodowski

author maintainer
#0 lore raw

cover pcmcia: bugfixes for 2.6.19-rc3

Hi,

The following eleven patches have all been queued in -mm for quite some time; the only change is that one suggestion by Pavel Roskin (to remove the "RevA" part of the new ID for hostap_cs.c) is implemented. Please let me know if there are any objections to any of these patches; if not, I'll submit them to Linus really soon now.

Thanks,
Dominik

 drivers/net/wireless/hostap/hostap_cs.c |    7 +++++++
 drivers/pcmcia/at91_cf.c                |   28 +++++++++-------------------
 drivers/pcmcia/au1000_generic.c         |   25 +++++++++++++++++++------
 drivers/pcmcia/ds.c                     |   29 ++++++++++++++++++++++++-----
 drivers/pcmcia/i82092.c                 |    9 +++++----
 drivers/pcmcia/m8xx_pcmcia.c            |   12 ++++++++----
 drivers/pcmcia/omap_cf.c                |    3 ++-
 drivers/pcmcia/pcmcia_ioctl.c           |   11 ++++++++---
 drivers/pcmcia/pcmcia_resource.c        |    2 +-
 drivers/pcmcia/pd6729.c                 |    4 ++++
 drivers/pcmcia/soc_common.c             |    1 +
 drivers/pcmcia/yenta_socket.c           |   22 +++++++++++++++++-----
 12 files changed, 105 insertions(+), 48 deletions(-)

----
Alexey Dobriyan (2):
CONFIG_PM=n slim: drivers/pcmcia/*
i82092: wire up errors from pci_register_driver()

Amol Lad (1):
ioremap balanced with iounmap for drivers/pcmcia

David Brownell (1):
pcmcia: at91_cf update

Dominik Brodowski (2):
pcmcia: add more IDs to hostap_cs.c
PCMCIA: fix __must_check warnings

Jeff Garzik (1):
PCMCIA: handle sysfs, PCI errors

Jonathan McDowell (1):
Export soc_common_drv_pcmcia_remove to allow modular PCMCIA.

Kaustav Majumdar (1):
pcmcia: update alloc_io_space for conflict checking for multifunction PC card

Om Narasimhan (1):
pcmcia: au1000_generic fix

Randy Dunlap (1):
pcmcia/ds: driver layer error checking

author maintainer
#1 lore raw

RFC PATCH 1/11 pcmcia: at91_cf update

From: David Brownell <[email protected]>
Date: Sat, 1 Jul 2006 13:39:55 -0700
Subject: [PATCH] pcmcia: at91_cf update

More correct AT91 CF wakeup logic ... only enable/disable the IRQ wakeup capability, not the IRQ itself. That way the we know that the IRQ will be disabled correctly, in suspend/resume logic instead of ARM IRQ code.

Most of the pin multiplexing setup has moved to the devices.c setup code.

---
 drivers/pcmcia/at91_cf.c |   25 +++++++------------------
 1 files changed, 7 insertions(+), 18 deletions(-)
drivers/pcmcia/at91_cf.c +7 -18
index 7f5df9a..f8db6e3 100644
@@ -241,12 +241,6 @@ static int __init at91_cf_probe(struct p
 	csa = at91_sys_read(AT91_EBI_CSA);
 	at91_sys_write(AT91_EBI_CSA, csa | AT91_EBI_CS4A_SMC_COMPACTFLASH);
 
-	/* force poweron defaults for these pins ... */
-	(void) at91_set_A_periph(AT91_PIN_PC9, 0);	/* A25/CFRNW */
-	(void) at91_set_A_periph(AT91_PIN_PC10, 0);	/* NCS4/CFCS */
-	(void) at91_set_A_periph(AT91_PIN_PC11, 0);	/* NCS5/CFCE1 */
-	(void) at91_set_A_periph(AT91_PIN_PC12, 0);	/* NCS6/CFCE2 */
-
 	/* nWAIT is _not_ a default setting */
 	(void) at91_set_A_periph(AT91_PIN_PC6, 1);	/*  nWAIT */
 
@@ -322,6 +316,7 @@ fail1:
 	if (board->irq_pin)
 		free_irq(board->irq_pin, cf);
 fail0a:
+	device_init_wakeup(&pdev->dev, 0);
 	free_irq(board->det_pin, cf);
 	device_init_wakeup(&pdev->dev, 0);
 fail0:
@@ -360,26 +355,20 @@ static int at91_cf_suspend(struct platfo
 	struct at91_cf_data	*board = cf->board;
 
 	pcmcia_socket_dev_suspend(&pdev->dev, mesg);
-	if (device_may_wakeup(&pdev->dev))
+	if (device_may_wakeup(&pdev->dev)) {
 		enable_irq_wake(board->det_pin);
-	else {
+		if (board->irq_pin)
+			enable_irq_wake(board->irq_pin);
+	} else {
 		disable_irq_wake(board->det_pin);
-		disable_irq(board->det_pin);
+		if (board->irq_pin)
+			disable_irq_wake(board->irq_pin);
 	}
-	if (board->irq_pin)
-		disable_irq(board->irq_pin);
 	return 0;
 }
 
 static int at91_cf_resume(struct platform_device *pdev)
 {
-	struct at91_cf_socket	*cf = platform_get_drvdata(pdev);
-	struct at91_cf_data	*board = cf->board;
-
-	if (board->irq_pin)
-		enable_irq(board->irq_pin);
-	if (!device_may_wakeup(&pdev->dev))
-		enable_irq(board->det_pin);
 	pcmcia_socket_dev_resume(&pdev->dev);
 	return 0;
 }
Signature · 1 line
1.4.3
author maintainer
#2 lore raw

RFC PATCH 2/11 pcmcia: add more IDs to hostap_cs.c

In reply to Dominik Brodowski

From: Dominik Brodowski <[email protected]>
Date: Sun, 2 Jul 2006 21:21:51 +0200
Subject: [PATCH] pcmcia: add more IDs to hostap_cs.c

As a replacement for the broad manufactor/card ID match we commented out because of conflicts with pcnet_cs, add two product ID matches.

---
 drivers/net/wireless/hostap/hostap_cs.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
drivers/net/wireless/hostap/hostap_cs.c +7 -0
index 686d895..f63909e 100644
@@ -887,6 +887,13 @@ static struct pcmcia_device_id hostap_cs
 	PCMCIA_DEVICE_PROD_ID123(
 		"U.S. Robotics", "IEEE 802.11b PC-CARD", "Version 01.02",
 		0xc7b8df9d, 0x1700d087, 0x4b74baa0),
+	PCMCIA_DEVICE_PROD_ID123(
+		"Allied Telesyn", "AT-WCL452 Wireless PCMCIA Radio",
+		"Ver. 1.00",
+		0x5cd01705, 0x4271660f, 0x9d08ee12),
+	PCMCIA_DEVICE_PROD_ID123(
+		"corega", "WL PCCL-11", "ISL37300P",
+		0xa21501a, 0x59868926, 0xc9049a39),
 	PCMCIA_DEVICE_NULL
 };
 MODULE_DEVICE_TABLE(pcmcia, hostap_cs_ids);
Signature · 1 line
1.4.3
author maintainer
#3 lore raw

RFC PATCH 3/11 pcmcia: update alloc_io_space for conflict checking for multifunction PC card

In reply to Dominik Brodowski

From: Kaustav Majumdar <[email protected]>
Date: Fri, 20 Oct 2006 14:44:09 -0700
Subject: [PATCH] pcmcia: update alloc_io_space for conflict checking for multifunction PC card

Some PCMCIA cards do not mention specific IO addresses in the CIS. In that case, inside the alloc_io_space function, conflicts are detected (the function returns 1) for the second function of a multifunction card unless the length of IO address range required is greater than 0x100.

The following patch will remove this conflict checking for a PCMCIA function which had not mentioned any specific IO address to be mapped from.

The patch is tested for Linux kernel 2.6.15.4 and works fine in the above case and is as suggested by Dave Hinds.

---
 drivers/pcmcia/pcmcia_resource.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/pcmcia/pcmcia_resource.c +1 -1
index 74cebd4..b9201c2 100644
@@ -95,7 +95,7 @@ static int alloc_io_space(struct pcmcia_
 	 * potential conflicts, just the most obvious ones.
 	 */
 	for (i = 0; i < MAX_IO_WIN; i++)
-		if ((s->io[i].res) &&
+		if ((s->io[i].res) && *base &&
 		    ((s->io[i].res->start & (align-1)) == *base))
 			return 1;
 	for (i = 0; i < MAX_IO_WIN; i++) {
Signature · 1 line
1.4.3
author maintainer
#4 lore raw

RFC PATCH 4/11 pcmcia/ds: driver layer error checking

In reply to Dominik Brodowski

From: Randy Dunlap <[email protected]>
Date: Fri, 20 Oct 2006 14:44:12 -0700
Subject: [PATCH] pcmcia/ds: driver layer error checking

Check driver layer return values in pcmcia/ds.c

---
 drivers/pcmcia/ds.c |   16 ++++++++++++++--
 1 files changed, 14 insertions(+), 2 deletions(-)
drivers/pcmcia/ds.c +14 -2
index 74b3124..af392bf 100644
@@ -1292,10 +1292,22 @@ struct bus_type pcmcia_bus_type = {
 
 static int __init init_pcmcia_bus(void)
 {
+	int ret;
+
 	spin_lock_init(&pcmcia_dev_list_lock);
 
-	bus_register(&pcmcia_bus_type);
-	class_interface_register(&pcmcia_bus_interface);
+	ret = bus_register(&pcmcia_bus_type);
+	if (ret < 0) {
+		printk(KERN_WARNING "pcmcia: bus_register error: %d\n", ret);
+		return ret;
+	}
+	ret = class_interface_register(&pcmcia_bus_interface);
+	if (ret < 0) {
+		printk(KERN_WARNING
+			"pcmcia: class_interface_register error: %d\n", ret);
+		bus_unregister(&pcmcia_bus_type);
+		return ret;
+	}
 
 	pcmcia_setup_ioctl();
 
Signature · 1 line
1.4.3
author maintainer
#5 lore raw

RFC PATCH 5/11 CONFIG_PM=n slim: drivers/pcmcia/*

In reply to Dominik Brodowski

From: Alexey Dobriyan <[email protected]>
Date: Fri, 20 Oct 2006 14:44:13 -0700
Subject: [PATCH] CONFIG_PM=n slim: drivers/pcmcia/*

Remove some code which is unneeded if CONFIG_PM=n.

---
 drivers/pcmcia/i82092.c       |    4 ++++
 drivers/pcmcia/pd6729.c       |    4 ++++
 drivers/pcmcia/yenta_socket.c |    6 ++++--
 3 files changed, 12 insertions(+), 2 deletions(-)
drivers/pcmcia/i82092.c +4 -0
index 82715f4..d316d95 100644
@@ -41,6 +41,7 @@ static struct pci_device_id i82092aa_pci
 };
 MODULE_DEVICE_TABLE(pci, i82092aa_pci_ids);
 
+#ifdef CONFIG_PM
 static int i82092aa_socket_suspend (struct pci_dev *dev, pm_message_t state)
 {
 	return pcmcia_socket_dev_suspend(&dev->dev, state);
@@ -50,14 +51,17 @@ static int i82092aa_socket_resume (struc
 {
 	return pcmcia_socket_dev_resume(&dev->dev);
 }
+#endif
 
 static struct pci_driver i82092aa_pci_drv = {
 	.name           = "i82092aa",
 	.id_table       = i82092aa_pci_ids,
 	.probe          = i82092aa_pci_probe,
 	.remove         = __devexit_p(i82092aa_pci_remove),
+#ifdef CONFIG_PM
 	.suspend        = i82092aa_socket_suspend,
 	.resume         = i82092aa_socket_resume,
+#endif
 };
 
 
drivers/pcmcia/pd6729.c +4 -0
index c83a0a6..a70f97f 100644
@@ -755,6 +755,7 @@ static void __devexit pd6729_pci_remove(
 	kfree(socket);
 }
 
+#ifdef CONFIG_PM
 static int pd6729_socket_suspend(struct pci_dev *dev, pm_message_t state)
 {
 	return pcmcia_socket_dev_suspend(&dev->dev, state);
@@ -764,6 +765,7 @@ static int pd6729_socket_resume(struct p
 {
 	return pcmcia_socket_dev_resume(&dev->dev);
 }
+#endif
 
 static struct pci_device_id pd6729_pci_ids[] = {
 	{
@@ -781,8 +783,10 @@ static struct pci_driver pd6729_pci_drv 
 	.id_table	= pd6729_pci_ids,
 	.probe		= pd6729_pci_probe,
 	.remove		= __devexit_p(pd6729_pci_remove),
+#ifdef CONFIG_PM
 	.suspend	= pd6729_socket_suspend,
 	.resume		= pd6729_socket_resume,
+#endif
 };
 
 static int pd6729_module_init(void)
drivers/pcmcia/yenta_socket.c +4 -2
index 26229d9..9ced52a 100644
@@ -1213,7 +1213,7 @@ static int __devinit yenta_probe (struct
 	return ret;
 }
 
-
+#ifdef CONFIG_PM
 static int yenta_dev_suspend (struct pci_dev *dev, pm_message_t state)
 {
 	struct yenta_socket *socket = pci_get_drvdata(dev);
@@ -1262,7 +1262,7 @@ static int yenta_dev_resume (struct pci_
 
 	return pcmcia_socket_dev_resume(&dev->dev);
 }
-
+#endif
 
 #define CB_ID(vend,dev,type)				\
 	{						\
@@ -1359,8 +1359,10 @@ static struct pci_driver yenta_cardbus_d
 	.id_table	= yenta_table,
 	.probe		= yenta_probe,
 	.remove		= __devexit_p(yenta_close),
+#ifdef CONFIG_PM
 	.suspend	= yenta_dev_suspend,
 	.resume		= yenta_dev_resume,
+#endif
 };
 
 
Signature · 1 line
1.4.3
author maintainer
#6 lore raw

RFC PATCH 6/11 i82092: wire up errors from pci_register_driver()

In reply to Dominik Brodowski

From: Alexey Dobriyan <[email protected]>
Date: Fri, 20 Oct 2006 14:44:13 -0700
Subject: [PATCH] i82092: wire up errors from pci_register_driver()

debugging goo removed to not leave assymetry in it after possible "leave" removal.

---
 drivers/pcmcia/i82092.c |    5 +----
 1 files changed, 1 insertions(+), 4 deletions(-)
drivers/pcmcia/i82092.c +1 -4
index d316d95..c2ea07a 100644
@@ -709,10 +709,7 @@ static int i82092aa_set_mem_map(struct p
 
 static int i82092aa_module_init(void)
 {
-	enter("i82092aa_module_init");
-	pci_register_driver(&i82092aa_pci_drv);
-	leave("i82092aa_module_init");
-	return 0;
+	return pci_register_driver(&i82092aa_pci_drv);
 }
 
 static void i82092aa_module_exit(void)
Signature · 1 line
1.4.3
author maintainer
#7 lore raw

RFC PATCH 7/11 pcmcia: au1000_generic fix

In reply to Dominik Brodowski

From: Om Narasimhan <[email protected]>
Date: Fri, 20 Oct 2006 14:44:15 -0700
Subject: [PATCH] pcmcia: au1000_generic fix

The previous code did something like,

if (error) goto out_err;
....

do {
             struct au1000_pcmcia_socket *skt = PCMCIA_SOCKET(i);
              del_timer_sync(&skt->poll_timer);
               pcmcia_unregister_socket(&skt->socket);
out_err:
               flush_scheduled_work();
               ops->hw_shutdown(skt);
               i--;
} while (i > 0)

.....

- On the error path, skt would not contain a valid value for the first iteration (skt is masked by uninitialized automatic skt)

- Does not do hw_shutdown() for 0th element of PCMCIA_SOCKET

---
 drivers/pcmcia/au1000_generic.c |   15 +++++++++------
 1 files changed, 9 insertions(+), 6 deletions(-)
drivers/pcmcia/au1000_generic.c +9 -6
index d5dd0ce..5387de6 100644
@@ -351,6 +351,7 @@ struct skt_dev_info {
 int au1x00_pcmcia_socket_probe(struct device *dev, struct pcmcia_low_level *ops, int first, int nr)
 {
 	struct skt_dev_info *sinfo;
+	struct au1000_pcmcia_socket *skt;
 	int ret, i;
 
 	sinfo = kzalloc(sizeof(struct skt_dev_info), GFP_KERNEL);
@@ -365,7 +366,7 @@ int au1x00_pcmcia_socket_probe(struct de
 	 * Initialise the per-socket structure.
 	 */
 	for (i = 0; i < nr; i++) {
-		struct au1000_pcmcia_socket *skt = PCMCIA_SOCKET(i);
+		skt = PCMCIA_SOCKET(i);
 		memset(skt, 0, sizeof(*skt));
 
 		skt->socket.resource_ops = &pccard_static_ops;
@@ -438,17 +439,19 @@ #endif
 	dev_set_drvdata(dev, sinfo);
 	return 0;
 
-	do {
-		struct au1000_pcmcia_socket *skt = PCMCIA_SOCKET(i);
+
+out_err:
+	flush_scheduled_work();
+	ops->hw_shutdown(skt);
+	while (i-- > 0) {
+		skt = PCMCIA_SOCKET(i);
 
 		del_timer_sync(&skt->poll_timer);
 		pcmcia_unregister_socket(&skt->socket);
-out_err:
 		flush_scheduled_work();
 		ops->hw_shutdown(skt);
 
-		i--;
-	} while (i > 0);
+	}
 	kfree(sinfo);
 out:
 	return ret;
Signature · 1 line
1.4.3
author maintainer
#8 lore raw

RFC PATCH 8/11 ioremap balanced with iounmap for drivers/pcmcia

In reply to Dominik Brodowski

From: Amol Lad <[email protected]>
Date: Fri, 20 Oct 2006 14:44:18 -0700
Subject: [PATCH] ioremap balanced with iounmap for drivers/pcmcia

ioremap must be balanced by an iounmap and failing to do so can result in a memory leak.

---
 drivers/pcmcia/at91_cf.c        |    3 ++-
 drivers/pcmcia/au1000_generic.c |   10 ++++++++++
 drivers/pcmcia/m8xx_pcmcia.c    |   12 ++++++++----
 drivers/pcmcia/omap_cf.c        |    3 ++-
 4 files changed, 22 insertions(+), 6 deletions(-)
drivers/pcmcia/at91_cf.c +2 -1
index f8db6e3..3bcb7dc 100644
@@ -310,9 +310,10 @@ static int __init at91_cf_probe(struct p
 	return 0;
 
 fail2:
-	iounmap((void __iomem *) cf->socket.io_offset);
 	release_mem_region(io->start, io->end + 1 - io->start);
 fail1:
+	if (cf->socket.io_offset)
+		iounmap((void __iomem *) cf->socket.io_offset);
 	if (board->irq_pin)
 		free_irq(board->irq_pin, cf);
 fail0a:
drivers/pcmcia/au1000_generic.c +10 -0
index 5387de6..551bde5 100644
@@ -449,6 +449,16 @@ out_err:
 		del_timer_sync(&skt->poll_timer);
 		pcmcia_unregister_socket(&skt->socket);
 		flush_scheduled_work();
+		if (i == 0) {
+			iounmap(skt->virt_io + (u32)mips_io_port_base);
+			skt->virt_io = NULL;
+		}
+#ifndef CONFIG_MIPS_XXS1500
+		else {
+			iounmap(skt->virt_io + (u32)mips_io_port_base);
+			skt->virt_io = NULL;
+		}
+#endif
 		ops->hw_shutdown(skt);
 
 	}
drivers/pcmcia/m8xx_pcmcia.c +8 -4
index e070a28..3b72be8 100644
@@ -427,7 +427,7 @@ static int voltage_set(int slot, int vcc
 			reg |= BCSR1_PCCVCC1;
 			break;
 		default:
-			return 1;
+			goto out_unmap;
 	}
 
 	switch(vpp) {
@@ -438,15 +438,15 @@ static int voltage_set(int slot, int vcc
 			if(vcc == vpp)
 				reg |= BCSR1_PCCVPP1;
 			else
-				return 1;
+				goto out_unmap;
 			break;
 		case 120:
 			if ((vcc == 33) || (vcc == 50))
 				reg |= BCSR1_PCCVPP0;
 			else
-				return 1;
+				goto out_unmap;
 		default:
-			return 1;
+			goto out_unmap;
 	}
 
 	/* first, turn off all power */
@@ -457,6 +457,10 @@ static int voltage_set(int slot, int vcc
 
 	iounmap(bcsr_io);
 	return 0;
+
+out_unmap:
+	iounmap(bcsr_io);
+	return 1;
 }
 
 #define socket_get(_slot_) PCMCIA_SOCKET_KEY_5V
drivers/pcmcia/omap_cf.c +2 -1
index c8e838c..06bf7f4 100644
@@ -309,9 +309,10 @@ static int __devinit omap_cf_probe(struc
 	return 0;
 
 fail2:
-	iounmap((void __iomem *) cf->socket.io_offset);
 	release_mem_region(cf->phys_cf, SZ_8K);
 fail1:
+	if (cf->socket.io_offset)
+		iounmap((void __iomem *) cf->socket.io_offset);
 	free_irq(irq, cf);
 fail0:
 	kfree(cf);
Signature · 1 line
1.4.3
author maintainer
#9 lore raw

RFC PATCH 9/11 Export soc_common_drv_pcmcia_remove to allow modular PCMCIA

In reply to Dominik Brodowski

From: Jonathan McDowell <[email protected]>
Date: Fri, 20 Oct 2006 14:44:19 -0700
Subject: [PATCH] Export soc_common_drv_pcmcia_remove to allow modular PCMCIA.

Allow a modular sa1100_cs.

---
 drivers/pcmcia/soc_common.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
drivers/pcmcia/soc_common.c +1 -0
index 3627e52..e433704 100644
@@ -824,3 +824,4 @@ int soc_common_drv_pcmcia_remove(struct 
 
 	return 0;
 }
+EXPORT_SYMBOL(soc_common_drv_pcmcia_remove);
Signature · 1 line
1.4.3
author maintainer
#10 lore raw

RFC PATCH 10/11 PCMCIA: handle sysfs, PCI errors

In reply to Dominik Brodowski

From: Jeff Garzik <[email protected]>
Date: Fri, 20 Oct 2006 14:44:23 -0700
Subject: [PATCH] PCMCIA: handle sysfs, PCI errors

Handle sysfs and PCI errors correctly.

---
 drivers/pcmcia/pcmcia_ioctl.c |   11 ++++++++---
 drivers/pcmcia/yenta_socket.c |   16 +++++++++++++---
 2 files changed, 21 insertions(+), 6 deletions(-)
drivers/pcmcia/pcmcia_ioctl.c +8 -3
index 9ad18e6..310ede5 100644
@@ -128,9 +128,12 @@ static int proc_read_drivers(char *buf, 
 			     int count, int *eof, void *data)
 {
 	char *p = buf;
+	int rc;
 
-	bus_for_each_drv(&pcmcia_bus_type, NULL,
-			 (void *) &p, proc_read_drivers_callback);
+	rc = bus_for_each_drv(&pcmcia_bus_type, NULL,
+			      (void *) &p, proc_read_drivers_callback);
+	if (rc < 0)
+		return rc;
 
 	return (p - buf);
 }
@@ -269,8 +272,10 @@ rescan:
 	 * Prevent this racing with a card insertion.
 	 */
 	mutex_lock(&s->skt_mutex);
-	bus_rescan_devices(&pcmcia_bus_type);
+	ret = bus_rescan_devices(&pcmcia_bus_type);
 	mutex_unlock(&s->skt_mutex);
+	if (ret)
+		goto err_put_module;
 
 	/* check whether the driver indeed matched. I don't care if this
 	 * is racy or not, because it can only happen on cardmgr access
drivers/pcmcia/yenta_socket.c +13 -3
index 9ced52a..da471bd 100644
@@ -1197,8 +1197,12 @@ static int __devinit yenta_probe (struct
 	ret = pcmcia_register_socket(&socket->socket);
 	if (ret == 0) {
 		/* Add the yenta register attributes */
-		device_create_file(&dev->dev, &dev_attr_yenta_registers);
-		goto out;
+		ret = device_create_file(&dev->dev, &dev_attr_yenta_registers);
+		if (ret == 0)
+			goto out;
+
+		/* error path... */
+		pcmcia_unregister_socket(&socket->socket);
 	}
 
  unmap:
@@ -1248,12 +1252,18 @@ static int yenta_dev_resume (struct pci_
 	struct yenta_socket *socket = pci_get_drvdata(dev);
 
 	if (socket) {
+		int rc;
+
 		pci_set_power_state(dev, 0);
 		/* FIXME: pci_restore_state needs to have a better interface */
 		pci_restore_state(dev);
 		pci_write_config_dword(dev, 16*4, socket->saved_state[0]);
 		pci_write_config_dword(dev, 17*4, socket->saved_state[1]);
-		pci_enable_device(dev);
+
+		rc = pci_enable_device(dev);
+		if (rc)
+			return rc;
+
 		pci_set_master(dev);
 
 		if (socket->type && socket->type->restore_state)
Signature · 1 line
1.4.3
author maintainer
#11 lore raw

RFC PATCH 11/11 PCMCIA: fix __must_check warnings

In reply to Dominik Brodowski

From: Dominik Brodowski <[email protected]>
Date: Wed, 25 Oct 2006 19:56:55 -0400
Subject: [PATCH] PCMCIA: fix __must_check warnings

Fix the remaining __must_check warnings in the PCMCIA core.

---
 drivers/pcmcia/ds.c |   13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)
drivers/pcmcia/ds.c +10 -3
index af392bf..0f70192 100644
@@ -717,6 +717,7 @@ static int pcmcia_requery(struct device 
 static void pcmcia_bus_rescan(struct pcmcia_socket *skt)
 {
 	int no_devices=0;
+	int ret = 0;
 	unsigned long flags;
 
 	/* must be called with skt_mutex held */
@@ -729,7 +730,7 @@ static void pcmcia_bus_rescan(struct pcm
 	 * missing resource information or other trouble, we need to
 	 * do this now. */
 	if (no_devices) {
-		int ret = pcmcia_card_add(skt);
+		ret = pcmcia_card_add(skt);
 		if (ret)
 			return;
 	}
@@ -741,7 +742,9 @@ static void pcmcia_bus_rescan(struct pcm
 
 	/* we re-scan all devices, not just the ones connected to this
 	 * socket. This does not matter, though. */
-	bus_rescan_devices(&pcmcia_bus_type);
+	ret = bus_rescan_devices(&pcmcia_bus_type);
+	if (ret)
+		printk(KERN_INFO "pcmcia: bus_rescan_devices failed\n");
 }
 
 static inline int pcmcia_devmatch(struct pcmcia_device *dev,
@@ -1001,6 +1004,7 @@ static ssize_t pcmcia_store_allow_func_i
 		struct device_attribute *attr, const char *buf, size_t count)
 {
 	struct pcmcia_device *p_dev = to_pcmcia_dev(dev);
+	int ret;
 
 	if (!count)
 		return -EINVAL;
@@ -1009,7 +1013,10 @@ static ssize_t pcmcia_store_allow_func_i
 	p_dev->allow_func_id_match = 1;
 	mutex_unlock(&p_dev->socket->skt_mutex);
 
-	bus_rescan_devices(&pcmcia_bus_type);
+	ret = bus_rescan_devices(&pcmcia_bus_type);
+	if (ret)
+		printk(KERN_INFO "pcmcia: bus_rescan_devices failed after "
+		       "allowing func_id matches\n");
 
 	return count;
 }
Signature · 1 line
1.4.3