Skip to content

Commit

Permalink
Merge git://git.kernel.org/pub/scm/linux/kernel/git/brodo/pcmcia-2.6
Browse files Browse the repository at this point in the history
* git://git.kernel.org/pub/scm/linux/kernel/git/brodo/pcmcia-2.6: (29 commits)
  pcmcia: disable PCMCIA ioctl also for ARM
  drivers/staging/comedi: dev_node removal (quatech_daqp_cs)
  drivers/staging/comedi: dev_node removal (ni_mio_cs)
  drivers/staging/comedi: dev_node removal (ni_labpc_cs)
  drivers/staging/comedi: dev_node removal (ni_daq_dio24)
  drivers/staging/comedi: dev_node removal (ni_daq_700)
  drivers/staging/comedi: dev_node removal (das08_cs)
  drivers/staging/comedi: dev_node removal (cb_das16_cs)
  pata_pcmcia: get rid of extra indirection
  pcmcia: remove suspend-related comment from yenta_socket.c
  pcmcia: call pcmcia_{read,write}_cis_mem with ops_mutex held
  pcmcia: remove pcmcia_add_device_lock
  pcmcia: update gfp/slab.h includes
  pcmcia: remove unused mem_op.h
  pcmcia: do not autoadd root PCI bus resources
  pcmcia: clarify alloc_io_space, move it to resource handlers
  pcmcia: move all pcmcia_resource_ops providers into one module
  pcmcia: move high level CIS access code to separate file
  pcmcia: dev_node removal (core)
  pcmcia: dev_node removal (remaining drivers)
  ...
  • Loading branch information
Linus Torvalds committed May 20, 2010
2 parents 46ee964 + acd200b commit 5429126
Show file tree
Hide file tree
Showing 86 changed files with 1,179 additions and 2,139 deletions.
13 changes: 13 additions & 0 deletions Documentation/pcmcia/driver-changes.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,17 @@
This file details changes in 2.6 which affect PCMCIA card driver authors:
* No dev_node_t (as of 2.6.35)
There is no more need to fill out a "dev_node_t" structure.

* New IRQ request rules (as of 2.6.35)
Instead of the old pcmcia_request_irq() interface, drivers may now
choose between:
- calling request_irq/free_irq directly. Use the IRQ from *p_dev->irq.
- use pcmcia_request_irq(p_dev, handler_t); the PCMCIA core will
clean up automatically on calls to pcmcia_disable_device() or
device ejection.
- drivers still not capable of IRQF_SHARED (or not telling us so) may
use the deprecated pcmcia_request_exclusive_irq() for the time
being; they might receive a shared IRQ nonetheless.

* no cs_error / CS_CHECK / CONFIG_PCMCIA_DEBUG (as of 2.6.33)
Instead of the cs_error() callback or the CS_CHECK() macro, please use
Expand Down
47 changes: 8 additions & 39 deletions drivers/ata/pata_pcmcia.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,6 @@
#define DRV_NAME "pata_pcmcia"
#define DRV_VERSION "0.3.5"

/*
* Private data structure to glue stuff together
*/

struct ata_pcmcia_info {
struct pcmcia_device *pdev;
int ndev;
dev_node_t node;
};

/**
* pcmcia_set_mode - PCMCIA specific mode setup
* @link: link
Expand Down Expand Up @@ -248,27 +238,17 @@ static int pcmcia_init_one(struct pcmcia_device *pdev)
{
struct ata_host *host;
struct ata_port *ap;
struct ata_pcmcia_info *info;
struct pcmcia_config_check *stk = NULL;
int is_kme = 0, ret = -ENOMEM, p;
unsigned long io_base, ctl_base;
void __iomem *io_addr, *ctl_addr;
int n_ports = 1;
struct ata_port_operations *ops = &pcmcia_port_ops;

info = kzalloc(sizeof(*info), GFP_KERNEL);
if (info == NULL)
return -ENOMEM;

/* Glue stuff together. FIXME: We may be able to get rid of info with care */
info->pdev = pdev;
pdev->priv = info;

/* Set up attributes in order to probe card and get resources */
pdev->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO;
pdev->io.Attributes2 = IO_DATA_PATH_WIDTH_8;
pdev->io.IOAddrLines = 3;
pdev->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
pdev->conf.Attributes = CONF_ENABLE_IRQ;
pdev->conf.IntType = INT_MEMORY_AND_IO;

Expand All @@ -293,8 +273,7 @@ static int pcmcia_init_one(struct pcmcia_device *pdev)
}
io_base = pdev->io.BasePort1;
ctl_base = stk->ctl_base;
ret = pcmcia_request_irq(pdev, &pdev->irq);
if (ret)
if (!pdev->irq)
goto failed;

