Commit 2f9dcc46 authored by Jeremy Sowden's avatar Jeremy Sowden Committed by Greg Kroah-Hartman

staging: kpc2000: removed trailing white-space.

Removed trailing white-space from four files.
Signed-off-by: default avatarJeremy Sowden <jeremy@azazel.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent db013a88
...@@ -106,24 +106,24 @@ static int probe_core_basic(unsigned int core_num, struct kp2000_device *pcard, ...@@ -106,24 +106,24 @@ static int probe_core_basic(unsigned int core_num, struct kp2000_device *pcard,
}; };
dev_dbg(&pcard->pdev->dev, "Found Basic core: type = %02d dma = %02x / %02x offset = 0x%x length = 0x%x (%d regs)\n", cte.type, KPC_OLD_S2C_DMA_CH_NUM(cte), KPC_OLD_C2S_DMA_CH_NUM(cte), cte.offset, cte.length, cte.length / 8); dev_dbg(&pcard->pdev->dev, "Found Basic core: type = %02d dma = %02x / %02x offset = 0x%x length = 0x%x (%d regs)\n", cte.type, KPC_OLD_S2C_DMA_CH_NUM(cte), KPC_OLD_C2S_DMA_CH_NUM(cte), cte.offset, cte.length, cte.length / 8);
cell.platform_data = &core_pdata; cell.platform_data = &core_pdata;
cell.pdata_size = sizeof(struct kpc_core_device_platdata); cell.pdata_size = sizeof(struct kpc_core_device_platdata);
cell.num_resources = 2; cell.num_resources = 2;
memset(&resources, 0, sizeof(resources)); memset(&resources, 0, sizeof(resources));
resources[0].start = cte.offset; resources[0].start = cte.offset;
resources[0].end = cte.offset + (cte.length - 1); resources[0].end = cte.offset + (cte.length - 1);
resources[0].flags = IORESOURCE_MEM; resources[0].flags = IORESOURCE_MEM;
resources[1].start = pcard->pdev->irq; resources[1].start = pcard->pdev->irq;
resources[1].end = pcard->pdev->irq; resources[1].end = pcard->pdev->irq;
resources[1].flags = IORESOURCE_IRQ; resources[1].flags = IORESOURCE_IRQ;
cell.resources = resources; cell.resources = resources;
return mfd_add_devices( return mfd_add_devices(
PCARD_TO_DEV(pcard), // parent PCARD_TO_DEV(pcard), // parent
pcard->card_num * 100, // id pcard->card_num * 100, // id
...@@ -148,7 +148,7 @@ struct kpc_uio_device { ...@@ -148,7 +148,7 @@ struct kpc_uio_device {
static ssize_t show_attr(struct device *dev, struct device_attribute *attr, char *buf) static ssize_t show_attr(struct device *dev, struct device_attribute *attr, char *buf)
{ {
struct kpc_uio_device *kudev = dev_get_drvdata(dev); struct kpc_uio_device *kudev = dev_get_drvdata(dev);
#define ATTR_NAME_CMP(v) (strcmp(v, attr->attr.name) == 0) #define ATTR_NAME_CMP(v) (strcmp(v, attr->attr.name) == 0)
if ATTR_NAME_CMP("offset"){ if ATTR_NAME_CMP("offset"){
return scnprintf(buf, PAGE_SIZE, "%u\n", kudev->cte.offset); return scnprintf(buf, PAGE_SIZE, "%u\n", kudev->cte.offset);
...@@ -228,7 +228,7 @@ irqreturn_t kuio_handler(int irq, struct uio_info *uioinfo) ...@@ -228,7 +228,7 @@ irqreturn_t kuio_handler(int irq, struct uio_info *uioinfo)
struct kpc_uio_device *kudev = uioinfo->priv; struct kpc_uio_device *kudev = uioinfo->priv;
if (irq != kudev->pcard->pdev->irq) if (irq != kudev->pcard->pdev->irq)
return IRQ_NONE; return IRQ_NONE;
if (kp2000_check_uio_irq(kudev->pcard, kudev->cte.irq_base_num)){ if (kp2000_check_uio_irq(kudev->pcard, kudev->cte.irq_base_num)){
writeq((1 << kudev->cte.irq_base_num), kudev->pcard->sysinfo_regs_base + REG_INTERRUPT_ACTIVE); // Clear the active flag writeq((1 << kudev->cte.irq_base_num), kudev->pcard->sysinfo_regs_base + REG_INTERRUPT_ACTIVE); // Clear the active flag
return IRQ_HANDLED; return IRQ_HANDLED;
...@@ -242,7 +242,7 @@ int kuio_irqcontrol(struct uio_info *uioinfo, s32 irq_on) ...@@ -242,7 +242,7 @@ int kuio_irqcontrol(struct uio_info *uioinfo, s32 irq_on)
struct kpc_uio_device *kudev = uioinfo->priv; struct kpc_uio_device *kudev = uioinfo->priv;
struct kp2000_device *pcard = kudev->pcard; struct kp2000_device *pcard = kudev->pcard;
u64 mask; u64 mask;
lock_card(pcard); lock_card(pcard);
mask = readq(pcard->sysinfo_regs_base + REG_INTERRUPT_MASK); mask = readq(pcard->sysinfo_regs_base + REG_INTERRUPT_MASK);
if (irq_on){ if (irq_on){
...@@ -252,7 +252,7 @@ int kuio_irqcontrol(struct uio_info *uioinfo, s32 irq_on) ...@@ -252,7 +252,7 @@ int kuio_irqcontrol(struct uio_info *uioinfo, s32 irq_on)
} }
writeq(mask, pcard->sysinfo_regs_base + REG_INTERRUPT_MASK); writeq(mask, pcard->sysinfo_regs_base + REG_INTERRUPT_MASK);
unlock_card(pcard); unlock_card(pcard);
return 0; return 0;
} }
...@@ -263,18 +263,18 @@ static int probe_core_uio(unsigned int core_num, struct kp2000_device *pcard, ...@@ -263,18 +263,18 @@ static int probe_core_uio(unsigned int core_num, struct kp2000_device *pcard,
int rv; int rv;
dev_dbg(&pcard->pdev->dev, "Found UIO core: type = %02d dma = %02x / %02x offset = 0x%x length = 0x%x (%d regs)\n", cte.type, KPC_OLD_S2C_DMA_CH_NUM(cte), KPC_OLD_C2S_DMA_CH_NUM(cte), cte.offset, cte.length, cte.length / 8); dev_dbg(&pcard->pdev->dev, "Found UIO core: type = %02d dma = %02x / %02x offset = 0x%x length = 0x%x (%d regs)\n", cte.type, KPC_OLD_S2C_DMA_CH_NUM(cte), KPC_OLD_C2S_DMA_CH_NUM(cte), cte.offset, cte.length, cte.length / 8);
kudev = kzalloc(sizeof(struct kpc_uio_device), GFP_KERNEL); kudev = kzalloc(sizeof(struct kpc_uio_device), GFP_KERNEL);
if (!kudev){ if (!kudev){
dev_err(&pcard->pdev->dev, "probe_core_uio: failed to kzalloc kpc_uio_device\n"); dev_err(&pcard->pdev->dev, "probe_core_uio: failed to kzalloc kpc_uio_device\n");
return -ENOMEM; return -ENOMEM;
} }
INIT_LIST_HEAD(&kudev->list); INIT_LIST_HEAD(&kudev->list);
kudev->pcard = pcard; kudev->pcard = pcard;
kudev->cte = cte; kudev->cte = cte;
kudev->core_num = core_num; kudev->core_num = core_num;
kudev->uioinfo.priv = kudev; kudev->uioinfo.priv = kudev;
kudev->uioinfo.name = name; kudev->uioinfo.name = name;
kudev->uioinfo.version = "0.0"; kudev->uioinfo.version = "0.0";
...@@ -291,7 +291,7 @@ static int probe_core_uio(unsigned int core_num, struct kp2000_device *pcard, ...@@ -291,7 +291,7 @@ static int probe_core_uio(unsigned int core_num, struct kp2000_device *pcard,
kudev->uioinfo.mem[0].addr = pci_resource_start(pcard->pdev, REG_BAR) + cte.offset; kudev->uioinfo.mem[0].addr = pci_resource_start(pcard->pdev, REG_BAR) + cte.offset;
kudev->uioinfo.mem[0].size = (cte.length + PAGE_SIZE-1) & ~(PAGE_SIZE-1); // Round up to nearest PAGE_SIZE boundary kudev->uioinfo.mem[0].size = (cte.length + PAGE_SIZE-1) & ~(PAGE_SIZE-1); // Round up to nearest PAGE_SIZE boundary
kudev->uioinfo.mem[0].memtype = UIO_MEM_PHYS; kudev->uioinfo.mem[0].memtype = UIO_MEM_PHYS;
kudev->dev = device_create(kpc_uio_class, &pcard->pdev->dev, MKDEV(0,0), kudev, "%s.%d.%d.%d", kudev->uioinfo.name, pcard->card_num, cte.type, kudev->core_num); kudev->dev = device_create(kpc_uio_class, &pcard->pdev->dev, MKDEV(0,0), kudev, "%s.%d.%d.%d", kudev->uioinfo.name, pcard->card_num, cte.type, kudev->core_num);
if (IS_ERR(kudev->dev)) { if (IS_ERR(kudev->dev)) {
dev_err(&pcard->pdev->dev, "probe_core_uio device_create failed!\n"); dev_err(&pcard->pdev->dev, "probe_core_uio device_create failed!\n");
...@@ -299,7 +299,7 @@ static int probe_core_uio(unsigned int core_num, struct kp2000_device *pcard, ...@@ -299,7 +299,7 @@ static int probe_core_uio(unsigned int core_num, struct kp2000_device *pcard,
return -ENODEV; return -ENODEV;
} }
dev_set_drvdata(kudev->dev, kudev); dev_set_drvdata(kudev->dev, kudev);
rv = uio_register_device(kudev->dev, &kudev->uioinfo); rv = uio_register_device(kudev->dev, &kudev->uioinfo);
if (rv){ if (rv){
dev_err(&pcard->pdev->dev, "probe_core_uio failed uio_register_device: %d\n", rv); dev_err(&pcard->pdev->dev, "probe_core_uio failed uio_register_device: %d\n", rv);
...@@ -307,9 +307,9 @@ static int probe_core_uio(unsigned int core_num, struct kp2000_device *pcard, ...@@ -307,9 +307,9 @@ static int probe_core_uio(unsigned int core_num, struct kp2000_device *pcard,
kfree(kudev); kfree(kudev);
return rv; return rv;
} }
list_add_tail(&kudev->list, &pcard->uio_devices_list); list_add_tail(&kudev->list, &pcard->uio_devices_list);
return 0; return 0;
} }
...@@ -320,24 +320,24 @@ static int create_dma_engine_core(struct kp2000_device *pcard, size_t engine_re ...@@ -320,24 +320,24 @@ static int create_dma_engine_core(struct kp2000_device *pcard, size_t engine_re
struct resource resources[2]; struct resource resources[2];
dev_dbg(&pcard->pdev->dev, "create_dma_core(pcard = [%p], engine_regs_offset = %zx, engine_num = %d)\n", pcard, engine_regs_offset, engine_num); dev_dbg(&pcard->pdev->dev, "create_dma_core(pcard = [%p], engine_regs_offset = %zx, engine_num = %d)\n", pcard, engine_regs_offset, engine_num);
cell.platform_data = NULL; cell.platform_data = NULL;
cell.pdata_size = 0; cell.pdata_size = 0;
cell.name = KP_DRIVER_NAME_DMA_CONTROLLER; cell.name = KP_DRIVER_NAME_DMA_CONTROLLER;
cell.num_resources = 2; cell.num_resources = 2;
memset(&resources, 0, sizeof(resources)); memset(&resources, 0, sizeof(resources));
resources[0].start = engine_regs_offset; resources[0].start = engine_regs_offset;
resources[0].end = engine_regs_offset + (KPC_DMA_ENGINE_SIZE - 1); resources[0].end = engine_regs_offset + (KPC_DMA_ENGINE_SIZE - 1);
resources[0].flags = IORESOURCE_MEM; resources[0].flags = IORESOURCE_MEM;
resources[1].start = irq_num; resources[1].start = irq_num;
resources[1].end = irq_num; resources[1].end = irq_num;
resources[1].flags = IORESOURCE_IRQ; resources[1].flags = IORESOURCE_IRQ;
cell.resources = resources; cell.resources = resources;
return mfd_add_devices( return mfd_add_devices(
PCARD_TO_DEV(pcard), // parent PCARD_TO_DEV(pcard), // parent
pcard->card_num * 100, // id pcard->card_num * 100, // id
...@@ -354,7 +354,7 @@ static int kp2000_setup_dma_controller(struct kp2000_device *pcard) ...@@ -354,7 +354,7 @@ static int kp2000_setup_dma_controller(struct kp2000_device *pcard)
int err; int err;
unsigned int i; unsigned int i;
u64 capabilities_reg; u64 capabilities_reg;
// S2C Engines // S2C Engines
for (i = 0 ; i < 32 ; i++){ for (i = 0 ; i < 32 ; i++){
capabilities_reg = readq( pcard->dma_bar_base + KPC_DMA_S2C_BASE_OFFSET + (KPC_DMA_ENGINE_SIZE * i) ); capabilities_reg = readq( pcard->dma_bar_base + KPC_DMA_S2C_BASE_OFFSET + (KPC_DMA_ENGINE_SIZE * i) );
...@@ -371,9 +371,9 @@ static int kp2000_setup_dma_controller(struct kp2000_device *pcard) ...@@ -371,9 +371,9 @@ static int kp2000_setup_dma_controller(struct kp2000_device *pcard)
if (err) goto err_out; if (err) goto err_out;
} }
} }
return 0; return 0;
err_out: err_out:
dev_err(&pcard->pdev->dev, "kp2000_setup_dma_controller: failed to add a DMA Engine: %d\n", err); dev_err(&pcard->pdev->dev, "kp2000_setup_dma_controller: failed to add a DMA Engine: %d\n", err);
return err; return err;
...@@ -389,12 +389,12 @@ int kp2000_probe_cores(struct kp2000_device *pcard) ...@@ -389,12 +389,12 @@ int kp2000_probe_cores(struct kp2000_device *pcard)
struct core_table_entry cte; struct core_table_entry cte;
dev_dbg(&pcard->pdev->dev, "kp2000_probe_cores(pcard = %p / %d)\n", pcard, pcard->card_num); dev_dbg(&pcard->pdev->dev, "kp2000_probe_cores(pcard = %p / %d)\n", pcard, pcard->card_num);
err = kp2000_setup_dma_controller(pcard); err = kp2000_setup_dma_controller(pcard);
if (err) return err; if (err) return err;
INIT_LIST_HEAD(&pcard->uio_devices_list); INIT_LIST_HEAD(&pcard->uio_devices_list);
// First, iterate the core table looking for the highest CORE_ID // First, iterate the core table looking for the highest CORE_ID
for (i = 0 ; i < pcard->core_table_length ; i++){ for (i = 0 ; i < pcard->core_table_length ; i++){
read_val = readq(pcard->sysinfo_regs_base + ((pcard->core_table_offset + i) * 8)); read_val = readq(pcard->sysinfo_regs_base + ((pcard->core_table_offset + i) * 8));
...@@ -415,7 +415,7 @@ int kp2000_probe_cores(struct kp2000_device *pcard) ...@@ -415,7 +415,7 @@ int kp2000_probe_cores(struct kp2000_device *pcard)
for (i = 0 ; i < pcard->core_table_length ; i++){ for (i = 0 ; i < pcard->core_table_length ; i++){
read_val = readq(pcard->sysinfo_regs_base + ((pcard->core_table_offset + i) * 8)); read_val = readq(pcard->sysinfo_regs_base + ((pcard->core_table_offset + i) * 8));
parse_core_table_entry(&cte, read_val, pcard->core_table_rev); parse_core_table_entry(&cte, read_val, pcard->core_table_rev);
if (cte.type != current_type_id) if (cte.type != current_type_id)
continue; continue;
...@@ -443,7 +443,7 @@ int kp2000_probe_cores(struct kp2000_device *pcard) ...@@ -443,7 +443,7 @@ int kp2000_probe_cores(struct kp2000_device *pcard)
core_num++; core_num++;
} }
} }
// Finally, instantiate a UIO device for the core_table. // Finally, instantiate a UIO device for the core_table.
cte.type = 0; // CORE_ID_BOARD_INFO cte.type = 0; // CORE_ID_BOARD_INFO
cte.offset = 0; // board info is always at the beginning cte.offset = 0; // board info is always at the beginning
...@@ -459,7 +459,7 @@ int kp2000_probe_cores(struct kp2000_device *pcard) ...@@ -459,7 +459,7 @@ int kp2000_probe_cores(struct kp2000_device *pcard)
dev_err(&pcard->pdev->dev, "kp2000_probe_cores: failed to add board_info core: %d\n", err); dev_err(&pcard->pdev->dev, "kp2000_probe_cores: failed to add board_info core: %d\n", err);
goto error; goto error;
} }
return 0; return 0;
error: error:
......
This diff is collapsed.
...@@ -83,7 +83,7 @@ long kp2000_cdev_ioctl(struct file *filp, unsigned int ioctl_num, unsigned long ...@@ -83,7 +83,7 @@ long kp2000_cdev_ioctl(struct file *filp, unsigned int ioctl_num, unsigned long
switch (ioctl_num){ switch (ioctl_num){
case KP2000_IOCTL_GET_CPLD_REG: return readq(pcard->sysinfo_regs_base + REG_CPLD_CONFIG); case KP2000_IOCTL_GET_CPLD_REG: return readq(pcard->sysinfo_regs_base + REG_CPLD_CONFIG);
case KP2000_IOCTL_GET_PCIE_ERROR_REG: return readq(pcard->sysinfo_regs_base + REG_PCIE_ERROR_COUNT); case KP2000_IOCTL_GET_PCIE_ERROR_REG: return readq(pcard->sysinfo_regs_base + REG_PCIE_ERROR_COUNT);
case KP2000_IOCTL_GET_EVERYTHING: { case KP2000_IOCTL_GET_EVERYTHING: {
struct kp2000_regs temp; struct kp2000_regs temp;
int ret; int ret;
......
...@@ -52,17 +52,17 @@ struct kp2000_device { ...@@ -52,17 +52,17 @@ struct kp2000_device {
struct pci_dev *pdev; struct pci_dev *pdev;
struct miscdevice miscdev; struct miscdevice miscdev;
char name[16]; char name[16];
unsigned int card_num; unsigned int card_num;
struct mutex sem; struct mutex sem;
void __iomem *sysinfo_regs_base; void __iomem *sysinfo_regs_base;
void __iomem *regs_bar_base; void __iomem *regs_bar_base;
struct resource regs_base_resource; struct resource regs_base_resource;
void __iomem *dma_bar_base; void __iomem *dma_bar_base;
void __iomem *dma_common_regs; void __iomem *dma_common_regs;
struct resource dma_base_resource; struct resource dma_base_resource;
// "System Registers" // "System Registers"
u32 card_id; u32 card_id;
u32 build_version; u32 build_version;
...@@ -74,10 +74,10 @@ struct kp2000_device { ...@@ -74,10 +74,10 @@ struct kp2000_device {
u8 hardware_revision; u8 hardware_revision;
u64 ssid; u64 ssid;
u64 ddna; u64 ddna;
// IRQ stuff // IRQ stuff
unsigned int irq; unsigned int irq;
struct list_head uio_devices_list; struct list_head uio_devices_list;
}; };
......
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