* Re: [PATCH v3] ipmi:bt-bmc: Fix error handling and status check [not found] <20200505102906.17196-1-tangbin@cmss.chinamobile.com> @ 2020-05-05 11:49 ` Corey Minyard 2020-05-05 12:59 ` Tang Bin 2020-05-14 13:55 ` Tang Bin 0 siblings, 2 replies; 3+ messages in thread From: Corey Minyard @ 2020-05-05 11:49 UTC (permalink / raw) To: Tang Bin; +Cc: arnd, gregkh, openipmi-developer, linux-kernel, Shengju Zhang On Tue, May 05, 2020 at 06:29:06PM +0800, Tang Bin wrote: > 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. Ok, this is included in my tree. Thanks, -corey > > Signed-off-by: Shengju Zhang <zhangshengju@cmss.chinamobile.com> > Signed-off-by: Tang Bin <tangbin@cmss.chinamobile.com> > --- > Changes from v2 > - fix the commit message and the code of status check > Changes from v1 > - fix the code of status check > --- > drivers/char/ipmi/bt-bmc.c | 10 +++++----- > 1 file changed, 5 insertions(+), 5 deletions(-) > > diff --git a/drivers/char/ipmi/bt-bmc.c b/drivers/char/ipmi/bt-bmc.c > index d36aeacb2..88ee54767 100644 > --- a/drivers/char/ipmi/bt-bmc.c > +++ b/drivers/char/ipmi/bt-bmc.c > @@ -399,9 +399,9 @@ static int bt_bmc_config_irq(struct bt_bmc *bt_bmc, > struct device *dev = &pdev->dev; > int rc; > > - bt_bmc->irq = platform_get_irq(pdev, 0); > - if (!bt_bmc->irq) > - return -ENODEV; > + bt_bmc->irq = platform_get_irq_optional(pdev, 0); > + if (bt_bmc->irq < 0) > + return bt_bmc->irq; > > rc = devm_request_irq(dev, bt_bmc->irq, bt_bmc_irq, IRQF_SHARED, > DEVICE_NAME, bt_bmc); > @@ -477,7 +477,7 @@ static int bt_bmc_probe(struct platform_device *pdev) > > bt_bmc_config_irq(bt_bmc, pdev); > > - if (bt_bmc->irq) { > + if (bt_bmc->irq >= 0) { > dev_info(dev, "Using IRQ %d\n", bt_bmc->irq); > } else { > dev_info(dev, "No IRQ; using timer\n"); > @@ -503,7 +503,7 @@ static int bt_bmc_remove(struct platform_device *pdev) > struct bt_bmc *bt_bmc = dev_get_drvdata(&pdev->dev); > > misc_deregister(&bt_bmc->miscdev); > - if (!bt_bmc->irq) > + if (bt_bmc->irq < 0) > del_timer_sync(&bt_bmc->poll_timer); > return 0; > } > -- > 2.20.1.windows.1 > > > ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v3] ipmi:bt-bmc: Fix error handling and status check 2020-05-05 11:49 ` [PATCH v3] ipmi:bt-bmc: Fix error handling and status check Corey Minyard @ 2020-05-05 12:59 ` Tang Bin 2020-05-14 13:55 ` Tang Bin 1 sibling, 0 replies; 3+ messages in thread From: Tang Bin @ 2020-05-05 12:59 UTC (permalink / raw) To: minyard; +Cc: arnd, gregkh, openipmi-developer, linux-kernel, Shengju Zhang Hi, Corey: On 2020/5/5 19:49, Corey Minyard wrote: > On Tue, May 05, 2020 at 06:29:06PM +0800, Tang Bin wrote: >> 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. > Ok, this is included in my tree. I just want to say: thank you very much. After many days of communication with you, I have learned a lot, your patient teaching has inspired me a lot. It's my pleasure to meet you. Thanks, Tang Bin > ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v3] ipmi:bt-bmc: Fix error handling and status check 2020-05-05 11:49 ` [PATCH v3] ipmi:bt-bmc: Fix error handling and status check Corey Minyard 2020-05-05 12:59 ` Tang Bin @ 2020-05-14 13:55 ` Tang Bin 1 sibling, 0 replies; 3+ messages in thread From: Tang Bin @ 2020-05-14 13:55 UTC (permalink / raw) To: minyard; +Cc: arnd, gregkh, openipmi-developer, linux-kernel, Shengju Zhang Hi Corey: On 2020/5/5 19:49, Corey Minyard wrote: > On Tue, May 05, 2020 at 06:29:06PM +0800, Tang Bin wrote: > Ok, this is included in my tree. I just checked that this patch has been merged into the linux-next branch, and I saw the modification of you by this patch. I have learned a lot from you through communication. Thank you again! Tang Bin ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-05-14 13:55 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <20200505102906.17196-1-tangbin@cmss.chinamobile.com>
2020-05-05 11:49 ` [PATCH v3] ipmi:bt-bmc: Fix error handling and status check Corey Minyard
2020-05-05 12:59 ` Tang Bin
2020-05-14 13:55 ` Tang Bin
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®