Skip to content

Commit

Permalink
pcmcia: convert pcmcia_request_configuration to pcmcia_enable_device
Browse files Browse the repository at this point in the history
pcmcia_enable_device() now replaces pcmcia_request_configuration().
Instead of config_req_t, all necessary flags are either passed as
a parameter to pcmcia_enable_device(), or (in rare circumstances)
set in struct pcmcia_device -> flags.

With the last remaining user of include/pcmcia/cs.h gone, remove
all references.

CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: Jiri Kosina <[email protected]>
CC: [email protected]
Acked-by: Gustavo F. Padovan <[email protected]> (for drivers/bluetooth)
Tested-by: Wolfram Sang <[email protected]>
Signed-off-by: Dominik Brodowski <[email protected]>
  • Loading branch information
Dominik Brodowski committed Sep 29, 2010
1 parent 7feabb6 commit 1ac71e5
Show file tree
Hide file tree
Showing 90 changed files with 179 additions and 395 deletions.
6 changes: 6 additions & 0 deletions Documentation/pcmcia/driver-changes.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
This file details changes in 2.6 which affect PCMCIA card driver authors:
* pcmcia_request_configuration -> pcmcia_enable_device (as of 2.6.36)
pcmcia_request_configuration() got renamed to pcmcia_enable_device(),
as it mirrors pcmcia_disable_device(). Configuration settings are now
stored in struct pcmcia_device, e.g. in the fields config_flags,
config_index, config_base, vpp.

* pcmcia_request_window changes (as of 2.6.36)
Instead of win_req_t, drivers are now requested to fill out
struct pcmcia_device *p_dev->resource[2,3,4,5] for up to four ioport
Expand Down
5 changes: 2 additions & 3 deletions drivers/ata/pata_pcmcia.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
#include <linux/ata.h>
#include <linux/libata.h>

#include <pcmcia/cs.h>
#include <pcmcia/cistpl.h>
#include <pcmcia/ds.h>
#include <pcmcia/cisreg.h>
Expand Down Expand Up @@ -249,7 +248,7 @@ static int pcmcia_init_one(struct pcmcia_device *pdev)
/* Set up attributes in order to probe card and get resources */
pdev->resource[0]->flags |= IO_DATA_PATH_WIDTH_AUTO;
pdev->resource[1]->flags |= IO_DATA_PATH_WIDTH_8;
pdev->conf.Attributes = CONF_ENABLE_IRQ;
pdev->config_flags |= CONF_ENABLE_IRQ;

/* See if we have a manufacturer identifier. Use it to set is_kme for
vendor quirks */
Expand All @@ -275,7 +274,7 @@ static int pcmcia_init_one(struct pcmcia_device *pdev)
if (!pdev->irq)
goto failed;

ret = pcmcia_request_configuration(pdev, &pdev->conf);
ret = pcmcia_enable_device(pdev);
if (ret)
goto failed;

Expand Down
5 changes: 2 additions & 3 deletions drivers/bluetooth/bluecard_cs.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
#include <linux/skbuff.h>
#include <linux/io.h>

#include <pcmcia/cs.h>
#include <pcmcia/cistpl.h>
#include <pcmcia/ciscode.h>
#include <pcmcia/ds.h>
Expand Down Expand Up @@ -865,7 +864,7 @@ static int bluecard_probe(struct pcmcia_device *link)
info->p_dev = link;
link->priv = info;

link->conf.Attributes = CONF_ENABLE_IRQ;
link->config_flags |= CONF_ENABLE_IRQ;

return bluecard_config(link);
}
Expand Down Expand Up @@ -905,7 +904,7 @@ static int bluecard_config(struct pcmcia_device *link)
if (i != 0)
goto failed;

i = pcmcia_request_configuration(link, &link->conf);
i = pcmcia_enable_device(link);
if (i != 0)
goto failed;

Expand Down
5 changes: 2 additions & 3 deletions drivers/bluetooth/bt3c_cs.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
#include <linux/device.h>
#include <linux/firmware.h>

