Skip to content

Commit

Permalink
Staging: ipack/bridges/tpci200: remove TPCI200_SHORTNAME constant
Browse files Browse the repository at this point in the history
Removed TPCI200_SHORTNAME. For the pr_* the name of the module is already
included due to pr_fmt declaration.

In other cases, KBUILD_MODNAME is used instead.

Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Samuel Iglesias Gonsalvez authored and Greg Kroah-Hartman committed May 19, 2012
1 parent 611b564 commit c63a7dd
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 39 deletions.
70 changes: 33 additions & 37 deletions drivers/staging/ipack/bridges/tpci200.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,16 +54,15 @@ static struct tpci200_board *check_slot(struct ipack_device *dev)
}

if (dev->slot >= TPCI200_NB_SLOT) {
pr_info("Slot [%s %d:%d] doesn't exist! Last tpci200 slot is %d.\n",
TPCI200_SHORTNAME, dev->bus_nr, dev->slot,
TPCI200_NB_SLOT-1);
pr_info("Slot [%d:%d] doesn't exist! Last tpci200 slot is %d.\n",
dev->bus_nr, dev->slot, TPCI200_NB_SLOT-1);
return NULL;
}

BUG_ON(tpci200->slots == NULL);
if (tpci200->slots[dev->slot].dev == NULL) {
pr_info("Slot [%s %d:%d] is not registered !\n",
TPCI200_SHORTNAME, dev->bus_nr, dev->slot);
pr_info("Slot [%d:%d] is not registered !\n", dev->bus_nr,
dev->slot);
return NULL;
}

