diff options
Diffstat (limited to 'drivers/pcmcia/pcmcia_resource.c')
| -rw-r--r-- | drivers/pcmcia/pcmcia_resource.c | 69 |
1 files changed, 12 insertions, 57 deletions
diff --git a/drivers/pcmcia/pcmcia_resource.c b/drivers/pcmcia/pcmcia_resource.c index e8c19def1b0f..e9e31c638a67 100644 --- a/drivers/pcmcia/pcmcia_resource.c +++ b/drivers/pcmcia/pcmcia_resource.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * PCMCIA 16-bit resource management functions * @@ -7,11 +8,6 @@ * * Copyright (C) 1999 David A. Hinds * Copyright (C) 2004-2010 Dominik Brodowski - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * */ #include <linux/module.h> @@ -148,7 +144,7 @@ static int alloc_io_space(struct pcmcia_socket *s, struct resource *res, } -/** +/* * pcmcia_access_config() - read or write card configuration registers * * pcmcia_access_config() reads and writes configuration registers in @@ -188,7 +184,7 @@ static int pcmcia_access_config(struct pcmcia_device *p_dev, } -/** +/* * pcmcia_read_config_byte() - read a byte from a card configuration register * * pcmcia_read_config_byte() reads a byte from a configuration register in @@ -201,7 +197,7 @@ int pcmcia_read_config_byte(struct pcmcia_device *p_dev, off_t where, u8 *val) EXPORT_SYMBOL(pcmcia_read_config_byte); -/** +/* * pcmcia_write_config_byte() - write a byte to a card configuration register * * pcmcia_write_config_byte() writes a byte to a configuration register in @@ -284,7 +280,7 @@ int pcmcia_fixup_iowidth(struct pcmcia_device *p_dev) io_on.stop = s->io[i].res->end; s->ops->set_io_map(s, &io_off); - mdelay(40); + msleep(40); s->ops->set_io_map(s, &io_on); } unlock: @@ -394,10 +390,9 @@ int pcmcia_release_configuration(struct pcmcia_device *p_dev) * "stale", we don't bother checking the port ranges against the * current socket values. */ -static int pcmcia_release_io(struct pcmcia_device *p_dev) +static void pcmcia_release_io(struct pcmcia_device *p_dev) { struct pcmcia_socket *s = p_dev->socket; - int ret = -EINVAL; config_t *c; mutex_lock(&s->ops_mutex); @@ -416,8 +411,6 @@ static int pcmcia_release_io(struct pcmcia_device *p_dev) out: mutex_unlock(&s->ops_mutex); - - return ret; } /* pcmcia_release_io */ @@ -508,8 +501,7 @@ int pcmcia_enable_device(struct pcmcia_device *p_dev) s->socket.Vpp = p_dev->vpp; if (s->ops->set_socket(s, &s->socket)) { mutex_unlock(&s->ops_mutex); - dev_printk(KERN_WARNING, &p_dev->dev, - "Unable to set socket state\n"); + dev_warn(&p_dev->dev, "Unable to set socket state\n"); return -EINVAL; } @@ -568,7 +560,7 @@ int pcmcia_enable_device(struct pcmcia_device *p_dev) !(flags & CONF_ENABLE_PULSE_IRQ)) option |= COR_LEVEL_REQ; pcmcia_write_cis_mem(s, 1, (base + CISREG_COR)>>1, 1, &option); - mdelay(40); + msleep(40); } if (p_dev->config_regs & PRESENT_STATUS) pcmcia_write_cis_mem(s, 1, (base + CISREG_CCSR)>>1, 1, &status); @@ -692,7 +684,7 @@ EXPORT_SYMBOL(pcmcia_request_io); * pcmcia_request_irq() is a wrapper around request_irq() which allows * the PCMCIA core to clean up the registration in pcmcia_disable_device(). * Drivers are free to use request_irq() directly, but then they need to - * call free_irq() themselfves, too. Also, only %IRQF_SHARED capable IRQ + * call free_irq() themselves, too. Also, only %IRQF_SHARED capable IRQ * handlers are allowed. */ int __must_check pcmcia_request_irq(struct pcmcia_device *p_dev, @@ -713,44 +705,6 @@ int __must_check pcmcia_request_irq(struct pcmcia_device *p_dev, EXPORT_SYMBOL(pcmcia_request_irq); -/** - * pcmcia_request_exclusive_irq() - attempt to request an exclusive IRQ first - * @p_dev: the associated PCMCIA device - * @handler: IRQ handler to register - * - * pcmcia_request_exclusive_irq() is a wrapper around request_irq() which - * attempts first to request an exclusive IRQ. If it fails, it also accepts - * a shared IRQ, but prints out a warning. PCMCIA drivers should allow for - * IRQ sharing and either use request_irq directly (then they need to call - * free_irq() themselves, too), or the pcmcia_request_irq() function. - */ -int __must_check -__pcmcia_request_exclusive_irq(struct pcmcia_device *p_dev, - irq_handler_t handler) -{ - int ret; - - if (!p_dev->irq) - return -EINVAL; - - ret = request_irq(p_dev->irq, handler, 0, p_dev->devname, p_dev->priv); - if (ret) { - ret = pcmcia_request_irq(p_dev, handler); - dev_printk(KERN_WARNING, &p_dev->dev, "pcmcia: " - "request for exclusive IRQ could not be fulfilled.\n"); - dev_printk(KERN_WARNING, &p_dev->dev, "pcmcia: the driver " - "needs updating to supported shared IRQ lines.\n"); - } - if (ret) - dev_printk(KERN_INFO, &p_dev->dev, "request_irq() failed\n"); - else - p_dev->_irq = 1; - - return ret; -} /* pcmcia_request_exclusive_irq */ -EXPORT_SYMBOL(__pcmcia_request_exclusive_irq); - - #ifdef CONFIG_PCMCIA_PROBE /* mask of IRQs already reserved by other cards, we should avoid using them */ @@ -763,7 +717,8 @@ static irqreturn_t test_action(int cpl, void *dev_id) /** * pcmcia_setup_isa_irq() - determine whether an ISA IRQ can be used - * @p_dev - the associated PCMCIA device + * @p_dev: the associated PCMCIA device + * @type: IRQ type (flags) * * locking note: must be called with ops_mutex locked. */ @@ -828,7 +783,7 @@ void pcmcia_cleanup_irq(struct pcmcia_socket *s) /** * pcmcia_setup_irq() - determine IRQ to be used for device - * @p_dev - the associated PCMCIA device + * @p_dev: the associated PCMCIA device * * locking note: must be called with ops_mutex locked. */ |
