superio/*/superio.c: Don't hide pointer types behind typedefs
Hiding pointer types behind 'typedef's is usually not a great
idea at the best of times. Worse the typedef becomes an integer
at different stages in Coreboot. Let us refrain from doing this
at all.
Change-Id: Ia2ca8c98bb489daaa58f379433875864f6efabc8
Signed-off-by: Edward O'Callaghan <eocallaghan@alterapraxis.com>
Reviewed-on: http://review.coreboot.org/7136
Tested-by: build bot (Jenkins)
Reviewed-by: Nico Huber <nico.h@gmx.de>
diff --git a/src/superio/smsc/fdc37m60x/superio.c b/src/superio/smsc/fdc37m60x/superio.c
index f5626ee..3822acd 100644
--- a/src/superio/smsc/fdc37m60x/superio.c
+++ b/src/superio/smsc/fdc37m60x/superio.c
@@ -24,7 +24,7 @@
#include <stdlib.h>
#include "fdc37m60x.h"
-static void init(device_t dev)
+static void init(struct device *dev)
{
if (!dev->enabled)
diff --git a/src/superio/smsc/kbc1100/superio.c b/src/superio/smsc/kbc1100/superio.c
index 77777d0..9c0a196 100644
--- a/src/superio/smsc/kbc1100/superio.c
+++ b/src/superio/smsc/kbc1100/superio.c
@@ -31,8 +31,8 @@
#include "kbc1100.h"
/* Forward declarations */
-static void enable_dev(device_t dev);
-static void kbc1100_init(device_t dev);
+static void enable_dev(struct device *dev);
+static void kbc1100_init(struct device *dev);
struct chip_operations superio_smsc_kbc1100_ops = {
CHIP_NAME("SMSC KBC1100 Super I/O")
@@ -52,12 +52,12 @@
{ &ops, KBC1100_KBC, PNP_IO0 | PNP_IO1 | PNP_IRQ0 | PNP_IRQ1, { 0x7ff, 0 }, { 0x7ff, 0x4}, },
};
-static void enable_dev(device_t dev)
+static void enable_dev(struct device *dev)
{
pnp_enable_devices(dev, &pnp_ops, ARRAY_SIZE(pnp_dev_info), pnp_dev_info);
}
-static void kbc1100_init(device_t dev)
+static void kbc1100_init(struct device *dev)
{
struct resource *res0, *res1;
diff --git a/src/superio/smsc/lpc47b272/superio.c b/src/superio/smsc/lpc47b272/superio.c
index 30e89a8..4fac022 100644
--- a/src/superio/smsc/lpc47b272/superio.c
+++ b/src/superio/smsc/lpc47b272/superio.c
@@ -35,9 +35,9 @@
#include "lpc47b272.h"
/* Forward declarations */
-static void enable_dev(device_t dev);
-static void lpc47b272_init(device_t dev);
-// static void dump_pnp_device(device_t dev);
+static void enable_dev(struct device *dev);
+static void lpc47b272_init(struct device *dev);
+// static void dump_pnp_device(struct device *dev);
struct chip_operations superio_smsc_lpc47b272_ops = {
CHIP_NAME("SMSC LPC47B272 Super I/O")
@@ -68,7 +68,7 @@
*
* @param dev Pointer to structure describing a Super I/O device.
*/
-static void enable_dev(device_t dev)
+static void enable_dev(struct device *dev)
{
pnp_enable_devices(dev, &pnp_ops, ARRAY_SIZE(pnp_dev_info),
pnp_dev_info);
@@ -82,7 +82,7 @@
*
* @param dev Pointer to structure describing a Super I/O device.
*/
-static void lpc47b272_init(device_t dev)
+static void lpc47b272_init(struct device *dev)
{
if (!dev->enabled)
@@ -103,7 +103,7 @@
*
* @param dev Pointer to structure describing a Super I/O device.
*/
-static void dump_pnp_device(device_t dev)
+static void dump_pnp_device(struct device *dev)
{
int i;
print_debug("\n");
diff --git a/src/superio/smsc/lpc47b397/superio.c b/src/superio/smsc/lpc47b397/superio.c
index 8a6c03e..9c4a3b6 100644
--- a/src/superio/smsc/lpc47b397/superio.c
+++ b/src/superio/smsc/lpc47b397/superio.c
@@ -43,7 +43,7 @@
return inb(port + 1);
}
-static void enable_hwm_smbus(device_t dev)
+static void enable_hwm_smbus(struct device *dev)
{
/* Enable SensorBus register access. */
u8 reg8;
@@ -53,7 +53,7 @@
pnp_write_config(dev, 0xf0, reg8);
}
-static void lpc47b397_init(device_t dev)
+static void lpc47b397_init(struct device *dev)
{
if (!dev->enabled)
@@ -66,7 +66,7 @@
}
}
-static void lpc47b397_pnp_enable_resources(device_t dev)
+static void lpc47b397_pnp_enable_resources(struct device *dev)
{
pnp_enable_resources(dev);
@@ -99,7 +99,7 @@
#define SB_DATA2 0x0e
#define SB_DATA3 0x0f
-static int lsmbus_read_byte(device_t dev, u8 address)
+static int lsmbus_read_byte(struct device *dev, u8 address)
{
unsigned int device;
struct resource *res;
@@ -117,7 +117,7 @@
return result;
}
-static int lsmbus_write_byte(device_t dev, u8 address, u8 val)
+static int lsmbus_write_byte(struct device *dev, u8 address, u8 val)
{
unsigned int device;
struct resource *res;
diff --git a/src/superio/smsc/lpc47m10x/superio.c b/src/superio/smsc/lpc47m10x/superio.c
index a9583e4..8530056 100644
--- a/src/superio/smsc/lpc47m10x/superio.c
+++ b/src/superio/smsc/lpc47m10x/superio.c
@@ -34,9 +34,9 @@
#include "lpc47m10x.h"
/* Forward declarations */
-static void enable_dev(device_t dev);
-static void lpc47m10x_init(device_t dev);
-// static void dump_pnp_device(device_t dev);
+static void enable_dev(struct device *dev);
+static void lpc47m10x_init(struct device *dev);
+// static void dump_pnp_device(struct device *dev);
struct chip_operations superio_smsc_lpc47m10x_ops = {
CHIP_NAME("SMSC LPC47M10x Super I/O")
@@ -67,7 +67,7 @@
*
* @param dev Pointer to structure describing a Super I/O device.
*/
-static void enable_dev(device_t dev)
+static void enable_dev(struct device *dev)
{
pnp_enable_devices(dev, &pnp_ops, ARRAY_SIZE(pnp_dev_info),
pnp_dev_info);
@@ -81,7 +81,7 @@
*
* @param dev Pointer to structure describing a Super I/O device.
*/
-static void lpc47m10x_init(device_t dev)
+static void lpc47m10x_init(struct device *dev)
{
if (!dev->enabled)
@@ -102,7 +102,7 @@
*
* @param dev Pointer to structure describing a Super I/O device.
*/
-static void dump_pnp_device(device_t dev)
+static void dump_pnp_device(struct device *dev)
{
int i;
print_debug("\n");
diff --git a/src/superio/smsc/lpc47m15x/superio.c b/src/superio/smsc/lpc47m15x/superio.c
index 91e77ba..3cb601b 100644
--- a/src/superio/smsc/lpc47m15x/superio.c
+++ b/src/superio/smsc/lpc47m15x/superio.c
@@ -31,8 +31,8 @@
#include "lpc47m15x.h"
/* Forward declarations */
-static void enable_dev(device_t dev);
-static void lpc47m15x_init(device_t dev);
+static void enable_dev(struct device *dev);
+static void lpc47m15x_init(struct device *dev);
struct chip_operations superio_smsc_lpc47m15x_ops = {
CHIP_NAME("SMSC LPC47M15x/192/997 Super I/O")
@@ -56,13 +56,13 @@
{ &ops, LPC47M15X_KBC, PNP_IO0 | PNP_IO1 | PNP_IRQ0 | PNP_IRQ1, {0x07ff, 0}, {0x07ff, 4}, },
};
-static void enable_dev(device_t dev)
+static void enable_dev(struct device *dev)
{
pnp_enable_devices(dev, &pnp_ops,
ARRAY_SIZE(pnp_dev_info), pnp_dev_info);
}
-static void lpc47m15x_init(device_t dev)
+static void lpc47m15x_init(struct device *dev)
{
if (!dev->enabled)
diff --git a/src/superio/smsc/lpc47n217/superio.c b/src/superio/smsc/lpc47n217/superio.c
index 0b470f6..96dd4e2 100644
--- a/src/superio/smsc/lpc47n217/superio.c
+++ b/src/superio/smsc/lpc47n217/superio.c
@@ -34,18 +34,18 @@
#include "lpc47n217.h"
/* Forward declarations */
-static void enable_dev(device_t dev);
-static void lpc47n217_pnp_set_resources(device_t dev);
-static void lpc47n217_pnp_enable_resources(device_t dev);
-static void lpc47n217_pnp_enable(device_t dev);
-static void lpc47n217_init(device_t dev);
-static void lpc47n217_pnp_set_resource(device_t dev, struct resource *resource);
-static void lpc47n217_pnp_set_iobase(device_t dev, u16 iobase);
-static void lpc47n217_pnp_set_drq(device_t dev, u8 drq);
-static void lpc47n217_pnp_set_irq(device_t dev, u8 irq);
-static void lpc47n217_pnp_set_enable(device_t dev, int enable);
-static void pnp_enter_conf_state(device_t dev);
-static void pnp_exit_conf_state(device_t dev);
+static void enable_dev(struct device *dev);
+static void lpc47n217_pnp_set_resources(struct device *dev);
+static void lpc47n217_pnp_enable_resources(struct device *dev);
+static void lpc47n217_pnp_enable(struct device *dev);
+static void lpc47n217_init(struct device *dev);
+static void lpc47n217_pnp_set_resource(struct device *dev, struct resource *resource);
+static void lpc47n217_pnp_set_iobase(struct device *dev, u16 iobase);
+static void lpc47n217_pnp_set_drq(struct device *dev, u8 drq);
+static void lpc47n217_pnp_set_irq(struct device *dev, u8 irq);
+static void lpc47n217_pnp_set_enable(struct device *dev, int enable);
+static void pnp_enter_conf_state(struct device *dev);
+static void pnp_exit_conf_state(struct device *dev);
struct chip_operations superio_smsc_lpc47n217_ops = {
CHIP_NAME("SMSC LPC47N217 Super I/O")
@@ -72,7 +72,7 @@
*
* @param dev Pointer to structure describing a Super I/O device.
*/
-static void enable_dev(device_t dev)
+static void enable_dev(struct device *dev)
{
pnp_enable_devices(dev, &pnp_ops, ARRAY_SIZE(pnp_dev_info),
pnp_dev_info);
@@ -87,7 +87,7 @@
*
* @param dev Pointer to structure describing a Super I/O device.
*/
-static void lpc47n217_pnp_set_resources(device_t dev)
+static void lpc47n217_pnp_set_resources(struct device *dev)
{
struct resource *res;
@@ -102,7 +102,7 @@
* NOTE: Cannot use pnp_enable_resources() here because it assumes chip
* support for logical devices, which the LPC47N217 doesn't have.
*/
-static void lpc47n217_pnp_enable_resources(device_t dev)
+static void lpc47n217_pnp_enable_resources(struct device *dev)
{
pnp_enter_conf_state(dev);
lpc47n217_pnp_set_enable(dev, 1);
@@ -113,7 +113,7 @@
* NOTE: Cannot use pnp_set_enable() here because it assumes chip
* support for logical devices, which the LPC47N217 doesn't have.
*/
-static void lpc47n217_pnp_enable(device_t dev)
+static void lpc47n217_pnp_enable(struct device *dev)
{
pnp_enter_conf_state(dev);
lpc47n217_pnp_set_enable(dev, !!dev->enabled);
@@ -128,13 +128,13 @@
*
* @param dev Pointer to structure describing a Super I/O device.
*/
-static void lpc47n217_init(device_t dev)
+static void lpc47n217_init(struct device *dev)
{
if (!dev->enabled)
return;
}
-static void lpc47n217_pnp_set_resource(device_t dev, struct resource *resource)
+static void lpc47n217_pnp_set_resource(struct device *dev, struct resource *resource)
{
if (!(resource->flags & IORESOURCE_ASSIGNED)) {
printk(BIOS_ERR, "ERROR: %s %02lx not allocated\n",
@@ -164,7 +164,7 @@
report_resource_stored(dev, resource, "");
}
-static void lpc47n217_pnp_set_iobase(device_t dev, u16 iobase)
+static void lpc47n217_pnp_set_iobase(struct device *dev, u16 iobase)
{
ASSERT(!(iobase & 0x3));
@@ -184,7 +184,7 @@
}
}
-static void lpc47n217_pnp_set_drq(device_t dev, u8 drq)
+static void lpc47n217_pnp_set_drq(struct device *dev, u8 drq)
{
const u8 PP_DMA_MASK = 0x0F;
const u8 PP_DMA_SELECTION_REGISTER = 0x26;
@@ -201,7 +201,7 @@
}
}
-static void lpc47n217_pnp_set_irq(device_t dev, u8 irq)
+static void lpc47n217_pnp_set_irq(struct device *dev, u8 irq)
{
u8 irq_config_register = 0, irq_config_mask = 0;
u8 current_config, new_config;
@@ -232,7 +232,7 @@
pnp_write_config(dev, irq_config_register, new_config);
}
-static void lpc47n217_pnp_set_enable(device_t dev, int enable)
+static void lpc47n217_pnp_set_enable(struct device *dev, int enable)
{
u8 power_register = 0, power_mask = 0, current_power, new_power;
@@ -267,12 +267,12 @@
pnp_write_config(dev, power_register, new_power);
}
-static void pnp_enter_conf_state(device_t dev)
+static void pnp_enter_conf_state(struct device *dev)
{
outb(0x55, dev->path.pnp.port);
}
-static void pnp_exit_conf_state(device_t dev)
+static void pnp_exit_conf_state(struct device *dev)
{
outb(0xaa, dev->path.pnp.port);
}
@@ -285,7 +285,7 @@
*
* @param dev Pointer to structure describing a Super I/O device.
*/
-static void dump_pnp_device(device_t dev)
+static void dump_pnp_device(struct device *dev)
{
int i;
print_debug("\n");
diff --git a/src/superio/smsc/lpc47n227/superio.c b/src/superio/smsc/lpc47n227/superio.c
index b1ef18a..dced0f3 100644
--- a/src/superio/smsc/lpc47n227/superio.c
+++ b/src/superio/smsc/lpc47n227/superio.c
@@ -32,18 +32,18 @@
#include "lpc47n227.h"
/* Forward declarations. */
-static void enable_dev(device_t dev);
-void lpc47n227_pnp_set_resources(device_t dev);
-void lpc47n227_pnp_enable_resources(device_t dev);
-void lpc47n227_pnp_enable(device_t dev);
-static void lpc47n227_init(device_t dev);
-static void lpc47n227_pnp_set_resource(device_t dev, struct resource *resource);
-void lpc47n227_pnp_set_iobase(device_t dev, u16 iobase);
-void lpc47n227_pnp_set_drq(device_t dev, u8 drq);
-void lpc47n227_pnp_set_irq(device_t dev, u8 irq);
-void lpc47n227_pnp_set_enable(device_t dev, int enable);
-static void pnp_enter_conf_state(device_t dev);
-static void pnp_exit_conf_state(device_t dev);
+static void enable_dev(struct device *dev);
+void lpc47n227_pnp_set_resources(struct device *dev);
+void lpc47n227_pnp_enable_resources(struct device *dev);
+void lpc47n227_pnp_enable(struct device *dev);
+static void lpc47n227_init(struct device *dev);
+static void lpc47n227_pnp_set_resource(struct device *dev, struct resource *resource);
+void lpc47n227_pnp_set_iobase(struct device *dev, u16 iobase);
+void lpc47n227_pnp_set_drq(struct device *dev, u8 drq);
+void lpc47n227_pnp_set_irq(struct device *dev, u8 irq);
+void lpc47n227_pnp_set_enable(struct device *dev, int enable);
+static void pnp_enter_conf_state(struct device *dev);
+static void pnp_exit_conf_state(struct device *dev);
struct chip_operations superio_smsc_lpc47n227_ops = {
CHIP_NAME("SMSC LPC47N227 Super I/O")
@@ -71,7 +71,7 @@
*
* @param dev Pointer to structure describing a Super I/O device.
*/
-static void enable_dev(device_t dev)
+static void enable_dev(struct device *dev)
{
pnp_enable_devices(dev, &pnp_ops,
ARRAY_SIZE(pnp_dev_info), pnp_dev_info);
@@ -86,7 +86,7 @@
*
* @param dev Pointer to structure describing a Super I/O device.
*/
-void lpc47n227_pnp_set_resources(device_t dev)
+void lpc47n227_pnp_set_resources(struct device *dev)
{
struct resource *res;
@@ -100,7 +100,7 @@
* NOTE: Cannot use pnp_enable_resources() here because it assumes chip
* support for logical devices, which the LPC47N227 doesn't have.
*/
-void lpc47n227_pnp_enable_resources(device_t dev)
+void lpc47n227_pnp_enable_resources(struct device *dev)
{
pnp_enter_conf_state(dev);
lpc47n227_pnp_set_enable(dev, 1);
@@ -111,7 +111,7 @@
* NOTE: Cannot use pnp_set_enable() here because it assumes chip
* support for logical devices, which the LPC47N227 doesn't have.
*/
-void lpc47n227_pnp_enable(device_t dev)
+void lpc47n227_pnp_enable(struct device *dev)
{
pnp_enter_conf_state(dev);
lpc47n227_pnp_set_enable(dev, !!dev->enabled);
@@ -126,7 +126,7 @@
*
* @param dev Pointer to structure describing a Super I/O device.
*/
-static void lpc47n227_init(device_t dev)
+static void lpc47n227_init(struct device *dev)
{
if (!dev->enabled)
@@ -140,7 +140,7 @@
}
}
-static void lpc47n227_pnp_set_resource(device_t dev, struct resource *resource)
+static void lpc47n227_pnp_set_resource(struct device *dev, struct resource *resource)
{
if (!(resource->flags & IORESOURCE_ASSIGNED)) {
printk(BIOS_ERR, "ERROR: %s %02lx not allocated\n",
@@ -169,7 +169,7 @@
report_resource_stored(dev, resource, "");
}
-void lpc47n227_pnp_set_iobase(device_t dev, u16 iobase)
+void lpc47n227_pnp_set_iobase(struct device *dev, u16 iobase)
{
ASSERT(!(iobase & 0x3));
@@ -191,7 +191,7 @@
}
}
-void lpc47n227_pnp_set_drq(device_t dev, u8 drq)
+void lpc47n227_pnp_set_drq(struct device *dev, u8 drq)
{
const u8 PP_DMA_MASK = 0x0F;
const u8 PP_DMA_SELECTION_REGISTER = 0x26;
@@ -208,7 +208,7 @@
}
}
-void lpc47n227_pnp_set_irq(device_t dev, u8 irq)
+void lpc47n227_pnp_set_irq(struct device *dev, u8 irq)
{
u8 irq_config_register = 0, irq_config_mask = 0;
u8 current_config, new_config;
@@ -239,7 +239,7 @@
pnp_write_config(dev, irq_config_register, new_config);
}
-void lpc47n227_pnp_set_enable(device_t dev, int enable)
+void lpc47n227_pnp_set_enable(struct device *dev, int enable)
{
u8 power_register = 0, power_mask = 0, current_power, new_power;
@@ -276,12 +276,12 @@
pnp_write_config(dev, power_register, new_power);
}
-static void pnp_enter_conf_state(device_t dev)
+static void pnp_enter_conf_state(struct device *dev)
{
outb(0x55, dev->path.pnp.port);
}
-static void pnp_exit_conf_state(device_t dev)
+static void pnp_exit_conf_state(struct device *dev)
{
outb(0xaa, dev->path.pnp.port);
}
diff --git a/src/superio/smsc/mec1308/superio.c b/src/superio/smsc/mec1308/superio.c
index bc20ed5..5e64d6d 100644
--- a/src/superio/smsc/mec1308/superio.c
+++ b/src/superio/smsc/mec1308/superio.c
@@ -30,7 +30,7 @@
#include <stdlib.h>
#include "mec1308.h"
-static void mec1308_init(device_t dev)
+static void mec1308_init(struct device *dev)
{
if (!dev->enabled)
@@ -62,7 +62,7 @@
{ &ops, MEC1308_MBX, PNP_IO0, { 0x7ff, 0 } },
};
-static void enable_dev(device_t dev)
+static void enable_dev(struct device *dev)
{
pnp_enable_devices(dev, &pnp_ops,
ARRAY_SIZE(pnp_dev_info), pnp_dev_info);
diff --git a/src/superio/smsc/sch4037/superio.c b/src/superio/smsc/sch4037/superio.c
index ad8d8b4..e74c2e0 100644
--- a/src/superio/smsc/sch4037/superio.c
+++ b/src/superio/smsc/sch4037/superio.c
@@ -29,7 +29,7 @@
#include "sch4037.h"
-static void sch4037_init(device_t dev)
+static void sch4037_init(struct device *dev)
{
if (!dev->enabled) {
return;
@@ -55,7 +55,7 @@
{ &ops, SCH4037_KBC, PNP_IO0 | PNP_IO1 | PNP_IRQ0 | PNP_IRQ1, { 0x7ff, 0 }, { 0x7ff, 0x4}, },
};
-static void enable_dev(device_t dev)
+static void enable_dev(struct device *dev)
{
pnp_enable_devices(dev, &pnp_ops, ARRAY_SIZE(pnp_dev_info), pnp_dev_info);
}
diff --git a/src/superio/smsc/sio1036/superio.c b/src/superio/smsc/sio1036/superio.c
index e9ed6c3..b40ec4d 100644
--- a/src/superio/smsc/sio1036/superio.c
+++ b/src/superio/smsc/sio1036/superio.c
@@ -28,7 +28,7 @@
#include "sio1036.h"
-static void sio1036_init(device_t dev)
+static void sio1036_init(struct device *dev)
{
if (!dev->enabled) {
return;
@@ -48,7 +48,7 @@
{ &ops, SIO1036_SP1, PNP_IO0 | PNP_IRQ0, {0x07f8, 0}, },
};
-static void enable_dev(device_t dev)
+static void enable_dev(struct device *dev)
{
pnp_enable_devices(dev, &ops, ARRAY_SIZE(pnp_dev_info), pnp_dev_info);
}
diff --git a/src/superio/smsc/smscsuperio/superio.c b/src/superio/smsc/smscsuperio/superio.c
index 92cae86..5f5b361 100644
--- a/src/superio/smsc/smscsuperio/superio.c
+++ b/src/superio/smsc/smscsuperio/superio.c
@@ -147,7 +147,7 @@
*
* @param dev The device to use.
*/
-static void smsc_init(device_t dev)
+static void smsc_init(struct device *dev)
{
int i, ld;
@@ -224,7 +224,7 @@
*
* @param dev The device to use.
*/
-static void enable_dev(device_t dev)
+static void enable_dev(struct device *dev)
{
int i, j, fn;
int tmp[MAX_LOGICAL_DEVICES];