ret = pcmcia_request_configuration(pdev, &pdev->conf);
Expand Down Expand Up @@ -344,21 +323,19 @@ static int pcmcia_init_one(struct pcmcia_device *pdev)
}

/* activate */
ret = ata_host_activate(host, pdev->irq.AssignedIRQ, ata_sff_interrupt,
ret = ata_host_activate(host, pdev->irq, ata_sff_interrupt,
IRQF_SHARED, &pcmcia_sht);
if (ret)
goto failed;

info->ndev = 1;
pdev->priv = host;
kfree(stk);
return 0;

failed:
kfree(stk);
info->ndev = 0;
pcmcia_disable_device(pdev);
out1:
kfree(info);
return ret;
}

Expand All @@ -372,20 +349,12 @@ static int pcmcia_init_one(struct pcmcia_device *pdev)

static void pcmcia_remove_one(struct pcmcia_device *pdev)
{
struct ata_pcmcia_info *info = pdev->priv;
struct device *dev = &pdev->dev;

if (info != NULL) {
/* If we have attached the device to the ATA layer, detach it */
if (info->ndev) {
struct ata_host *host = dev_get_drvdata(dev);
ata_host_detach(host);
}
info->ndev = 0;
pdev->priv = NULL;
}
struct ata_host *host = pdev->priv;

if (host)
ata_host_detach(host);

pcmcia_disable_device(pdev);
kfree(info);
}