Expand Down Expand Up @@ -124,8 +123,8 @@ static struct ipack_addr_space *get_slot_address_space(struct ipack_device *dev,
addr = &dev->mem_space;
break;
default:
pr_err("Slot [%s %d:%d] space number %d doesn't exist !\n",
TPCI200_SHORTNAME, dev->bus_nr, dev->slot, space);
pr_err("Slot [%d:%d] space number %d doesn't exist !\n",
dev->bus_nr, dev->slot, space);
return NULL;
break;
}
Expand Down Expand Up @@ -350,8 +349,7 @@ static irqreturn_t tpci200_interrupt(int irq, void *dev_id)
if (unhandled_ints) {
for (i = 0; i < TPCI200_NB_SLOT; i++) {
if (unhandled_ints & ((TPCI200_INT0_EN | TPCI200_INT1_EN) << (2*i))) {
pr_info("No registered ISR for slot [%s %d:%d]!. IRQ will be disabled.\n",
TPCI200_SHORTNAME,
pr_info("No registered ISR for slot [%d:%d]!. IRQ will be disabled.\n",
tpci200->number, i);
reg_value = readw(
(void __iomem *)(tpci200->info->interface_regs +
Expand Down Expand Up @@ -391,17 +389,17 @@ static struct ipack_device *tpci200_slot_register(unsigned int tpci200_number,
}

if (slot_position >= TPCI200_NB_SLOT) {
pr_info("Slot [%s %d:%d] doesn't exist!\n",
TPCI200_SHORTNAME, tpci200_number, slot_position);
pr_info("Slot [%d:%d] doesn't exist!\n", tpci200_number,
slot_position);
return NULL;
}

if (mutex_lock_interruptible(&tpci200->mutex))
return NULL;

if (tpci200->slots[slot_position].dev != NULL) {
pr_err("Slot [%s %d:%d] already installed !\n",
TPCI200_SHORTNAME, tpci200_number, slot_position);
pr_err("Slot [%d:%d] already installed !\n", tpci200_number,
slot_position);
goto err_unlock;
}

Expand Down Expand Up @@ -668,7 +666,7 @@ static int tpci200_register(struct tpci200_board *tpci200)

res = request_irq(tpci200->info->pdev->irq,
tpci200_interrupt, IRQF_SHARED,
TPCI200_SHORTNAME, (void *) tpci200);
KBUILD_MODNAME, (void *) tpci200);
if (res) {
pr_err("(bn 0x%X, sn 0x%X) unable to register IRQ !",
tpci200->info->pdev->bus->number,
Expand Down Expand Up @@ -783,31 +781,31 @@ static int tpci200_slot_unmap_space(struct ipack_device *dev, int space)
switch (space) {
case IPACK_IO_SPACE:
if (dev->io_space.address == NULL) {
pr_info("Slot [%s %d:%d] IO space not mapped !\n",
TPCI200_SHORTNAME, dev->bus_nr, dev->slot);
pr_info("Slot [%d:%d] IO space not mapped !\n",
dev->bus_nr, dev->slot);
goto out_unlock;
}
virt_addr_space = &dev->io_space;
break;
case IPACK_ID_SPACE:
if (dev->id_space.address == NULL) {
pr_info("Slot [%s %d:%d] ID space not mapped !\n",
TPCI200_SHORTNAME, dev->bus_nr, dev->slot);
pr_info("Slot [%d:%d] ID space not mapped !\n",
dev->bus_nr, dev->slot);
goto out_unlock;
}
virt_addr_space = &dev->id_space;
break;
case IPACK_MEM_SPACE:
if (dev->mem_space.address == NULL) {
pr_info("Slot [%s %d:%d] MEM space not mapped !\n",
TPCI200_SHORTNAME, dev->bus_nr, dev->slot);
pr_info("Slot [%d:%d] MEM space not mapped !\n",
dev->bus_nr, dev->slot);
goto out_unlock;
}
virt_addr_space = &dev->mem_space;
break;
default:
pr_err("Slot [%s %d:%d] space number %d doesn't exist !\n",
TPCI200_SHORTNAME, dev->bus_nr, dev->slot, space);
pr_err("Slot [%d:%d] space number %d doesn't exist !\n",
dev->bus_nr, dev->slot, space);
res = -EINVAL;
goto out_unlock;
break;
Expand Down Expand Up @@ -869,8 +867,8 @@ static int tpci200_slot_map_space(struct ipack_device *dev,
switch (space) {
case IPACK_IO_SPACE:
if (dev->io_space.address != NULL) {
pr_err("Slot [%s %d:%d] IO space already mapped !\n",
TPCI200_SHORTNAME, tpci200->number, dev->slot);
pr_err("Slot [%d:%d] IO space already mapped !\n",
tpci200->number, dev->slot);
res = -EINVAL;
goto out_unlock;
}
Expand All @@ -881,8 +879,8 @@ static int tpci200_slot_map_space(struct ipack_device *dev,
break;
case IPACK_ID_SPACE:
if (dev->id_space.address != NULL) {
pr_err("Slot [%s %d:%d] ID space already mapped !\n",
TPCI200_SHORTNAME, tpci200->number, dev->slot);
pr_err("Slot [%d:%d] ID space already mapped !\n",
tpci200->number, dev->slot);
res = -EINVAL;
goto out_unlock;
}
Expand All @@ -893,18 +891,17 @@ static int tpci200_slot_map_space(struct ipack_device *dev,
break;
case IPACK_MEM_SPACE:
if (dev->mem_space.address != NULL) {
pr_err("Slot [%s %d:%d] MEM space already mapped !\n",
TPCI200_SHORTNAME,
pr_err("Slot [%d:%d] MEM space already mapped !\n",
tpci200->number, dev->slot);
res = -EINVAL;
goto out_unlock;
}
virt_addr_space = &dev->mem_space;

if (memory_size > tpci200->slots[dev->slot].mem_phys.size) {
pr_err("Slot [%s %d:%d] request is 0x%X memory, only 0x%X available !\n",
TPCI200_SHORTNAME, dev->bus_nr, dev->slot,
memory_size, tpci200->slots[dev->slot].mem_phys.size);
pr_err("Slot [%d:%d] request is 0x%X memory, only 0x%X available !\n",
dev->bus_nr, dev->slot, memory_size,
tpci200->slots[dev->slot].mem_phys.size);
res = -EINVAL;
goto out_unlock;
}
Expand All @@ -913,8 +910,7 @@ static int tpci200_slot_map_space(struct ipack_device *dev,
size_to_map = memory_size;
break;
default:
pr_err("Slot [%s %d:%d] space %d doesn't exist !\n",
TPCI200_SHORTNAME,
pr_err("Slot [%d:%d] space %d doesn't exist !\n",
tpci200->number, dev->slot, space);
res = -EINVAL;
goto out_unlock;
Expand Down Expand Up @@ -950,16 +946,16 @@ static int tpci200_request_irq(struct ipack_device *dev, int vector,
}

if (tpci200->slots[dev->slot].irq != NULL) {
pr_err("Slot [%s %d:%d] IRQ already registered !\n",
TPCI200_SHORTNAME, dev->bus_nr, dev->slot);
pr_err("Slot [%d:%d] IRQ already registered !\n", dev->bus_nr,
dev->slot);
res = -EINVAL;
goto out_unlock;
}

slot_irq = kzalloc(sizeof(struct slot_irq), GFP_KERNEL);
if (slot_irq == NULL) {
pr_err("Slot [%s %d:%d] unable to allocate memory for IRQ !\n",
TPCI200_SHORTNAME, dev->bus_nr, dev->slot);
pr_err("Slot [%d:%d] unable to allocate memory for IRQ !\n",
dev->bus_nr, dev->slot);
res = -ENOMEM;
goto out_unlock;
}
Expand Down
2 changes: 0 additions & 2 deletions drivers/staging/ipack/bridges/tpci200.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@

#include "../ipack.h"

#define TPCI200_SHORTNAME "TPCI200"

#define TPCI200_NB_SLOT 0x4
#define TPCI200_NB_BAR 0x6

Expand Down

0 comments on commit c63a7dd

Please sign in to comment.