[PATCH -next 3/3] platform/loongarch: laptop: remove unnecessary BUG_ON in generic_subdriver_init()

From: Yang Yingliang
Date: Sat Oct 08 2022 - 23:41:04 EST


The 'sub_driver' has already be check, remove BUG_ON() to handle the fault
more gracefully.

Signed-off-by: Yang Yingliang <yangyingliang@xxxxxxxxxx>
---
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