aboutsummaryrefslogtreecommitdiff
path: root/drivers/char/ipmi
diff options
context:
space:
mode:
authorAndy Shevchenko2018-01-22 14:56:21 +0200
committerCorey Minyard2018-02-26 15:33:13 -0600
commitc5b240916485c1350c94b6583701d7e6680fff13 (patch)
tree688bf9c2110195cf961d88e2e4a317ef29f94d95 /drivers/char/ipmi
parentad2575f8600d068edb10a9bef7f945482e3c5ca9 (diff)
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: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Corey Minyard <cminyard@mvista.com>
Diffstat (limited to 'drivers/char/ipmi')
-rw-r--r--drivers/char/ipmi/ipmi_dmi.c18
1 files changed, 5 insertions, 13 deletions
diff --git a/drivers/char/ipmi/ipmi_dmi.c b/drivers/char/ipmi/ipmi_dmi.c
index c5112b17d7ea..f1df63bc859a 100644
--- a/drivers/char/ipmi/ipmi_dmi.c
+++ b/drivers/char/ipmi/ipmi_dmi.c
@@ -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;
}