Commit c5b24091 authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Corey Minyard

ipmi: Re-use existing macros for built-in properties

Replace home grown set_prop_entry() macro by generic
PROPERTY_ENTRY_INTEGER()-like ones.

Cc: Corey Minyard <cminyard@mvista.com>
Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: default avatarCorey Minyard <cminyard@mvista.com>
parent ad2575f8
......@@ -29,15 +29,6 @@ static struct ipmi_dmi_info *ipmi_dmi_infos;
static int ipmi_dmi_nr __initdata;
#define set_prop_entry(_p_, _name_, type, val) \
do { \
struct property_entry *_p = &_p_; \
_p->name = _name_; \
_p->length = sizeof(type); \
_p->is_string = false; \
_p->value.type##_data = val; \
} while(0)
static void __init dmi_add_platform_ipmi(unsigned long base_addr,
u32 flags,
u8 slave_addr,
......@@ -85,9 +76,10 @@ static void __init dmi_add_platform_ipmi(unsigned long base_addr,
}
if (si_type != SI_TYPE_INVALID)
set_prop_entry(p[pidx++], "ipmi-type", u8, si_type);
set_prop_entry(p[pidx++], "slave-addr", u8, slave_addr);
set_prop_entry(p[pidx++], "addr-source", u8, SI_SMBIOS);
p[pidx++] = PROPERTY_ENTRY_U8("ipmi-type", si_type);
p[pidx++] = PROPERTY_ENTRY_U8("slave-addr", slave_addr);
p[pidx++] = PROPERTY_ENTRY_U8("addr-source", SI_SMBIOS);
info = kmalloc(sizeof(*info), GFP_KERNEL);
if (!info) {
......@@ -112,7 +104,7 @@ static void __init dmi_add_platform_ipmi(unsigned long base_addr,
goto err;
if (type == IPMI_DMI_TYPE_SSIF) {
set_prop_entry(p[pidx++], "i2c-addr", u16, base_addr);
p[pidx++] = PROPERTY_ENTRY_U16("i2c-addr", base_addr);
goto add_properties;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment