linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ipmi: fix slave-addr property add to ipmi platform device
@ 2019-04-24 10:34 Kamlakant Patel
  2019-04-24 13:27 ` Corey Minyard
  0 siblings, 1 reply; 2+ messages in thread
From: Kamlakant Patel @ 2019-04-24 10:34 UTC (permalink / raw)
  To: Corey Minyard; +Cc: Kamlakant Patel, linux-kernel, openipmi-developer

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.

Signed-off-by: Kamlakant Patel <kamlakantp@marvell.com>
---
 drivers/char/ipmi/ipmi_plat_data.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/char/ipmi/ipmi_plat_data.c b/drivers/char/ipmi/ipmi_plat_data.c
index 8f0ca2a..2b62104 100644
--- a/drivers/char/ipmi/ipmi_plat_data.c
+++ b/drivers/char/ipmi/ipmi_plat_data.c
@@ -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);
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] ipmi: fix slave-addr property add to ipmi platform device
  2019-04-24 10:34 [PATCH] ipmi: fix slave-addr property add to ipmi platform device Kamlakant Patel
@ 2019-04-24 13:27 ` Corey Minyard
  0 siblings, 0 replies; 2+ messages in thread
From: Corey Minyard @ 2019-04-24 13:27 UTC (permalink / raw)
  To: Kamlakant Patel; +Cc: linux-kernel, openipmi-developer

On Wed, Apr 24, 2019 at 10:34:14AM +0000, Kamlakant Patel wrote:
> 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

> 
> Signed-off-by: Kamlakant Patel <kamlakantp@marvell.com>
> ---
>  drivers/char/ipmi/ipmi_plat_data.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/char/ipmi/ipmi_plat_data.c b/drivers/char/ipmi/ipmi_plat_data.c
> index 8f0ca2a..2b62104 100644
> --- a/drivers/char/ipmi/ipmi_plat_data.c
> +++ b/drivers/char/ipmi/ipmi_plat_data.c
> @@ -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);
> -- 
> 1.8.3.1
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-04-24 13:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-24 10:34 [PATCH] ipmi: fix slave-addr property add to ipmi platform device Kamlakant Patel
2019-04-24 13:27 ` Corey Minyard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).