Commit a6f707b6 authored by Linus Torvalds's avatar Linus Torvalds

Merge git://git.kernel.org/pub/scm/linux/kernel/git/brodo/pcmcia

Pull a few PCMCIA updates from Dominik Brodowski.

Fix up trivial conflict (modified code in question had been removed) in
drivers/pcmcia/soc_common.c.

* git://git.kernel.org/pub/scm/linux/kernel/git/brodo/pcmcia:
  pcmcia at91_cf: fix raw gpio number usage
  ARM: pxa: fix error handling in pxa2xx_drv_pcmcia_probe
  pcmcia: Convert to DEFINE_PCI_DEVICE_TABLE
  pcmcia: convert drivers/pcmcia/* to use module_platform_driver()
  pcmcia: irq: Remove IRQF_DISABLED
parents ef08e782 80af9e6d
...@@ -16,13 +16,13 @@ ...@@ -16,13 +16,13 @@
#include <linux/init.h> #include <linux/init.h>
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/gpio.h>
#include <pcmcia/ss.h> #include <pcmcia/ss.h>
#include <mach/hardware.h> #include <mach/hardware.h>
#include <asm/io.h> #include <asm/io.h>
#include <asm/sizes.h> #include <asm/sizes.h>
#include <asm/gpio.h>
#include <mach/board.h> #include <mach/board.h>
#include <mach/at91rm9200_mc.h> #include <mach/at91rm9200_mc.h>
...@@ -70,7 +70,7 @@ static irqreturn_t at91_cf_irq(int irq, void *_cf) ...@@ -70,7 +70,7 @@ static irqreturn_t at91_cf_irq(int irq, void *_cf)
{ {
struct at91_cf_socket *cf = _cf; struct at91_cf_socket *cf = _cf;
if (irq == cf->board->det_pin) { if (irq == gpio_to_irq(cf->board->det_pin)) {
unsigned present = at91_cf_present(cf); unsigned present = at91_cf_present(cf);
/* kick pccard as needed */ /* kick pccard as needed */
...@@ -96,8 +96,8 @@ static int at91_cf_get_status(struct pcmcia_socket *s, u_int *sp) ...@@ -96,8 +96,8 @@ static int at91_cf_get_status(struct pcmcia_socket *s, u_int *sp)
/* NOTE: CF is always 3VCARD */ /* NOTE: CF is always 3VCARD */
if (at91_cf_present(cf)) { if (at91_cf_present(cf)) {
int rdy = cf->board->irq_pin; /* RDY/nIRQ */ int rdy = gpio_is_valid(cf->board->irq_pin); /* RDY/nIRQ */
int vcc = cf->board->vcc_pin; int vcc = gpio_is_valid(cf->board->vcc_pin);
*sp = SS_DETECT | SS_3VCARD; *sp = SS_DETECT | SS_3VCARD;
if (!rdy || gpio_get_value(rdy)) if (!rdy || gpio_get_value(rdy))
...@@ -118,7 +118,7 @@ at91_cf_set_socket(struct pcmcia_socket *sock, struct socket_state_t *s) ...@@ -118,7 +118,7 @@ at91_cf_set_socket(struct pcmcia_socket *sock, struct socket_state_t *s)
cf = container_of(sock, struct at91_cf_socket, socket); cf = container_of(sock, struct at91_cf_socket, socket);
/* switch Vcc if needed and possible */ /* switch Vcc if needed and possible */
if (cf->board->vcc_pin) { if (gpio_is_valid(cf->board->vcc_pin)) {
switch (s->Vcc) { switch (s->Vcc) {
case 0: case 0:
gpio_set_value(cf->board->vcc_pin, 0); gpio_set_value(cf->board->vcc_pin, 0);
...@@ -222,7 +222,7 @@ static int __init at91_cf_probe(struct platform_device *pdev) ...@@ -222,7 +222,7 @@ static int __init at91_cf_probe(struct platform_device *pdev)
struct resource *io; struct resource *io;
int status; int status;
if (!board || !board->det_pin || !board->rst_pin) if (!board || !gpio_is_valid(board->det_pin) || !gpio_is_valid(board->rst_pin))
return -ENODEV; return -ENODEV;
io = platform_get_resource(pdev, IORESOURCE_MEM, 0); io = platform_get_resource(pdev, IORESOURCE_MEM, 0);
...@@ -242,7 +242,7 @@ static int __init at91_cf_probe(struct platform_device *pdev) ...@@ -242,7 +242,7 @@ static int __init at91_cf_probe(struct platform_device *pdev)
status = gpio_request(board->det_pin, "cf_det"); status = gpio_request(board->det_pin, "cf_det");
if (status < 0) if (status < 0)
goto fail0; goto fail0;
status = request_irq(board->det_pin, at91_cf_irq, 0, driver_name, cf); status = request_irq(gpio_to_irq(board->det_pin), at91_cf_irq, 0, driver_name, cf);
if (status < 0) if (status < 0)
goto fail00; goto fail00;
device_init_wakeup(&pdev->dev, 1); device_init_wakeup(&pdev->dev, 1);
...@@ -251,7 +251,7 @@ static int __init at91_cf_probe(struct platform_device *pdev) ...@@ -251,7 +251,7 @@ static int __init at91_cf_probe(struct platform_device *pdev)
if (status < 0) if (status < 0)
goto fail0a; goto fail0a;
if (board->vcc_pin) { if (gpio_is_valid(board->vcc_pin)) {
status = gpio_request(board->vcc_pin, "cf_vcc"); status = gpio_request(board->vcc_pin, "cf_vcc");
if (status < 0) if (status < 0)
goto fail0b; goto fail0b;
...@@ -263,15 +263,15 @@ static int __init at91_cf_probe(struct platform_device *pdev) ...@@ -263,15 +263,15 @@ static int __init at91_cf_probe(struct platform_device *pdev)
* unless we report that we handle everything (sigh). * unless we report that we handle everything (sigh).
* (Note: DK board doesn't wire the IRQ pin...) * (Note: DK board doesn't wire the IRQ pin...)
*/ */
if (board->irq_pin) { if (gpio_is_valid(board->irq_pin)) {
status = gpio_request(board->irq_pin, "cf_irq"); status = gpio_request(board->irq_pin, "cf_irq");
if (status < 0) if (status < 0)
goto fail0c; goto fail0c;
status = request_irq(board->irq_pin, at91_cf_irq, status = request_irq(gpio_to_irq(board->irq_pin), at91_cf_irq,
IRQF_SHARED, driver_name, cf); IRQF_SHARED, driver_name, cf);
if (status < 0) if (status < 0)
goto fail0d; goto fail0d;
cf->socket.pci_irq = board->irq_pin; cf->socket.pci_irq = gpio_to_irq(board->irq_pin);
} else } else
cf->socket.pci_irq = nr_irqs + 1; cf->socket.pci_irq = nr_irqs + 1;
...@@ -290,7 +290,7 @@ static int __init at91_cf_probe(struct platform_device *pdev) ...@@ -290,7 +290,7 @@ static int __init at91_cf_probe(struct platform_device *pdev)
} }
pr_info("%s: irqs det #%d, io #%d\n", driver_name, pr_info("%s: irqs det #%d, io #%d\n", driver_name,
board->det_pin, board->irq_pin); gpio_to_irq(board->det_pin), gpio_to_irq(board->irq_pin));
cf->socket.owner = THIS_MODULE; cf->socket.owner = THIS_MODULE;
cf->socket.dev.parent = &pdev->dev; cf->socket.dev.parent = &pdev->dev;
...@@ -312,19 +312,19 @@ static int __init at91_cf_probe(struct platform_device *pdev) ...@@ -312,19 +312,19 @@ static int __init at91_cf_probe(struct platform_device *pdev)
fail1: fail1:
if (cf->socket.io_offset) if (cf->socket.io_offset)
iounmap((void __iomem *) cf->socket.io_offset); iounmap((void __iomem *) cf->socket.io_offset);
if (board->irq_pin) { if (gpio_is_valid(board->irq_pin)) {
free_irq(board->irq_pin, cf); free_irq(gpio_to_irq(board->irq_pin), cf);
fail0d: fail0d:
gpio_free(board->irq_pin); gpio_free(board->irq_pin);
} }
fail0c: fail0c:
if (board->vcc_pin) if (gpio_is_valid(board->vcc_pin))
gpio_free(board->vcc_pin); gpio_free(board->vcc_pin);
fail0b: fail0b:
gpio_free(board->rst_pin); gpio_free(board->rst_pin);
fail0a: fail0a:
device_init_wakeup(&pdev->dev, 0); device_init_wakeup(&pdev->dev, 0);
free_irq(board->det_pin, cf); free_irq(gpio_to_irq(board->det_pin), cf);
fail00: fail00:
gpio_free(board->det_pin); gpio_free(board->det_pin);
fail0: fail0:
...@@ -341,15 +341,15 @@ static int __exit at91_cf_remove(struct platform_device *pdev) ...@@ -341,15 +341,15 @@ static int __exit at91_cf_remove(struct platform_device *pdev)
pcmcia_unregister_socket(&cf->socket); pcmcia_unregister_socket(&cf->socket);
release_mem_region(io->start, resource_size(io)); release_mem_region(io->start, resource_size(io));
iounmap((void __iomem *) cf->socket.io_offset); iounmap((void __iomem *) cf->socket.io_offset);
if (board->irq_pin) { if (gpio_is_valid(board->irq_pin)) {
free_irq(board->irq_pin, cf); free_irq(gpio_to_irq(board->irq_pin), cf);
gpio_free(board->irq_pin); gpio_free(board->irq_pin);
} }
if (board->vcc_pin) if (gpio_is_valid(board->vcc_pin))
gpio_free(board->vcc_pin); gpio_free(board->vcc_pin);
gpio_free(board->rst_pin); gpio_free(board->rst_pin);
device_init_wakeup(&pdev->dev, 0); device_init_wakeup(&pdev->dev, 0);
free_irq(board->det_pin, cf); free_irq(gpio_to_irq(board->det_pin), cf);
gpio_free(board->det_pin); gpio_free(board->det_pin);
kfree(cf); kfree(cf);
return 0; return 0;
...@@ -363,9 +363,9 @@ static int at91_cf_suspend(struct platform_device *pdev, pm_message_t mesg) ...@@ -363,9 +363,9 @@ static int at91_cf_suspend(struct platform_device *pdev, pm_message_t mesg)
struct at91_cf_data *board = cf->board; struct at91_cf_data *board = cf->board;
if (device_may_wakeup(&pdev->dev)) { if (device_may_wakeup(&pdev->dev)) {
enable_irq_wake(board->det_pin); enable_irq_wake(gpio_to_irq(board->det_pin));
if (board->irq_pin) if (gpio_is_valid(board->irq_pin))
enable_irq_wake(board->irq_pin); enable_irq_wake(gpio_to_irq(board->irq_pin));
} }
return 0; return 0;
} }
...@@ -376,9 +376,9 @@ static int at91_cf_resume(struct platform_device *pdev) ...@@ -376,9 +376,9 @@ static int at91_cf_resume(struct platform_device *pdev)
struct at91_cf_data *board = cf->board; struct at91_cf_data *board = cf->board;
if (device_may_wakeup(&pdev->dev)) { if (device_may_wakeup(&pdev->dev)) {
disable_irq_wake(board->det_pin); disable_irq_wake(gpio_to_irq(board->det_pin));
if (board->irq_pin) if (gpio_is_valid(board->irq_pin))
disable_irq_wake(board->irq_pin); disable_irq_wake(gpio_to_irq(board->irq_pin));
} }
return 0; return 0;
......
...@@ -475,7 +475,7 @@ static void __devexit bcm63xx_cb_exit(struct pci_dev *dev) ...@@ -475,7 +475,7 @@ static void __devexit bcm63xx_cb_exit(struct pci_dev *dev)
bcm63xx_cb_dev = NULL; bcm63xx_cb_dev = NULL;
} }
static struct pci_device_id bcm63xx_cb_table[] = { static DEFINE_PCI_DEVICE_TABLE(bcm63xx_cb_table) = {
{ {
.vendor = PCI_VENDOR_ID_BROADCOM, .vendor = PCI_VENDOR_ID_BROADCOM,
.device = BCM6348_CPU_ID, .device = BCM6348_CPU_ID,
......
...@@ -310,18 +310,7 @@ static struct platform_driver bfin_cf_driver = { ...@@ -310,18 +310,7 @@ static struct platform_driver bfin_cf_driver = {
.remove = __devexit_p(bfin_cf_remove), .remove = __devexit_p(bfin_cf_remove),
}; };
static int __init bfin_cf_init(void) module_platform_driver(bfin_cf_driver);
{
return platform_driver_register(&bfin_cf_driver);
}
static void __exit bfin_cf_exit(void)
{
platform_driver_unregister(&bfin_cf_driver);
}
module_init(bfin_cf_init);
module_exit(bfin_cf_exit);
MODULE_AUTHOR("Michael Hennerich <hennerich@blackfin.uclinux.org>"); MODULE_AUTHOR("Michael Hennerich <hennerich@blackfin.uclinux.org>");
MODULE_DESCRIPTION("BFIN CF/PCMCIA Driver"); MODULE_DESCRIPTION("BFIN CF/PCMCIA Driver");
......
...@@ -172,12 +172,12 @@ static int db1x_pcmcia_setup_irqs(struct db1x_pcmcia_sock *sock) ...@@ -172,12 +172,12 @@ static int db1x_pcmcia_setup_irqs(struct db1x_pcmcia_sock *sock)
if ((sock->board_type == BOARD_TYPE_DB1200) || if ((sock->board_type == BOARD_TYPE_DB1200) ||
(sock->board_type == BOARD_TYPE_DB1300)) { (sock->board_type == BOARD_TYPE_DB1300)) {
ret = request_irq(sock->insert_irq, db1200_pcmcia_cdirq, ret = request_irq(sock->insert_irq, db1200_pcmcia_cdirq,
IRQF_DISABLED, "pcmcia_insert", sock); 0, "pcmcia_insert", sock);
if (ret) if (ret)
goto out1; goto out1;
ret = request_irq(sock->eject_irq, db1200_pcmcia_cdirq, ret = request_irq(sock->eject_irq, db1200_pcmcia_cdirq,
IRQF_DISABLED, "pcmcia_eject", sock); 0, "pcmcia_eject", sock);
if (ret) { if (ret) {
free_irq(sock->insert_irq, sock); free_irq(sock->insert_irq, sock);
goto out1; goto out1;
...@@ -580,18 +580,7 @@ static struct platform_driver db1x_pcmcia_socket_driver = { ...@@ -580,18 +580,7 @@ static struct platform_driver db1x_pcmcia_socket_driver = {
.remove = __devexit_p(db1x_pcmcia_socket_remove), .remove = __devexit_p(db1x_pcmcia_socket_remove),
}; };
int __init db1x_pcmcia_socket_load(void) module_platform_driver(db1x_pcmcia_socket_driver);
{
return platform_driver_register(&db1x_pcmcia_socket_driver);
}
void __exit db1x_pcmcia_socket_unload(void)
{
platform_driver_unregister(&db1x_pcmcia_socket_driver);
}
module_init(db1x_pcmcia_socket_load);
module_exit(db1x_pcmcia_socket_unload);
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("PCMCIA Socket Services for Alchemy Db/Pb1x00 boards"); MODULE_DESCRIPTION("PCMCIA Socket Services for Alchemy Db/Pb1x00 boards");
......
...@@ -365,17 +365,7 @@ static struct platform_driver electra_cf_driver = { ...@@ -365,17 +365,7 @@ static struct platform_driver electra_cf_driver = {
.remove = electra_cf_remove, .remove = electra_cf_remove,
}; };
static int __init electra_cf_init(void) module_platform_driver(electra_cf_driver);
{
return platform_driver_register(&electra_cf_driver);
}
module_init(electra_cf_init);
static void __exit electra_cf_exit(void)
{
platform_driver_unregister(&electra_cf_driver);
}
module_exit(electra_cf_exit);
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
MODULE_AUTHOR ("Olof Johansson <olof@lixom.net>"); MODULE_AUTHOR ("Olof Johansson <olof@lixom.net>");
......
...@@ -25,14 +25,9 @@ ...@@ -25,14 +25,9 @@
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
/* PCI core routines */ /* PCI core routines */
static struct pci_device_id i82092aa_pci_ids[] = { static DEFINE_PCI_DEVICE_TABLE(i82092aa_pci_ids) = {
{ { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82092AA_0) },
.vendor = PCI_VENDOR_ID_INTEL, { }
.device = PCI_DEVICE_ID_INTEL_82092AA_0,
.subvendor = PCI_ANY_ID,
.subdevice = PCI_ANY_ID,
},
{}
}; };
MODULE_DEVICE_TABLE(pci, i82092aa_pci_ids); MODULE_DEVICE_TABLE(pci, i82092aa_pci_ids);
......
...@@ -1303,15 +1303,4 @@ static struct platform_driver m8xx_pcmcia_driver = { ...@@ -1303,15 +1303,4 @@ static struct platform_driver m8xx_pcmcia_driver = {
.remove = m8xx_remove, .remove = m8xx_remove,
}; };
static int __init m8xx_init(void) module_platform_driver(m8xx_pcmcia_driver);
{
return platform_driver_register(&m8xx_pcmcia_driver);
}
static void __exit m8xx_exit(void)
{
platform_driver_unregister(&m8xx_pcmcia_driver);
}
module_init(m8xx_init);
module_exit(m8xx_exit);
...@@ -762,13 +762,8 @@ static void __devexit pd6729_pci_remove(struct pci_dev *dev) ...@@ -762,13 +762,8 @@ static void __devexit pd6729_pci_remove(struct pci_dev *dev)
kfree(socket); kfree(socket);
} }
static struct pci_device_id pd6729_pci_ids[] = { static DEFINE_PCI_DEVICE_TABLE(pd6729_pci_ids) = {
{ { PCI_DEVICE(PCI_VENDOR_ID_CIRRUS, PCI_DEVICE_ID_CIRRUS_6729) },
.vendor = PCI_VENDOR_ID_CIRRUS,
.device = PCI_DEVICE_ID_CIRRUS_6729,
.subvendor = PCI_ANY_ID,
.subdevice = PCI_ANY_ID,
},
{ } { }
}; };
MODULE_DEVICE_TABLE(pci, pd6729_pci_ids); MODULE_DEVICE_TABLE(pci, pd6729_pci_ids);
......
...@@ -177,18 +177,7 @@ static struct platform_driver viper_pcmcia_driver = { ...@@ -177,18 +177,7 @@ static struct platform_driver viper_pcmcia_driver = {
.id_table = viper_pcmcia_id_table, .id_table = viper_pcmcia_id_table,
}; };
static int __init viper_pcmcia_init(void) module_platform_driver(viper_pcmcia_driver);
{
return platform_driver_register(&viper_pcmcia_driver);
}
static void __exit viper_pcmcia_exit(void)
{
return platform_driver_unregister(&viper_pcmcia_driver);
}
module_init(viper_pcmcia_init);
module_exit(viper_pcmcia_exit);
MODULE_DEVICE_TABLE(platform, viper_pcmcia_id_table); MODULE_DEVICE_TABLE(platform, viper_pcmcia_id_table);
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
...@@ -563,11 +563,8 @@ static int __devinit vrc4173_cardu_setup(char *options) ...@@ -563,11 +563,8 @@ static int __devinit vrc4173_cardu_setup(char *options)
__setup("vrc4173_cardu=", vrc4173_cardu_setup); __setup("vrc4173_cardu=", vrc4173_cardu_setup);
static struct pci_device_id vrc4173_cardu_id_table[] __devinitdata = { static DEFINE_PCI_DEVICE_TABLE(vrc4173_cardu_id_table) = {
{ .vendor = PCI_VENDOR_ID_NEC, { PCI_DEVICE(PCI_VENDOR_ID_NEC, PCI_DEVICE_ID_NEC_NAPCCARD) },
.device = PCI_DEVICE_ID_NEC_NAPCCARD,
.subvendor = PCI_ANY_ID,
.subdevice = PCI_ANY_ID, },
{0, } {0, }
}; };
......
...@@ -320,18 +320,7 @@ static struct platform_driver xxs1500_pcmcia_socket_driver = { ...@@ -320,18 +320,7 @@ static struct platform_driver xxs1500_pcmcia_socket_driver = {
.remove = __devexit_p(xxs1500_pcmcia_remove), .remove = __devexit_p(xxs1500_pcmcia_remove),
}; };
int __init xxs1500_pcmcia_socket_load(void) module_platform_driver(xxs1500_pcmcia_socket_driver);
{
return platform_driver_register(&xxs1500_pcmcia_socket_driver);
}
void __exit xxs1500_pcmcia_socket_unload(void)
{
platform_driver_unregister(&xxs1500_pcmcia_socket_driver);
}
module_init(xxs1500_pcmcia_socket_load);
module_exit(xxs1500_pcmcia_socket_unload);
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("PCMCIA Socket Services for MyCable XXS1500 systems"); MODULE_DESCRIPTION("PCMCIA Socket Services for MyCable XXS1500 systems");
......
...@@ -1352,7 +1352,7 @@ static const struct dev_pm_ops yenta_pm_ops = { ...@@ -1352,7 +1352,7 @@ static const struct dev_pm_ops yenta_pm_ops = {
.driver_data = CARDBUS_TYPE_##type, \ .driver_data = CARDBUS_TYPE_##type, \
} }
static struct pci_device_id yenta_table[] = { static DEFINE_PCI_DEVICE_TABLE(yenta_table) = {
CB_ID(PCI_VENDOR_ID_TI, PCI_DEVICE_ID_TI_1031, TI), CB_ID(PCI_VENDOR_ID_TI, PCI_DEVICE_ID_TI_1031, TI),
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment