mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
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 1/3] platform/loongarch: laptop: add missing platform_driver_unregister() in generic_subdriver_exit()
Date: Sun, 9 Oct 2022 11:40:07 +0800	[thread overview]
Message-ID: <20221009034009.60026-2-yangyingliang@huawei.com> (raw)
In-Reply-To: <20221009034009.60026-1-yangyingliang@huawei.com>

If setup_acpi_notify() fails in generic_subdriver_init(),
platform_driver_unregister() need be called. Call it in
generic_subdriver_exit().

Fixes: ee7fa5029de8 ("LoongArch: Add ACPI-based generic laptop driver")
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
---
 drivers/platform/loongarch/loongson-laptop.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/platform/loongarch/loongson-laptop.c b/drivers/platform/loongarch/loongson-laptop.c
index e61fe7c305e0..d9f82c3991c0 100644
--- a/drivers/platform/loongarch/loongson-laptop.c
+++ b/drivers/platform/loongarch/loongson-laptop.c
@@ -535,6 +535,7 @@ static void generic_subdriver_exit(struct generic_sub_driver *sub_driver)
 					   sub_driver->type, dispatch_acpi_notify);
 		sub_driver->acpi_notify_installed = 0;
 	}
+	platform_driver_unregister(sub_driver->driver);
 }
 
 static struct generic_sub_driver generic_sub_drivers[] __refdata = {
-- 
2.25.1


  reply	other threads:[~2022-10-09  3:40 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 ` Yang Yingliang [this message]
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 ` [PATCH -next 3/3] platform/loongarch: laptop: remove unnecessary BUG_ON in generic_subdriver_init() Yang Yingliang
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-2-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®