static struct pcmcia_device_id pcmcia_devices[] = {
Expand Down
11 changes: 2 additions & 9 deletions drivers/bluetooth/bluecard_cs.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ MODULE_LICENSE("GPL");

typedef struct bluecard_info_t {
struct pcmcia_device *p_dev;
dev_node_t node;

struct hci_dev *hdev;

Expand Down Expand Up @@ -869,9 +868,6 @@ static int bluecard_probe(struct pcmcia_device *link)

link->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
link->io.NumPorts1 = 8;
link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;

link->irq.Handler = bluecard_interrupt;

link->conf.Attributes = CONF_ENABLE_IRQ;
link->conf.IntType = INT_MEMORY_AND_IO;
Expand Down Expand Up @@ -908,9 +904,9 @@ static int bluecard_config(struct pcmcia_device *link)
if (i != 0)
goto failed;

i = pcmcia_request_irq(link, &link->irq);
i = pcmcia_request_irq(link, bluecard_interrupt);
if (i != 0)
link->irq.AssignedIRQ = 0;
goto failed;

i = pcmcia_request_configuration(link, &link->conf);
if (i != 0)
Expand All @@ -919,9 +915,6 @@ static int bluecard_config(struct pcmcia_device *link)
if (bluecard_open(info) != 0)
goto failed;

strcpy(info->node.dev_name, info->hdev->name);
link->dev_node = &info->node;

return 0;

failed:
Expand Down
11 changes: 2 additions & 9 deletions drivers/bluetooth/bt3c_cs.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ MODULE_FIRMWARE("BT3CPCC.bin");

typedef struct bt3c_info_t {
struct pcmcia_device *p_dev;
dev_node_t node;

struct hci_dev *hdev;

Expand Down Expand Up @@ -661,9 +660,6 @@ static int bt3c_probe(struct pcmcia_device *link)

link->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
link->io.NumPorts1 = 8;
link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;

link->irq.Handler = bt3c_interrupt;

link->conf.Attributes = CONF_ENABLE_IRQ;
link->conf.IntType = INT_MEMORY_AND_IO;
Expand Down Expand Up @@ -743,9 +739,9 @@ static int bt3c_config(struct pcmcia_device *link)
goto failed;

found_port:
i = pcmcia_request_irq(link, &link->irq);
i = pcmcia_request_irq(link, &bt3c_interrupt);
if (i != 0)
link->irq.AssignedIRQ = 0;
goto failed;

i = pcmcia_request_configuration(link, &link->conf);
if (i != 0)
Expand All @@ -754,9 +750,6 @@ static int bt3c_config(struct pcmcia_device *link)
if (bt3c_open(info) != 0)
goto failed;

strcpy(info->node.dev_name, info->hdev->name);
link->dev_node = &info->node;

return 0;

failed:
Expand Down
11 changes: 2 additions & 9 deletions drivers/bluetooth/btuart_cs.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ MODULE_LICENSE("GPL");

typedef struct btuart_info_t {
struct pcmcia_device *p_dev;
dev_node_t node;

struct hci_dev *hdev;

Expand Down Expand Up @@ -590,9 +589,6 @@ static int btuart_probe(struct pcmcia_device *link)

link->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
link->io.NumPorts1 = 8;
link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;

link->irq.Handler = btuart_interrupt;

link->conf.Attributes = CONF_ENABLE_IRQ;
link->conf.IntType = INT_MEMORY_AND_IO;
Expand Down Expand Up @@ -672,9 +668,9 @@ static int btuart_config(struct pcmcia_device *link)
goto failed;

found_port:
i = pcmcia_request_irq(link, &link->irq);
i = pcmcia_request_irq(link, btuart_interrupt);
if (i != 0)
link->irq.AssignedIRQ = 0;
goto failed;

i = pcmcia_request_configuration(link, &link->conf);
if (i != 0)
Expand All @@ -683,9 +679,6 @@ static int btuart_config(struct pcmcia_device *link)
if (btuart_open(info) != 0)
goto failed;

strcpy(info->node.dev_name, info->hdev->name);
link->dev_node = &info->node;

return 0;

failed:
Expand Down
11 changes: 2 additions & 9 deletions drivers/bluetooth/dtl1_cs.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ MODULE_LICENSE("GPL");

typedef struct dtl1_info_t {
struct pcmcia_device *p_dev;
dev_node_t node;

struct hci_dev *hdev;

Expand Down Expand Up @@ -575,9 +574,6 @@ static int dtl1_probe(struct pcmcia_device *link)

link->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
link->io.NumPorts1 = 8;
link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;

link->irq.Handler = dtl1_interrupt;

link->conf.Attributes = CONF_ENABLE_IRQ;
link->conf.IntType = INT_MEMORY_AND_IO;
Expand Down Expand Up @@ -621,9 +617,9 @@ static int dtl1_config(struct pcmcia_device *link)
if (pcmcia_loop_config(link, dtl1_confcheck, NULL) < 0)
goto failed;

i = pcmcia_request_irq(link, &link->irq);
i = pcmcia_request_irq(link, dtl1_interrupt);
if (i != 0)
link->irq.AssignedIRQ = 0;
goto failed;

i = pcmcia_request_configuration(link, &link->conf);
if (i != 0)
Expand All @@ -632,9 +628,6 @@ static int dtl1_config(struct pcmcia_device *link)
if (dtl1_open(info) != 0)
goto failed;

strcpy(info->node.dev_name, info->hdev->name);
link->dev_node = &info->node;

return 0;

failed:
Expand Down
9 changes: 1 addition & 8 deletions drivers/char/pcmcia/cm4000_cs.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ static int major; /* major number we get from the kernel */

struct cm4000_dev {
struct pcmcia_device *p_dev;
dev_node_t node; /* OS node (major,minor) */

unsigned char atr[MAX_ATR];
unsigned char rbuf[512];
Expand Down Expand Up @@ -884,8 +883,7 @@ static void monitor_card(unsigned long p)
/* slow down warning, but prompt immediately after insertion */
if (dev->cwarn == 0 || dev->cwarn == 10) {
set_bit(IS_BAD_CARD, &dev->flags);
printk(KERN_WARNING MODULE_NAME ": device %s: ",
dev->node.dev_name);
dev_warn(&dev->p_dev->dev, MODULE_NAME ": ");
if (test_bit(IS_BAD_CSUM, &dev->flags)) {
DEBUGP(4, dev, "ATR checksum (0x%.2x, should "
"be zero) failed\n", dev->atr_csum);
Expand Down Expand Up @@ -1781,11 +1779,6 @@ static int cm4000_config(struct pcmcia_device * link, int devno)
goto cs_release;

dev = link->priv;
sprintf(dev->node.dev_name, DEVICE_NAME "%d", devno);
dev->node.major = major;
dev->node.minor = devno;
dev->node.next = NULL;
link->dev_node = &dev->node;

return 0;

Expand Down
5 changes: 0 additions & 5 deletions drivers/char/pcmcia/cm4040_cs.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ static struct class *cmx_class;

struct reader_dev {
struct pcmcia_device *p_dev;
dev_node_t node;
wait_queue_head_t devq;
wait_queue_head_t poll_wait;
wait_queue_head_t read_wait;
Expand Down Expand Up @@ -568,10 +567,6 @@ static int reader_config(struct pcmcia_device *link, int devno)
}

dev = link->priv;
sprintf(dev->node.dev_name, DEVICE_NAME "%d", devno);
dev->node.major = major;
dev->node.minor = devno;
dev->node.next = &dev->node;

DEBUGP(2, dev, "device " DEVICE_NAME "%d at 0x%.4x-0x%.4x\n", devno,
link->io.BasePort1, link->io.BasePort1+link->io.NumPorts1);
Expand Down
Loading

0 comments on commit 5429126

Please sign in to comment.