drivers: staging: rts_pstor fixed checkpatch warnings
Fixed the checkpatch warnings in rtsx.c/.h, mostly braces and spaces before tabs issues. Also fixed warning about not using DEFINE_PCI_DEVICE_TABLE(...) macro. Signed-off-by: Pelle Windestam <pelle@windestam.se> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
parent
b6fbd29c8b
commit
8122fa341d
|
@ -506,13 +506,15 @@ static int rtsx_control_thread(void *__dev)
|
||||||
*/
|
*/
|
||||||
else if (chip->srb->device->id) {
|
else if (chip->srb->device->id) {
|
||||||
printk(KERN_ERR "Bad target number (%d:%d)\n",
|
printk(KERN_ERR "Bad target number (%d:%d)\n",
|
||||||
chip->srb->device->id, chip->srb->device->lun);
|
chip->srb->device->id,
|
||||||
|
chip->srb->device->lun);
|
||||||
chip->srb->result = DID_BAD_TARGET << 16;
|
chip->srb->result = DID_BAD_TARGET << 16;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (chip->srb->device->lun > chip->max_lun) {
|
else if (chip->srb->device->lun > chip->max_lun) {
|
||||||
printk(KERN_ERR "Bad LUN (%d:%d)\n",
|
printk(KERN_ERR "Bad LUN (%d:%d)\n",
|
||||||
chip->srb->device->id, chip->srb->device->lun);
|
chip->srb->device->id,
|
||||||
|
chip->srb->device->lun);
|
||||||
chip->srb->result = DID_BAD_TARGET << 16;
|
chip->srb->result = DID_BAD_TARGET << 16;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -625,27 +627,24 @@ static irqreturn_t rtsx_interrupt(int irq, void *dev_id)
|
||||||
int retval;
|
int retval;
|
||||||
u32 status;
|
u32 status;
|
||||||
|
|
||||||
if (dev) {
|
if (dev)
|
||||||
chip = dev->chip;
|
chip = dev->chip;
|
||||||
} else {
|
else
|
||||||
return IRQ_NONE;
|
return IRQ_NONE;
|
||||||
}
|
|
||||||
|
|
||||||
if (!chip) {
|
if (!chip)
|
||||||
return IRQ_NONE;
|
return IRQ_NONE;
|
||||||
}
|
|
||||||
|
|
||||||
spin_lock(&dev->reg_lock);
|
spin_lock(&dev->reg_lock);
|
||||||
|
|
||||||
retval = rtsx_pre_handle_interrupt(chip);
|
retval = rtsx_pre_handle_interrupt(chip);
|
||||||
if (retval == STATUS_FAIL) {
|
if (retval == STATUS_FAIL) {
|
||||||
spin_unlock(&dev->reg_lock);
|
spin_unlock(&dev->reg_lock);
|
||||||
if (chip->int_reg == 0xFFFFFFFF) {
|
if (chip->int_reg == 0xFFFFFFFF)
|
||||||
return IRQ_HANDLED;
|
return IRQ_HANDLED;
|
||||||
} else {
|
else
|
||||||
return IRQ_NONE;
|
return IRQ_NONE;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
status = chip->int_reg;
|
status = chip->int_reg;
|
||||||
|
|
||||||
|
@ -661,9 +660,8 @@ static irqreturn_t rtsx_interrupt(int irq, void *dev_id)
|
||||||
|
|
||||||
if (status & (NEED_COMPLETE_INT | DELINK_INT)) {
|
if (status & (NEED_COMPLETE_INT | DELINK_INT)) {
|
||||||
if (status & (TRANS_FAIL_INT | DELINK_INT)) {
|
if (status & (TRANS_FAIL_INT | DELINK_INT)) {
|
||||||
if (status & DELINK_INT) {
|
if (status & DELINK_INT)
|
||||||
RTSX_SET_DELINK(chip);
|
RTSX_SET_DELINK(chip);
|
||||||
}
|
|
||||||
dev->trans_result = TRANS_RESULT_FAIL;
|
dev->trans_result = TRANS_RESULT_FAIL;
|
||||||
if (dev->done)
|
if (dev->done)
|
||||||
complete(dev->done);
|
complete(dev->done);
|
||||||
|
@ -844,7 +842,9 @@ static void rtsx_init_options(struct rtsx_chip *chip)
|
||||||
chip->ssc_en = 1;
|
chip->ssc_en = 1;
|
||||||
chip->sd_speed_prior = 0x01040203;
|
chip->sd_speed_prior = 0x01040203;
|
||||||
chip->sd_current_prior = 0x00010203;
|
chip->sd_current_prior = 0x00010203;
|
||||||
chip->sd_ctl = SD_PUSH_POINT_AUTO | SD_SAMPLE_POINT_AUTO | SUPPORT_MMC_DDR_MODE;
|
chip->sd_ctl = SD_PUSH_POINT_AUTO |
|
||||||
|
SD_SAMPLE_POINT_AUTO |
|
||||||
|
SUPPORT_MMC_DDR_MODE;
|
||||||
chip->sd_ddr_tx_phase = 0;
|
chip->sd_ddr_tx_phase = 0;
|
||||||
chip->mmc_ddr_tx_phase = 1;
|
chip->mmc_ddr_tx_phase = 1;
|
||||||
chip->sd_default_tx_phase = 15;
|
chip->sd_default_tx_phase = 15;
|
||||||
|
@ -896,7 +896,8 @@ static void rtsx_init_options(struct rtsx_chip *chip)
|
||||||
chip->s3_pwr_off_delay = 1000;
|
chip->s3_pwr_off_delay = 1000;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int __devinit rtsx_probe(struct pci_dev *pci, const struct pci_device_id *pci_id)
|
static int __devinit rtsx_probe(struct pci_dev *pci,
|
||||||
|
const struct pci_device_id *pci_id)
|
||||||
{
|
{
|
||||||
struct Scsi_Host *host;
|
struct Scsi_Host *host;
|
||||||
struct rtsx_dev *dev;
|
struct rtsx_dev *dev;
|
||||||
|
@ -913,7 +914,8 @@ static int __devinit rtsx_probe(struct pci_dev *pci, const struct pci_device_id
|
||||||
|
|
||||||
err = pci_request_regions(pci, CR_DRIVER_NAME);
|
err = pci_request_regions(pci, CR_DRIVER_NAME);
|
||||||
if (err < 0) {
|
if (err < 0) {
|
||||||
printk(KERN_ERR "PCI request regions for %s failed!\n", CR_DRIVER_NAME);
|
printk(KERN_ERR "PCI request regions for %s failed!\n",
|
||||||
|
CR_DRIVER_NAME);
|
||||||
pci_disable_device(pci);
|
pci_disable_device(pci);
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
@ -934,9 +936,8 @@ static int __devinit rtsx_probe(struct pci_dev *pci, const struct pci_device_id
|
||||||
memset(dev, 0, sizeof(struct rtsx_dev));
|
memset(dev, 0, sizeof(struct rtsx_dev));
|
||||||
|
|
||||||
dev->chip = kzalloc(sizeof(struct rtsx_chip), GFP_KERNEL);
|
dev->chip = kzalloc(sizeof(struct rtsx_chip), GFP_KERNEL);
|
||||||
if (dev->chip == NULL) {
|
if (dev->chip == NULL)
|
||||||
goto errout;
|
goto errout;
|
||||||
}
|
|
||||||
|
|
||||||
spin_lock_init(&dev->reg_lock);
|
spin_lock_init(&dev->reg_lock);
|
||||||
mutex_init(&(dev->dev_mutex));
|
mutex_init(&(dev->dev_mutex));
|
||||||
|
@ -950,7 +951,8 @@ static int __devinit rtsx_probe(struct pci_dev *pci, const struct pci_device_id
|
||||||
dev->pci = pci;
|
dev->pci = pci;
|
||||||
dev->irq = -1;
|
dev->irq = -1;
|
||||||
|
|
||||||
printk(KERN_INFO "Resource length: 0x%x\n", (unsigned int)pci_resource_len(pci, 0));
|
printk(KERN_INFO "Resource length: 0x%x\n",
|
||||||
|
(unsigned int)pci_resource_len(pci, 0));
|
||||||
dev->addr = pci_resource_start(pci, 0);
|
dev->addr = pci_resource_start(pci, 0);
|
||||||
dev->remap_addr = ioremap_nocache(dev->addr, pci_resource_len(pci, 0));
|
dev->remap_addr = ioremap_nocache(dev->addr, pci_resource_len(pci, 0));
|
||||||
if (dev->remap_addr == NULL) {
|
if (dev->remap_addr == NULL) {
|
||||||
|
@ -959,7 +961,10 @@ static int __devinit rtsx_probe(struct pci_dev *pci, const struct pci_device_id
|
||||||
goto errout;
|
goto errout;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Using "unsigned long" cast here to eliminate gcc warning in 64-bit system */
|
/*
|
||||||
|
* Using "unsigned long" cast here to eliminate gcc warning in
|
||||||
|
* 64-bit system
|
||||||
|
*/
|
||||||
printk(KERN_INFO "Original address: 0x%lx, remapped address: 0x%lx\n",
|
printk(KERN_INFO "Original address: 0x%lx, remapped address: 0x%lx\n",
|
||||||
(unsigned long)(dev->addr), (unsigned long)(dev->remap_addr));
|
(unsigned long)(dev->addr), (unsigned long)(dev->remap_addr));
|
||||||
|
|
||||||
|
@ -973,7 +978,8 @@ static int __devinit rtsx_probe(struct pci_dev *pci, const struct pci_device_id
|
||||||
dev->chip->host_cmds_ptr = dev->rtsx_resv_buf;
|
dev->chip->host_cmds_ptr = dev->rtsx_resv_buf;
|
||||||
dev->chip->host_cmds_addr = dev->rtsx_resv_buf_addr;
|
dev->chip->host_cmds_addr = dev->rtsx_resv_buf_addr;
|
||||||
dev->chip->host_sg_tbl_ptr = dev->rtsx_resv_buf + HOST_CMDS_BUF_LEN;
|
dev->chip->host_sg_tbl_ptr = dev->rtsx_resv_buf + HOST_CMDS_BUF_LEN;
|
||||||
dev->chip->host_sg_tbl_addr = dev->rtsx_resv_buf_addr + HOST_CMDS_BUF_LEN;
|
dev->chip->host_sg_tbl_addr = dev->rtsx_resv_buf_addr +
|
||||||
|
HOST_CMDS_BUF_LEN;
|
||||||
|
|
||||||
dev->chip->rtsx = dev;
|
dev->chip->rtsx = dev;
|
||||||
|
|
||||||
|
@ -1058,10 +1064,10 @@ static void __devexit rtsx_remove(struct pci_dev *pci)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* PCI IDs */
|
/* PCI IDs */
|
||||||
static struct pci_device_id rtsx_ids[] = {
|
static DEFINE_PCI_DEVICE_TABLE(rtsx_ids) = {
|
||||||
{ 0x10EC, 0x5208, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_OTHERS << 16, 0xFF0000 },
|
{ PCI_DEVICE(PCI_VENDOR_ID_REALTEK, 0x5208), PCI_CLASS_OTHERS << 16, 0xFF0000 },
|
||||||
{ 0x10EC, 0x5209, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_OTHERS << 16, 0xFF0000 },
|
{ PCI_DEVICE(PCI_VENDOR_ID_REALTEK, 0x5209), PCI_CLASS_OTHERS << 16, 0xFF0000 },
|
||||||
{ 0x10EC, 0x5288, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_OTHERS << 16, 0xFF0000 },
|
{ PCI_DEVICE(PCI_VENDOR_ID_REALTEK, 0x5288), PCI_CLASS_OTHERS << 16, 0xFF0000 },
|
||||||
{ 0, },
|
{ 0, },
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -24,8 +24,8 @@
|
||||||
#ifndef __REALTEK_RTSX_H
|
#ifndef __REALTEK_RTSX_H
|
||||||
#define __REALTEK_RTSX_H
|
#define __REALTEK_RTSX_H
|
||||||
|
|
||||||
#include <asm/io.h>
|
#include <linux/io.h>
|
||||||
#include <asm/bitops.h>
|
#include <linux/bitops.h>
|
||||||
#include <linux/delay.h>
|
#include <linux/delay.h>
|
||||||
#include <linux/interrupt.h>
|
#include <linux/interrupt.h>
|
||||||
#include <linux/kernel.h>
|
#include <linux/kernel.h>
|
||||||
|
|
Loading…
Reference in New Issue