pd6729: Coding Style fixes
Signed-off-by: Komuro <komurojun-mbn@nifty.com> Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
This commit is contained in:
parent
ae6be51ed0
commit
5cbb2b941d
1 changed files with 39 additions and 25 deletions
|
@ -14,13 +14,13 @@
|
|||
#include <linux/workqueue.h>
|
||||
#include <linux/interrupt.h>
|
||||
#include <linux/device.h>
|
||||
#include <linux/io.h>
|
||||
|
||||
#include <pcmcia/cs_types.h>
|
||||
#include <pcmcia/ss.h>
|
||||
#include <pcmcia/cs.h>
|
||||
|
||||
#include <asm/system.h>
|
||||
#include <asm/io.h>
|
||||
|
||||
#include "pd6729.h"
|
||||
#include "i82365.h"
|
||||
|
@ -222,9 +222,9 @@ static irqreturn_t pd6729_interrupt(int irq, void *dev)
|
|||
? SS_READY : 0;
|
||||
}
|
||||
|
||||
if (events) {
|
||||
if (events)
|
||||
pcmcia_parse_events(&socket[i].socket, events);
|
||||
}
|
||||
|
||||
active |= events;
|
||||
}
|
||||
|
||||
|
@ -256,9 +256,8 @@ static int pd6729_get_status(struct pcmcia_socket *sock, u_int *value)
|
|||
status = indirect_read(socket, I365_STATUS);
|
||||
*value = 0;
|
||||
|
||||
if ((status & I365_CS_DETECT) == I365_CS_DETECT) {
|
||||
if ((status & I365_CS_DETECT) == I365_CS_DETECT)
|
||||
*value |= SS_DETECT;
|
||||
}
|
||||
|
||||
/*
|
||||
* IO cards have a different meaning of bits 0,1
|
||||
|
@ -391,9 +390,9 @@ static int pd6729_set_socket(struct pcmcia_socket *sock, socket_state_t *state)
|
|||
/* Enable specific interrupt events */
|
||||
|
||||
reg = 0x00;
|
||||
if (state->csc_mask & SS_DETECT) {
|
||||
if (state->csc_mask & SS_DETECT)
|
||||
reg |= I365_CSC_DETECT;
|
||||
}
|
||||
|
||||
if (state->flags & SS_IOCARD) {
|
||||
if (state->csc_mask & SS_STSCHG)
|
||||
reg |= I365_CSC_STSCHG;
|
||||
|
@ -450,9 +449,12 @@ static int pd6729_set_io_map(struct pcmcia_socket *sock,
|
|||
|
||||
ioctl = indirect_read(socket, I365_IOCTL) & ~I365_IOCTL_MASK(map);
|
||||
|
||||
if (io->flags & MAP_0WS) ioctl |= I365_IOCTL_0WS(map);
|
||||
if (io->flags & MAP_16BIT) ioctl |= I365_IOCTL_16BIT(map);
|
||||
if (io->flags & MAP_AUTOSZ) ioctl |= I365_IOCTL_IOCS16(map);
|
||||
if (io->flags & MAP_0WS)
|
||||
ioctl |= I365_IOCTL_0WS(map);
|
||||
if (io->flags & MAP_16BIT)
|
||||
ioctl |= I365_IOCTL_16BIT(map);
|
||||
if (io->flags & MAP_AUTOSZ)
|
||||
ioctl |= I365_IOCTL_IOCS16(map);
|
||||
|
||||
indirect_write(socket, I365_IOCTL, ioctl);
|
||||
|
||||
|
@ -497,7 +499,7 @@ static int pd6729_set_mem_map(struct pcmcia_socket *sock,
|
|||
|
||||
/* write the stop address */
|
||||
|
||||
i= (mem->res->end >> 12) & 0x0fff;
|
||||
i = (mem->res->end >> 12) & 0x0fff;
|
||||
switch (to_cycles(mem->speed)) {
|
||||
case 0:
|
||||
break;
|
||||
|
@ -578,8 +580,13 @@ static irqreturn_t pd6729_test(int irq, void *dev)
|
|||
|
||||
static int pd6729_check_irq(int irq)
|
||||
{
|
||||
if (request_irq(irq, pd6729_test, IRQF_PROBE_SHARED, "x", pd6729_test)
|
||||
!= 0) return -1;
|
||||
int ret;
|
||||
|
||||
ret = request_irq(irq, pd6729_test, IRQF_PROBE_SHARED, "x",
|
||||
pd6729_test);
|
||||
if (ret)
|
||||
return -1;
|
||||
|
||||
free_irq(irq, pd6729_test);
|
||||
return 0;
|
||||
}
|
||||
|
@ -607,8 +614,9 @@ static u_int __devinit pd6729_isa_scan(void)
|
|||
if (mask & (1<<i))
|
||||
printk("%s%d", ((mask & ((1<<i)-1)) ? "," : ""), i);
|
||||
|
||||
if (mask == 0) printk("none!");
|
||||
|
||||
if (mask == 0)
|
||||
printk("none!");
|
||||
else
|
||||
printk(" polling status changes.\n");
|
||||
|
||||
return mask;
|
||||
|
@ -624,11 +632,16 @@ static int __devinit pd6729_pci_probe(struct pci_dev *dev,
|
|||
|
||||
socket = kzalloc(sizeof(struct pd6729_socket) * MAX_SOCKETS,
|
||||
GFP_KERNEL);
|
||||
if (!socket)
|
||||
if (!socket) {
|
||||
dev_warn(&dev->dev, "failed to kzalloc socket.\n");
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
if ((ret = pci_enable_device(dev)))
|
||||
ret = pci_enable_device(dev);
|
||||
if (ret) {
|
||||
dev_warn(&dev->dev, "failed to enable pci_device.\n");
|
||||
goto err_out_free_mem;
|
||||
}
|
||||
|
||||
if (!pci_resource_start(dev, 0)) {
|
||||
dev_warn(&dev->dev, "refusing to load the driver as the "
|
||||
|
@ -685,8 +698,9 @@ static int __devinit pd6729_pci_probe(struct pci_dev *dev,
|
|||
pci_set_drvdata(dev, socket);
|
||||
if (irq_mode == 1) {
|
||||
/* Register the interrupt handler */
|
||||
if ((ret = request_irq(dev->irq, pd6729_interrupt, IRQF_SHARED,
|
||||
"pd6729", socket))) {
|
||||
ret = request_irq(dev->irq, pd6729_interrupt, IRQF_SHARED,
|
||||
"pd6729", socket);
|
||||
if (ret) {
|
||||
dev_err(&dev->dev, "Failed to register irq %d\n",
|
||||
dev->irq);
|
||||
goto err_out_free_res;
|
||||
|
|
Loading…
Add table
Reference in a new issue