From: Yang Yingliang <yangyingliang@huawei.com>
To: <linux-kernel@vger.kernel.org>
Cc: <chenhuacai@kernel.org>, <lvjianmin@loongson.cn>,
<chenhuacai@loongson.cn>
Subject: [PATCH -next 3/3] platform/loongarch: laptop: remove unnecessary BUG_ON in generic_subdriver_init()
Date: Sun, 9 Oct 2022 11:40:09 +0800 [thread overview]
Message-ID: <20221009034009.60026-4-yangyingliang@huawei.com> (raw)
In-Reply-To: <20221009034009.60026-1-yangyingliang@huawei.com>
The 'sub_driver' has already be check, remove BUG_ON() to handle the fault
more gracefully.
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
---
drivers/platform/loongarch/loongson-laptop.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/platform/loongarch/loongson-laptop.c b/drivers/platform/loongarch/loongson-laptop.c
index a9fdfac50f35..8299195a7116 100644
--- a/drivers/platform/loongarch/loongson-laptop.c
+++ b/drivers/platform/loongarch/loongson-laptop.c
@@ -498,8 +498,6 @@ static int __init generic_subdriver_init(struct generic_sub_driver *sub_driver)
{
int ret;
- BUG_ON(!sub_driver);
-
if (!sub_driver || !sub_driver->driver)
return -EINVAL;
--
2.25.1
next prev parent reply other threads:[~2022-10-09 3:41 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-09 3:40 [PATCH -next 0/3] platform/loongarch: laptop: fix some issues Yang Yingliang
2022-10-09 3:40 ` [PATCH -next 1/3] platform/loongarch: laptop: add missing platform_driver_unregister() in generic_subdriver_exit() Yang Yingliang
2022-10-09 3:40 ` [PATCH -next 2/3] platform/loongarch: laptop: add missing generic_subdriver_exit() in generic_acpi_laptop_init() Yang Yingliang
2022-10-09 3:40 ` Yang Yingliang [this message]
2022-10-09 6:15 ` [PATCH -next 0/3] platform/loongarch: laptop: fix some issues Huacai Chen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20221009034009.60026-4-yangyingliang@huawei.com \
--to=yangyingliang@huawei.com \
--cc=chenhuacai@kernel.org \
--cc=chenhuacai@loongson.cn \
--cc=linux-kernel@vger.kernel.org \
--cc=lvjianmin@loongson.cn \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®