ipmi:bt-bmc: Fix error handling and status check
authorTang Bin <tangbin@cmss.chinamobile.com>
Tue, 5 May 2020 10:29:06 +0000 (18:29 +0800)
committerCorey Minyard <cminyard@mvista.com>
Mon, 18 May 2020 11:32:02 +0000 (06:32 -0500)
commit49826937e7c7917140515aaf10c17bedcc4acaad
tree413ba4c2ad642db59296b23cc7d3ccf0ffb7d398
parent878caa96596963ba2d73393572b02624cd23e4ff
ipmi:bt-bmc: Fix error handling and status check

If the function platform_get_irq() failed, the negative value
returned will not be detected here. So fix error handling in
bt_bmc_config_irq(). And in the function bt_bmc_probe(),
when get irq failed, it will print error message. So use
platform_get_irq_optional() to simplify code. Finally in the
function bt_bmc_remove() should make the right status check
if get irq failed.

Signed-off-by: Shengju Zhang <zhangshengju@cmss.chinamobile.com>
Signed-off-by: Tang Bin <tangbin@cmss.chinamobile.com>
Message-Id: <20200505102906.17196-1-tangbin@cmss.chinamobile.com>
[Also set bt_bmc->irq to a negative value if devm_request_irq() fails.]
Signed-off-by: Corey Minyard <cminyard@mvista.com>
drivers/char/ipmi/bt-bmc.c