#include <pcmcia/cs.h>
#include <pcmcia/cistpl.h>
#include <pcmcia/ciscode.h>
#include <pcmcia/ds.h>
Expand Down Expand Up @@ -660,7 +659,7 @@ static int bt3c_probe(struct pcmcia_device *link)
link->resource[0]->flags |= IO_DATA_PATH_WIDTH_8;
link->resource[0]->end = 8;

link->conf.Attributes = CONF_ENABLE_IRQ;
link->config_flags |= CONF_ENABLE_IRQ;

return bt3c_config(link);
}
Expand Down Expand Up @@ -741,7 +740,7 @@ static int bt3c_config(struct pcmcia_device *link)
if (i != 0)
goto failed;

i = pcmcia_request_configuration(link, &link->conf);
i = pcmcia_enable_device(link);
if (i != 0)
goto failed;

Expand Down
5 changes: 2 additions & 3 deletions drivers/bluetooth/btuart_cs.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
#include <asm/system.h>
#include <asm/io.h>

#include <pcmcia/cs.h>
#include <pcmcia/cistpl.h>
#include <pcmcia/ciscode.h>
#include <pcmcia/ds.h>
Expand Down Expand Up @@ -589,7 +588,7 @@ static int btuart_probe(struct pcmcia_device *link)
link->resource[0]->flags |= IO_DATA_PATH_WIDTH_8;
link->resource[0]->end = 8;

link->conf.Attributes = CONF_ENABLE_IRQ;
link->config_flags |= CONF_ENABLE_IRQ;

return btuart_config(link);
}
Expand Down Expand Up @@ -670,7 +669,7 @@ static int btuart_config(struct pcmcia_device *link)
if (i != 0)
goto failed;

i = pcmcia_request_configuration(link, &link->conf);
i = pcmcia_enable_device(link);
if (i != 0)
goto failed;

Expand Down
5 changes: 2 additions & 3 deletions drivers/bluetooth/dtl1_cs.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
#include <asm/system.h>
#include <asm/io.h>

#include <pcmcia/cs.h>
#include <pcmcia/cistpl.h>
#include <pcmcia/ciscode.h>
#include <pcmcia/ds.h>
Expand Down Expand Up @@ -575,7 +574,7 @@ static int dtl1_probe(struct pcmcia_device *link)
link->resource[0]->flags |= IO_DATA_PATH_WIDTH_8;
link->resource[0]->end = 8;

link->conf.Attributes = CONF_ENABLE_IRQ;
link->config_flags |= CONF_ENABLE_IRQ;

return dtl1_config(link);
}
Expand Down Expand Up @@ -619,7 +618,7 @@ static int dtl1_config(struct pcmcia_device *link)
if (i != 0)
goto failed;

i = pcmcia_request_configuration(link, &link->conf);
i = pcmcia_enable_device(link);
if (i != 0)
goto failed;

Expand Down
3 changes: 1 addition & 2 deletions drivers/char/pcmcia/cm4000_cs.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
#include <linux/uaccess.h>
#include <linux/io.h>

#include <pcmcia/cs.h>
#include <pcmcia/cistpl.h>
#include <pcmcia/cisreg.h>
#include <pcmcia/ciscode.h>
Expand Down Expand Up @@ -1767,7 +1766,7 @@ static int cm4000_config(struct pcmcia_device * link, int devno)
if (pcmcia_loop_config(link, cm4000_config_check, NULL))
goto cs_release;

if (pcmcia_request_configuration(link, &link->conf))
if (pcmcia_enable_device(link))
goto cs_release;

dev = link->priv;
Expand Down
5 changes: 2 additions & 3 deletions drivers/char/pcmcia/cm4040_cs.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
#include <asm/uaccess.h>
#include <asm/io.h>

#include <pcmcia/cs.h>
#include <pcmcia/cistpl.h>
#include <pcmcia/cisreg.h>
#include <pcmcia/ciscode.h>
Expand Down Expand Up @@ -547,10 +546,10 @@ static int reader_config(struct pcmcia_device *link, int devno)
if (pcmcia_loop_config(link, cm4040_config_check, NULL))
goto cs_release;

