Staging: ipack/devices/ipoctal: Convert ipoctal to directly use ioread/write functions.
Before it was using the functions in ipack_bus_ops. Signed-off-by: Jens Taprogge <jens.taprogge@taprogge.org> Signed-off-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
cea2f7cdff
commit
64802dc8ed
1 changed files with 8 additions and 21 deletions
|
@ -20,6 +20,7 @@
|
||||||
#include <linux/tty_flip.h>
|
#include <linux/tty_flip.h>
|
||||||
#include <linux/slab.h>
|
#include <linux/slab.h>
|
||||||
#include <linux/atomic.h>
|
#include <linux/atomic.h>
|
||||||
|
#include <linux/io.h>
|
||||||
#include "../ipack.h"
|
#include "../ipack.h"
|
||||||
#include "ipoctal.h"
|
#include "ipoctal.h"
|
||||||
#include "scc2698.h"
|
#include "scc2698.h"
|
||||||
|
@ -61,16 +62,12 @@ static inline void ipoctal_write_io_reg(struct ipoctal *ipoctal,
|
||||||
unsigned char *dest,
|
unsigned char *dest,
|
||||||
unsigned char value)
|
unsigned char value)
|
||||||
{
|
{
|
||||||
unsigned long offset;
|
iowrite8(value, dest);
|
||||||
|
|
||||||
offset = ((void __iomem *) dest) - ipoctal->dev->io_space.address;
|
|
||||||
ipoctal->dev->bus->ops->write8(ipoctal->dev, IPACK_IO_SPACE, offset,
|
|
||||||
value);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void ipoctal_write_cr_cmd(struct ipoctal *ipoctal,
|
static inline void ipoctal_write_cr_cmd(struct ipoctal *ipoctal,
|
||||||
unsigned char *dest,
|
u8 __iomem *dest,
|
||||||
unsigned char value)
|
u8 value)
|
||||||
{
|
{
|
||||||
ipoctal_write_io_reg(ipoctal, dest, value);
|
ipoctal_write_io_reg(ipoctal, dest, value);
|
||||||
}
|
}
|
||||||
|
@ -78,13 +75,7 @@ static inline void ipoctal_write_cr_cmd(struct ipoctal *ipoctal,
|
||||||
static inline unsigned char ipoctal_read_io_reg(struct ipoctal *ipoctal,
|
static inline unsigned char ipoctal_read_io_reg(struct ipoctal *ipoctal,
|
||||||
unsigned char *src)
|
unsigned char *src)
|
||||||
{
|
{
|
||||||
unsigned long offset;
|
return ioread8(src);
|
||||||
unsigned char value;
|
|
||||||
|
|
||||||
offset = ((void __iomem *) src) - ipoctal->dev->io_space.address;
|
|
||||||
ipoctal->dev->bus->ops->read8(ipoctal->dev, IPACK_IO_SPACE, offset,
|
|
||||||
&value);
|
|
||||||
return value;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct ipoctal *ipoctal_find_board(struct tty_struct *tty)
|
static struct ipoctal *ipoctal_find_board(struct tty_struct *tty)
|
||||||
|
@ -331,14 +322,11 @@ static int ipoctal_check_model(struct ipack_device *dev, unsigned char *id)
|
||||||
unsigned char manufacturerID;
|
unsigned char manufacturerID;
|
||||||
unsigned char board_id;
|
unsigned char board_id;
|
||||||
|
|
||||||
dev->bus->ops->read8(dev, IPACK_ID_SPACE,
|
manufacturerID = ioread8(dev->id_space.address + IPACK_IDPROM_OFFSET_MANUFACTURER_ID);
|
||||||
IPACK_IDPROM_OFFSET_MANUFACTURER_ID, &manufacturerID);
|
|
||||||
if (manufacturerID != IP_OCTAL_MANUFACTURER_ID)
|
if (manufacturerID != IP_OCTAL_MANUFACTURER_ID)
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
|
|
||||||
dev->bus->ops->read8(dev, IPACK_ID_SPACE,
|
board_id = ioread8(dev->id_space.address + IPACK_IDPROM_OFFSET_MODEL);
|
||||||
IPACK_IDPROM_OFFSET_MODEL, (unsigned char *)&board_id);
|
|
||||||
|
|
||||||
switch (board_id) {
|
switch (board_id) {
|
||||||
case IP_OCTAL_232_ID:
|
case IP_OCTAL_232_ID:
|
||||||
case IP_OCTAL_422_ID:
|
case IP_OCTAL_422_ID:
|
||||||
|
@ -449,8 +437,7 @@ static int ipoctal_inst_slot(struct ipoctal *ipoctal, unsigned int bus_nr,
|
||||||
*/
|
*/
|
||||||
ipoctal->dev->bus->ops->request_irq(ipoctal->dev, vector,
|
ipoctal->dev->bus->ops->request_irq(ipoctal->dev, vector,
|
||||||
ipoctal_irq_handler, ipoctal);
|
ipoctal_irq_handler, ipoctal);
|
||||||
ipoctal->dev->bus->ops->write8(ipoctal->dev, IPACK_MEM_SPACE, 1,
|
iowrite8(vector, ipoctal->dev->mem_space.address + 1);
|
||||||
vector);
|
|
||||||
|
|
||||||
/* Register the TTY device */
|
/* Register the TTY device */
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue