summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/input/misc/sparcspkr.c22
-rw-r--r--drivers/sbus/char/display7seg.c10
2 files changed, 14 insertions, 18 deletions
diff --git a/drivers/input/misc/sparcspkr.c b/drivers/input/misc/sparcspkr.c
index 65fd3150919b..179ff1cd6f6b 100644
--- a/drivers/input/misc/sparcspkr.c
+++ b/drivers/input/misc/sparcspkr.c
@@ -86,13 +86,13 @@ static int bbc_spkr_event(struct input_dev *dev, unsigned int type, unsigned int
spin_lock_irqsave(&state->lock, flags);
if (count) {
- outb(0x01, info->regs + 0);
- outb(0x00, info->regs + 2);
- outb((count >> 16) & 0xff, info->regs + 3);
- outb((count >> 8) & 0xff, info->regs + 4);
- outb(0x00, info->regs + 5);
+ sbus_writeb(0x01, info->regs + 0);
+ sbus_writeb(0x00, info->regs + 2);
+ sbus_writeb((count >> 16) & 0xff, info->regs + 3);
+ sbus_writeb((count >> 8) & 0xff, info->regs + 4);
+ sbus_writeb(0x00, info->regs + 5);
} else {
- outb(0x00, info->regs + 0);
+ sbus_writeb(0x00, info->regs + 0);
}
spin_unlock_irqrestore(&state->lock, flags);
@@ -123,15 +123,15 @@ static int grover_spkr_event(struct input_dev *dev, unsigned int type, unsigned
if (count) {
/* enable counter 2 */
- outb(inb(info->enable_reg) | 3, info->enable_reg);
+ sbus_writeb(sbus_readb(info->enable_reg) | 3, info->enable_reg);
/* set command for counter 2, 2 byte write */
- outb(0xB6, info->freq_regs + 1);
+ sbus_writeb(0xB6, info->freq_regs + 1);
/* select desired HZ */
- outb(count & 0xff, info->freq_regs + 0);
- outb((count >> 8) & 0xff, info->freq_regs + 0);
+ sbus_writeb(count & 0xff, info->freq_regs + 0);
+ sbus_writeb((count >> 8) & 0xff, info->freq_regs + 0);
} else {
/* disable counter 2 */
- outb(inb_p(info->enable_reg) & 0xFC, info->enable_reg);
+ sbus_writeb(sbus_readb(info->enable_reg) & 0xFC, info->enable_reg);
}
spin_unlock_irqrestore(&state->lock, flags);
diff --git a/drivers/sbus/char/display7seg.c b/drivers/sbus/char/display7seg.c
index 7c71e7b4febf..2b0ce7c350ee 100644
--- a/drivers/sbus/char/display7seg.c
+++ b/drivers/sbus/char/display7seg.c
@@ -4,6 +4,7 @@
* Copyright (c) 2000 Eric Brower (ebrower@usa.net)
*/
+#include <linux/device.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/fs.h>
@@ -143,10 +144,7 @@ static long d7s_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
case D7SIOCTM:
/* toggle device mode-- flip display orientation */
- if (regs & D7S_FLIP)
- regs &= ~D7S_FLIP;
- else
- regs |= D7S_FLIP;
+ regs ^= D7S_FLIP;
writeb(regs, p->regs);
break;
}
@@ -180,7 +178,7 @@ static int d7s_probe(struct platform_device *op)
if (d7s_device)
goto out;
- p = kzalloc(sizeof(*p), GFP_KERNEL);
+ p = devm_kzalloc(&op->dev, sizeof(*p), GFP_KERNEL);
err = -ENOMEM;
if (!p)
goto out;
@@ -231,7 +229,6 @@ out_iounmap:
of_iounmap(&op->resource[0], p->regs, sizeof(u8));
out_free:
- kfree(p);
goto out;
}
@@ -251,7 +248,6 @@ static int d7s_remove(struct platform_device *op)
misc_deregister(&d7s_miscdev);
of_iounmap(&op->resource[0], p->regs, sizeof(u8));
- kfree(p);
return 0;
}