fail_rc = pcmcia_request_configuration(link, &link->conf);
fail_rc = pcmcia_enable_device(link);
if (fail_rc != 0) {
dev_printk(KERN_INFO, &link->dev,
"pcmcia_request_configuration failed 0x%x\n",
"pcmcia_enable_device failed 0x%x\n",
fail_rc);
goto cs_release;
}
Expand Down
6 changes: 2 additions & 4 deletions drivers/char/pcmcia/ipwireless/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
#include <pcmcia/device_id.h>
#include <pcmcia/ss.h>
#include <pcmcia/ds.h>
#include <pcmcia/cs.h>

static struct pcmcia_device_id ipw_ids[] = {
PCMCIA_DEVICE_MANF_CARD(0x02f2, 0x0100),
Expand Down Expand Up @@ -172,7 +171,7 @@ static int config_ipwireless(struct ipw_dev *ipw)
if (ret != 0)
return ret;

link->conf.Attributes = CONF_ENABLE_IRQ;
link->config_flags |= CONF_ENABLE_IRQ;

INIT_WORK(&ipw->work_reboot, signalled_reboot_work);

Expand Down Expand Up @@ -210,8 +209,7 @@ static int config_ipwireless(struct ipw_dev *ipw)
* Do the RequestConfiguration last, because it enables interrupts.
* Then we don't get any interrupts before we're ready for them.
*/
ret = pcmcia_request_configuration(link, &link->conf);

ret = pcmcia_enable_device(link);
if (ret != 0)
goto exit;

Expand Down
1 change: 0 additions & 1 deletion drivers/char/pcmcia/ipwireless/main.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
#include <linux/sched.h>
#include <linux/types.h>

#include <pcmcia/cs.h>
#include <pcmcia/cistpl.h>
#include <pcmcia/ds.h>

Expand Down
1 change: 0 additions & 1 deletion drivers/char/pcmcia/ipwireless/tty.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
#include <linux/types.h>
#include <linux/sched.h>

#include <pcmcia/cs.h>
#include <pcmcia/cistpl.h>
#include <pcmcia/ds.h>

Expand Down
10 changes: 3 additions & 7 deletions drivers/char/pcmcia/synclink_cs.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@
#include <linux/workqueue.h>
#include <linux/hdlc.h>

#include <pcmcia/cs.h>
#include <pcmcia/cistpl.h>
#include <pcmcia/cisreg.h>
#include <pcmcia/ds.h>
Expand Down Expand Up @@ -550,8 +549,6 @@ static int mgslpc_probe(struct pcmcia_device *link)

/* Initialize the struct pcmcia_device structure */

link->conf.Attributes = 0;

ret = mgslpc_config(link);
if (ret)
return ret;
Expand Down Expand Up @@ -593,14 +590,14 @@ static int mgslpc_config(struct pcmcia_device *link)
if (ret != 0)
goto failed;

link->conf.Attributes = CONF_ENABLE_IRQ;
link->config_flags |= CONF_ENABLE_IRQ;
link->config_index = 8;
link->config_regs = PRESENT_OPTION;

ret = pcmcia_request_irq(link, mgslpc_isr);
if (ret)
goto failed;
ret = pcmcia_request_configuration(link, &link->conf);
ret = pcmcia_enable_device(link);
if (ret)
goto failed;

Expand All @@ -609,8 +606,7 @@ static int mgslpc_config(struct pcmcia_device *link)

dev_info(&link->dev, "index 0x%02x:",
link->config_index);
if (link->conf.Attributes & CONF_ENABLE_IRQ)
printk(", irq %d", link->irq);
printk(", irq %d", link->irq);
if (link->resource[0])
printk(", io %pR", link->resource[0]);
printk("\n");
Expand Down
6 changes: 3 additions & 3 deletions drivers/ide/ide-cs.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
#include <asm/io.h>
#include <asm/system.h>

#include <pcmcia/cs.h>
#include <pcmcia/cistpl.h>
#include <pcmcia/ds.h>
#include <pcmcia/cisreg.h>
Expand Down Expand Up @@ -99,7 +98,7 @@ static int ide_probe(struct pcmcia_device *link)

link->resource[0]->flags |= IO_DATA_PATH_WIDTH_AUTO;
link->resource[1]->flags |= IO_DATA_PATH_WIDTH_8;
link->conf.Attributes = CONF_ENABLE_IRQ;
link->config_flags |= CONF_ENABLE_IRQ;

return ide_config(link);
} /* ide_attach */
Expand Down Expand Up @@ -284,7 +283,8 @@ static int ide_config(struct pcmcia_device *link)

