ipmi: Move the address source to string to ipmi-generic code
It was in the system interface driver, but is generic functionality. Signed-off-by: Corey Minyard <cminyard@mvista.com>
This commit is contained in:
parent
ab42bf24ee
commit
7e50387bce
@ -474,6 +474,18 @@ static DEFINE_MUTEX(smi_watchers_mutex);
|
||||
#define ipmi_get_stat(intf, stat) \
|
||||
((unsigned int) atomic_read(&(intf)->stats[IPMI_STAT_ ## stat]))
|
||||
|
||||
static char *addr_src_to_str[] = { "invalid", "hotmod", "hardcoded", "SPMI",
|
||||
"ACPI", "SMBIOS", "PCI",
|
||||
"device-tree", "default" };
|
||||
|
||||
const char *ipmi_addr_src_to_str(enum ipmi_addr_src src)
|
||||
{
|
||||
if (src > SI_DEFAULT)
|
||||
src = 0; /* Invalid */
|
||||
return addr_src_to_str[src];
|
||||
}
|
||||
EXPORT_SYMBOL(ipmi_addr_src_to_str);
|
||||
|
||||
static int is_lan_addr(struct ipmi_addr *addr)
|
||||
{
|
||||
return addr->addr_type == IPMI_LAN_ADDR_TYPE;
|
||||
|
@ -111,10 +111,6 @@ enum si_type {
|
||||
};
|
||||
static char *si_to_str[] = { "kcs", "smic", "bt" };
|
||||
|
||||
static char *ipmi_addr_src_to_str[] = { NULL, "hotmod", "hardcoded", "SPMI",
|
||||
"ACPI", "SMBIOS", "PCI",
|
||||
"device-tree", "default" };
|
||||
|
||||
#define DEVICE_NAME "ipmi_si"
|
||||
|
||||
static struct platform_driver ipmi_driver;
|
||||
@ -3279,8 +3275,8 @@ static int add_smi(struct smi_info *new_smi)
|
||||
int rv = 0;
|
||||
|
||||
printk(KERN_INFO PFX "Adding %s-specified %s state machine",
|
||||
ipmi_addr_src_to_str[new_smi->addr_source],
|
||||
si_to_str[new_smi->si_type]);
|
||||
ipmi_addr_src_to_str(new_smi->addr_source),
|
||||
si_to_str[new_smi->si_type]);
|
||||
mutex_lock(&smi_infos_lock);
|
||||
if (!is_new_interface(new_smi)) {
|
||||
printk(KERN_CONT " duplicate interface\n");
|
||||
@ -3310,7 +3306,7 @@ static int try_smi_init(struct smi_info *new_smi)
|
||||
printk(KERN_INFO PFX "Trying %s-specified %s state"
|
||||
" machine at %s address 0x%lx, slave address 0x%x,"
|
||||
" irq %d\n",
|
||||
ipmi_addr_src_to_str[new_smi->addr_source],
|
||||
ipmi_addr_src_to_str(new_smi->addr_source),
|
||||
si_to_str[new_smi->si_type],
|
||||
addr_space_to_str[new_smi->io.addr_type],
|
||||
new_smi->io.addr_data,
|
||||
|
@ -278,6 +278,7 @@ enum ipmi_addr_src {
|
||||
SI_INVALID = 0, SI_HOTMOD, SI_HARDCODED, SI_SPMI, SI_ACPI, SI_SMBIOS,
|
||||
SI_PCI, SI_DEVICETREE, SI_DEFAULT
|
||||
};
|
||||
const char *ipmi_addr_src_to_str(enum ipmi_addr_src src);
|
||||
|
||||
union ipmi_smi_info_union {
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user