aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/ipmi/ipmi_si_intf.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/char/ipmi/ipmi_si_intf.c')
-rw-r--r--drivers/char/ipmi/ipmi_si_intf.c32
1 files changed, 12 insertions, 20 deletions
diff --git a/drivers/char/ipmi/ipmi_si_intf.c b/drivers/char/ipmi/ipmi_si_intf.c
index c67ef3e47ad5..e59b638766ef 100644
--- a/drivers/char/ipmi/ipmi_si_intf.c
+++ b/drivers/char/ipmi/ipmi_si_intf.c
@@ -1270,36 +1270,36 @@ static int try_init_port(int intf_num, struct smi_info **new_info)
1270 return 0; 1270 return 0;
1271} 1271}
1272 1272
1273static unsigned char mem_inb(struct si_sm_io *io, unsigned int offset) 1273static unsigned char intf_mem_inb(struct si_sm_io *io, unsigned int offset)
1274{ 1274{
1275 return readb((io->addr)+(offset * io->regspacing)); 1275 return readb((io->addr)+(offset * io->regspacing));
1276} 1276}
1277 1277
1278static void mem_outb(struct si_sm_io *io, unsigned int offset, 1278static void intf_mem_outb(struct si_sm_io *io, unsigned int offset,
1279 unsigned char b) 1279 unsigned char b)
1280{ 1280{
1281 writeb(b, (io->addr)+(offset * io->regspacing)); 1281 writeb(b, (io->addr)+(offset * io->regspacing));
1282} 1282}
1283 1283
1284static unsigned char mem_inw(struct si_sm_io *io, unsigned int offset) 1284static unsigned char intf_mem_inw(struct si_sm_io *io, unsigned int offset)
1285{ 1285{
1286 return (readw((io->addr)+(offset * io->regspacing)) >> io->regshift) 1286 return (readw((io->addr)+(offset * io->regspacing)) >> io->regshift)
1287 && 0xff; 1287 && 0xff;
1288} 1288}
1289 1289
1290static void mem_outw(struct si_sm_io *io, unsigned int offset, 1290static void intf_mem_outw(struct si_sm_io *io, unsigned int offset,
1291 unsigned char b) 1291 unsigned char b)
1292{ 1292{
1293 writeb(b << io->regshift, (io->addr)+(offset * io->regspacing)); 1293 writeb(b << io->regshift, (io->addr)+(offset * io->regspacing));
1294} 1294}
1295 1295
1296static unsigned char mem_inl(struct si_sm_io *io, unsigned int offset) 1296static unsigned char intf_mem_inl(struct si_sm_io *io, unsigned int offset)
1297{ 1297{
1298 return (readl((io->addr)+(offset * io->regspacing)) >> io->regshift) 1298 return (readl((io->addr)+(offset * io->regspacing)) >> io->regshift)
1299 && 0xff; 1299 && 0xff;
1300} 1300}
1301 1301
1302static void mem_outl(struct si_sm_io *io, unsigned int offset, 1302static void intf_mem_outl(struct si_sm_io *io, unsigned int offset,
1303 unsigned char b) 1303 unsigned char b)
1304{ 1304{
1305 writel(b << io->regshift, (io->addr)+(offset * io->regspacing)); 1305 writel(b << io->regshift, (io->addr)+(offset * io->regspacing));
@@ -1349,16 +1349,16 @@ static int mem_setup(struct smi_info *info)
1349 upon the register size. */ 1349 upon the register size. */
1350 switch (info->io.regsize) { 1350 switch (info->io.regsize) {
1351 case 1: 1351 case 1:
1352 info->io.inputb = mem_inb; 1352 info->io.inputb = intf_mem_inb;
1353 info->io.outputb = mem_outb; 1353 info->io.outputb = intf_mem_outb;
1354 break; 1354 break;
1355 case 2: 1355 case 2:
1356 info->io.inputb = mem_inw; 1356 info->io.inputb = intf_mem_inw;
1357 info->io.outputb = mem_outw; 1357 info->io.outputb = intf_mem_outw;
1358 break; 1358 break;
1359 case 4: 1359 case 4:
1360 info->io.inputb = mem_inl; 1360 info->io.inputb = intf_mem_inl;
1361 info->io.outputb = mem_outl; 1361 info->io.outputb = intf_mem_outl;
1362 break; 1362 break;
1363#ifdef readq 1363#ifdef readq
1364 case 8: 1364 case 8:
@@ -1580,11 +1580,6 @@ static int try_init_acpi(int intf_num, struct smi_info **new_info)
1580 if (! is_new_interface(-1, addr_space, spmi->addr.address)) 1580 if (! is_new_interface(-1, addr_space, spmi->addr.address))
1581 return -ENODEV; 1581 return -ENODEV;
1582 1582
1583 if (! spmi->addr.register_bit_width) {
1584 acpi_failure = 1;
1585 return -ENODEV;
1586 }
1587
1588 /* Figure out the interface type. */ 1583 /* Figure out the interface type. */
1589 switch (spmi->InterfaceType) 1584 switch (spmi->InterfaceType)
1590 { 1585 {
@@ -1634,9 +1629,6 @@ static int try_init_acpi(int intf_num, struct smi_info **new_info)
1634 regspacings[intf_num] = spmi->addr.register_bit_width / 8; 1629 regspacings[intf_num] = spmi->addr.register_bit_width / 8;
1635 info->io.regspacing = spmi->addr.register_bit_width / 8; 1630 info->io.regspacing = spmi->addr.register_bit_width / 8;
1636 } else { 1631 } else {
1637 /* Some broken systems get this wrong and set the value
1638 * to zero. Assume it is the default spacing. If that
1639 * is wrong, too bad, the vendor should fix the tables. */
1640 regspacings[intf_num] = DEFAULT_REGSPACING; 1632 regspacings[intf_num] = DEFAULT_REGSPACING;
1641 info->io.regspacing = DEFAULT_REGSPACING; 1633 info->io.regspacing = DEFAULT_REGSPACING;
1642 } 1634 }