diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2019-05-08 20:34:17 +0300 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2019-05-08 20:34:17 +0300 |
commit | 85c1a25494837ff33fdfebe98b2e4cf5b0c78475 (patch) | |
tree | 5d3953f955b8b3dbc17724e097bf711da6e68781 /drivers/char/ipmi/ipmi_plat_data.c | |
parent | fe460a6df6a8427d4ce7c731a0de43b6e10e9f6b (diff) | |
parent | ed6c3a6d8996659e3bbf4214ba26b5e5a7440b26 (diff) | |
download | linux-85c1a25494837ff33fdfebe98b2e4cf5b0c78475.tar.xz |
Merge tag 'for-linus-5.2' of git://github.com/cminyard/linux-ipmi
Pull IPMI updates from Corey Minyard:
"Some minor cleanups for the IPMI driver"
* tag 'for-linus-5.2' of git://github.com/cminyard/linux-ipmi:
ipmi: Remove warning if no slave address is present
ipmi:ssif: Only unregister the platform driver if it was registered
ipmi:ssif: compare block number correctly for multi-part return messages
ipmi: Add the i2c-addr property for SSIF interfaces
char/ipmi: fix spelling mistake "receieved_messages" -> "received_messages"
ipmi: avoid atomic_inc in exit function
ipmi: Remove file from ipmi_file_private
ipmi_si: remove an unused variable in try_smi_init()
ipmi: Make ipmi_interfaces_srcu variable static
Diffstat (limited to 'drivers/char/ipmi/ipmi_plat_data.c')
-rw-r--r-- | drivers/char/ipmi/ipmi_plat_data.c | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/drivers/char/ipmi/ipmi_plat_data.c b/drivers/char/ipmi/ipmi_plat_data.c index 8f0ca2a848eb..28471ff2a3a3 100644 --- a/drivers/char/ipmi/ipmi_plat_data.c +++ b/drivers/char/ipmi/ipmi_plat_data.c @@ -12,7 +12,7 @@ struct platform_device *ipmi_platform_add(const char *name, unsigned int inst, struct ipmi_plat_data *p) { struct platform_device *pdev; - unsigned int num_r = 1, size, pidx = 0; + unsigned int num_r = 1, size = 0, pidx = 0; struct resource r[4]; struct property_entry pr[6]; u32 flags; @@ -21,19 +21,22 @@ struct platform_device *ipmi_platform_add(const char *name, unsigned int inst, memset(pr, 0, sizeof(pr)); memset(r, 0, sizeof(r)); - if (p->type == SI_BT) - size = 3; - else if (p->type == SI_TYPE_INVALID) - size = 0; - else - size = 2; + if (p->iftype == IPMI_PLAT_IF_SI) { + if (p->type == SI_BT) + size = 3; + else if (p->type != SI_TYPE_INVALID) + size = 2; + + if (p->regsize == 0) + p->regsize = DEFAULT_REGSIZE; + if (p->regspacing == 0) + p->regspacing = p->regsize; - if (p->regsize == 0) - p->regsize = DEFAULT_REGSIZE; - if (p->regspacing == 0) - p->regspacing = p->regsize; + pr[pidx++] = PROPERTY_ENTRY_U8("ipmi-type", p->type); + } else if (p->iftype == IPMI_PLAT_IF_SSIF) { + pr[pidx++] = PROPERTY_ENTRY_U16("i2c-addr", p->addr); + } - pr[pidx++] = PROPERTY_ENTRY_U8("ipmi-type", p->type); if (p->slave_addr) pr[pidx++] = PROPERTY_ENTRY_U8("slave-addr", p->slave_addr); pr[pidx++] = PROPERTY_ENTRY_U8("addr-source", p->addr_source); |