Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 31310
b: refs/heads/master
c: 4fa97dc
h: refs/heads/master
v: v3
  • Loading branch information
David S. Miller authored and David S. Miller committed Jun 29, 2006
1 parent 7560a43 commit 968fd1a
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 3676463178401293d625a102a00da0473fa33a1b
refs/heads/master: 4fa97dcf9d48b02934c60a48873199850351e760
29 changes: 22 additions & 7 deletions trunk/drivers/serial/sunzilog.c
Original file line number Diff line number Diff line change
Expand Up @@ -1335,9 +1335,10 @@ static int __devinit zs_get_instance(struct device_node *dp)
return ret;
}

static int zilog_irq = -1;

static int __devinit zs_probe(struct of_device *dev, const struct of_device_id *match)
{
static int zilog_irq = -1;
struct of_device *op = to_of_device(&dev->dev);
struct uart_sunzilog_port *up;
struct zilog_layout __iomem *rp;
Expand Down Expand Up @@ -1413,24 +1414,33 @@ static int __devinit zs_probe(struct of_device *dev, const struct of_device_id *
}
}

dev_set_drvdata(&dev->dev, &up[0]);

return 0;
}

static int __devexit zs_remove(struct of_device *dev)
static void __devexit zs_remove_one(struct uart_sunzilog_port *up)
{
struct uart_sunzilog_port *up = dev_get_drvdata(&dev->dev);
struct zilog_channel __iomem *channel;

if (ZS_IS_KEYB(up) || ZS_IS_MOUSE(up)) {
#ifdef CONFIG_SERIO
serio_unregister_port(&up->serio);
#endif
} else
uart_remove_one_port(&sunzilog_reg, &up->port);
}

channel = ZILOG_CHANNEL_FROM_PORT(&up->port);
static int __devexit zs_remove(struct of_device *dev)
{
struct uart_sunzilog_port *up = dev_get_drvdata(&dev->dev);
struct zilog_layout __iomem *regs;

zs_remove_one(&up[0]);
zs_remove_one(&up[1]);

of_iounmap(channel, sizeof(struct zilog_channel));
regs = sunzilog_chip_regs[up[0].port.line / 2];
of_iounmap(regs, sizeof(struct zilog_layout));

dev_set_drvdata(&dev->dev, NULL);

return 0;
}
Expand Down Expand Up @@ -1489,6 +1499,11 @@ static void __exit sunzilog_exit(void)
{
of_unregister_driver(&zs_driver);

if (zilog_irq != -1) {
free_irq(zilog_irq, sunzilog_irq_chain);
zilog_irq = -1;
}

if (NUM_SUNZILOG) {
uart_unregister_driver(&sunzilog_reg);
sunzilog_free_tables();
Expand Down

0 comments on commit 968fd1a

Please sign in to comment.