if (!link->irq)
goto failed;
ret = pcmcia_request_configuration(link, &link->conf);

ret = pcmcia_enable_device(link);
if (ret)
goto failed;

Expand Down
5 changes: 2 additions & 3 deletions drivers/isdn/hardware/avm/avm_cs.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
#include <asm/io.h>
#include <asm/system.h>

#include <pcmcia/cs.h>
#include <pcmcia/cistpl.h>
#include <pcmcia/ciscode.h>
#include <pcmcia/ds.h>
Expand Down Expand Up @@ -79,7 +78,7 @@ static int avmcs_probe(struct pcmcia_device *p_dev)
p_dev->resource[0]->flags |= IO_DATA_PATH_WIDTH_8;

/* General socket configuration */
p_dev->conf.Attributes = CONF_ENABLE_IRQ;
p_dev->config_flags |= CONF_ENABLE_IRQ;
p_dev->config_index = 1;
p_dev->config_regs = PRESENT_OPTION;

Expand Down Expand Up @@ -149,7 +148,7 @@ static int avmcs_config(struct pcmcia_device *link)
/*
* configure the PCMCIA socket
*/
i = pcmcia_request_configuration(link, &link->conf);
i = pcmcia_enable_device(link);
if (i != 0) {
pcmcia_disable_device(link);
break;
Expand Down
5 changes: 2 additions & 3 deletions drivers/isdn/hisax/avma1_cs.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
#include <asm/io.h>
#include <asm/system.h>

#include <pcmcia/cs.h>
#include <pcmcia/cistpl.h>
#include <pcmcia/ds.h>
#include "hisax_cfg.h"
Expand Down Expand Up @@ -84,7 +83,7 @@ static int __devinit avma1cs_probe(struct pcmcia_device *p_dev)
p_dev->resource[1]->flags |= IO_DATA_PATH_WIDTH_16;

/* General socket configuration */
p_dev->conf.Attributes = CONF_ENABLE_IRQ;
p_dev->config_flags |= CONF_ENABLE_IRQ;
p_dev->config_index = 1;
p_dev->config_regs = PRESENT_OPTION;

Expand Down Expand Up @@ -160,7 +159,7 @@ static int __devinit avma1cs_config(struct pcmcia_device *link)
/*
* configure the PCMCIA socket
*/
i = pcmcia_request_configuration(link, &link->conf);
i = pcmcia_enable_device(link);
if (i != 0) {
pcmcia_disable_device(link);
break;
Expand Down
8 changes: 2 additions & 6 deletions drivers/isdn/hisax/elsa_cs.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
#include <asm/io.h>
#include <asm/system.h>

#include <pcmcia/cs.h>
#include <pcmcia/cistpl.h>
#include <pcmcia/cisreg.h>
#include <pcmcia/ds.h>
Expand Down Expand Up @@ -129,8 +128,6 @@ static int __devinit elsa_cs_probe(struct pcmcia_device *link)
link->resource[0]->end = 8;
link->resource[0]->flags |= IO_DATA_PATH_WIDTH_AUTO;

link->conf.Attributes = CONF_ENABLE_IRQ;

return elsa_cs_config(link);
} /* elsa_cs_attach */

Expand Down Expand Up @@ -205,15 +202,14 @@ static int __devinit elsa_cs_config(struct pcmcia_device *link)
if (!link->irq)
goto failed;

i = pcmcia_request_configuration(link, &link->conf);
i = pcmcia_enable_device(link);
if (i != 0)
goto failed;

/* Finally, report what we've done */
dev_info(&link->dev, "index 0x%02x: ",
link->config_index);
if (link->conf.Attributes & CONF_ENABLE_IRQ)
printk(", irq %d", link->irq);
printk(", irq %d", link->irq);
if (link->resource[0])
printk(" & %pR", link->resource[0]);
if (link->resource[1])
Expand Down
Loading

0 comments on commit 1ac71e5

Please sign in to comment.