Skip to content

Commit

Permalink
staging: ipack: remove irq field in struct ipack_device.
Browse files Browse the repository at this point in the history
The field irq currently is identical to the slot number.  It does not seem to
have any real use.  The number is written to hardware in ipoctal but it seems
the value that is written does not matter.

Signed-off-by: Jens Taprogge <jens.taprogge@taprogge.org>
Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Jens Taprogge authored and Greg Kroah-Hartman committed Sep 14, 2012
1 parent ea99114 commit c6e2dfa
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 19 deletions.
9 changes: 2 additions & 7 deletions drivers/staging/ipack/bridges/tpci200.c
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ static int tpci200_free_irq(struct ipack_device *dev)
return 0;
}

static int tpci200_request_irq(struct ipack_device *dev, int vector,
static int tpci200_request_irq(struct ipack_device *dev,
irqreturn_t (*handler)(void *), void *arg)
{
int res = 0;
Expand Down Expand Up @@ -227,7 +227,6 @@ static int tpci200_request_irq(struct ipack_device *dev, int vector,
* Read the User Manual of your IndustryPack device to know
* where to write the vector in memory.
*/
slot_irq->vector = vector;
slot_irq->handler = handler;
slot_irq->arg = arg;
slot_irq->holder = dev;
Expand Down Expand Up @@ -715,12 +714,8 @@ static int tpci200_pci_probe(struct pci_dev *pdev,
tpci200->number = tpci200->info->ipack_bus->bus_nr;
dev_set_drvdata(&pdev->dev, tpci200);

/*
* Give the same IRQ number as the slot number.
* The TPCI200 has assigned his own two IRQ by PCI bus driver
*/
for (i = 0; i < TPCI200_NB_SLOT; i++)
ipack_device_register(tpci200->info->ipack_bus, i, i);
ipack_device_register(tpci200->info->ipack_bus, i);
return 0;

out_err_bus_register:
Expand Down
9 changes: 5 additions & 4 deletions drivers/staging/ipack/devices/ipoctal.c
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ static const struct tty_port_operations ipoctal_tty_port_ops = {
};

static int ipoctal_inst_slot(struct ipoctal *ipoctal, unsigned int bus_nr,
unsigned int slot, unsigned int vector)
unsigned int slot)
{
int res = 0;
int i;
Expand Down Expand Up @@ -387,9 +387,10 @@ static int ipoctal_inst_slot(struct ipoctal *ipoctal, unsigned int bus_nr,
* Depending of the carrier these addresses are accesible or not.
* More info in the datasheet.
*/
ipoctal->dev->bus->ops->request_irq(ipoctal->dev, vector,
ipoctal->dev->bus->ops->request_irq(ipoctal->dev,
ipoctal_irq_handler, ipoctal);
iowrite8(vector, ipoctal->dev->mem_space.address + 1);
/* Dummy write */
iowrite8(1, ipoctal->dev->mem_space.address + 1);

/* Register the TTY device */

Expand Down Expand Up @@ -722,7 +723,7 @@ static int ipoctal_probe(struct ipack_device *dev)
return -ENOMEM;

ipoctal->dev = dev;
res = ipoctal_inst_slot(ipoctal, dev->bus_nr, dev->slot, dev->irq);
res = ipoctal_inst_slot(ipoctal, dev->bus_nr, dev->slot);
if (res)
goto out_uninst;

Expand Down
3 changes: 1 addition & 2 deletions drivers/staging/ipack/ipack.c
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ static int ipack_device_read_id(struct ipack_device *dev)
}

struct ipack_device *ipack_device_register(struct ipack_bus_device *bus,
int slot, int irqv)
int slot)
{
int ret;
struct ipack_device *dev;
Expand All @@ -441,7 +441,6 @@ struct ipack_device *ipack_device_register(struct ipack_bus_device *bus,
dev->dev.parent = bus->parent;
dev->slot = slot;
dev->bus_nr = bus->bus_nr;
dev->irq = irqv;
dev->bus = bus;
dev_set_name(&dev->dev,
"ipack-dev.%u.%u", dev->bus_nr, dev->slot);
Expand Down
8 changes: 2 additions & 6 deletions drivers/staging/ipack/ipack.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ struct ipack_addr_space {
*
* @bus_nr: IP bus number where the device is plugged
* @slot: Slot where the device is plugged in the carrier board
* @irq: IRQ vector
* @bus: ipack_bus_device where the device is plugged to.
* @id_space: Virtual address to ID space.
* @io_space: Virtual address to IO space.
Expand All @@ -68,7 +67,6 @@ struct ipack_addr_space {
struct ipack_device {
unsigned int bus_nr;
unsigned int slot;
unsigned int irq;
struct ipack_bus_device *bus;
struct ipack_addr_space id_space;
struct ipack_addr_space io_space;
Expand Down Expand Up @@ -129,7 +127,7 @@ struct ipack_driver {
struct ipack_bus_ops {
int (*map_space) (struct ipack_device *dev, unsigned int memory_size, int space);
int (*unmap_space) (struct ipack_device *dev, int space);
int (*request_irq) (struct ipack_device *dev, int vector,
int (*request_irq) (struct ipack_device *dev,
irqreturn_t (*handler)(void *), void *arg);
int (*free_irq) (struct ipack_device *dev);
int (*get_clockrate) (struct ipack_device *dev);
Expand Down Expand Up @@ -187,13 +185,11 @@ void ipack_driver_unregister(struct ipack_driver *edrv);
*
* @bus: ipack bus device it is plugged to.
* @slot: slot position in the bus device.
* @irqv: IRQ vector for the mezzanine.
*
* Register a new ipack device (mezzanine device). The call is done by
* the carrier device driver.
*/
struct ipack_device *ipack_device_register(struct ipack_bus_device *bus,
int slot, int irqv);
struct ipack_device *ipack_device_register(struct ipack_bus_device *bus, int slot);
void ipack_device_unregister(struct ipack_device *dev);

/**
Expand Down

0 comments on commit c6e2dfa

Please sign in to comment.