Skip to contentSkip to conversation

ipmi: fix slave-addr property add to ipmi platform device

PATCH In review Kamlakant Patel 2 participants 2 messages Apr 24, 2019 IPMI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ipmi: fix slave-addr property add to ipmi platform device

Remove check for p->slave_addr while adding 'slave-addr' property entry since it can be 0.
Currently, it throws following error:
"ipmi_ssif dmi-ipmi-ssif.0: ipmi_ssif: device has no slave-addr property"

This patch fixes the issue.

---
 drivers/char/ipmi/ipmi_plat_data.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/char/ipmi/ipmi_plat_data.c +1 -2
index 8f0ca2a..2b62104 100644
@@ -34,8 +34,7 @@ struct platform_device *ipmi_platform_add(const char *name, unsigned int inst,
 		p->regspacing = p->regsize;
 
 	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("slave-addr", p->slave_addr);
 	pr[pidx++] = PROPERTY_ENTRY_U8("addr-source", p->addr_source);
 	if (p->regshift)
 		pr[pidx++] = PROPERTY_ENTRY_U8("reg-shift", p->regshift);
Signature · 1 line
1.8.3.1
#1 lore raw
Quoted 7 lines · Kamlakant Patel

Remove check for p->slave_addr while adding 'slave-addr' property entry since it can be 0.
Currently, it throws following error:
"ipmi_ssif dmi-ipmi-ssif.0: ipmi_ssif: device has no slave-addr property"

This patch fixes the issue.

This would cause things that don't supply slave addresses to get the wrong address, they will get 0x00 instead of 0x20, like they should.

The right thing is to remote the warning, I guess.

-corey

Quoted 23 lines
---
 drivers/char/ipmi/ipmi_plat_data.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/char/ipmi/ipmi_plat_data.c +1 -2
index 8f0ca2a..2b62104 100644
@@ -34,8 +34,7 @@ struct platform_device *ipmi_platform_add(const char *name, unsigned int inst,
 		p->regspacing = p->regsize;
 
 	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("slave-addr", p->slave_addr);
 	pr[pidx++] = PROPERTY_ENTRY_U8("addr-source", p->addr_source);
 	if (p->regshift)
 		pr[pidx++] = PROPERTY_ENTRY_U8("reg-shift", p->regshift);
Signature · 1 line
1.8.3.1