All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jiang Liu <liuj97@gmail.com>
To: "Rafael J . Wysocki" <rjw@sisk.pl>
Cc: liuj97@gmail.com, Jiang Liu <jiang.liu@huawei.com>,
	Yijing Wang <wangyijing@huawei.com>,
	linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org,
	Len Brown <lenb@kernel.org>
Subject: [PATCH v2 1/9] ACPI, DOCK: avoid initializing acpi_dock_notifier_list multiple times
Date: Thu, 27 Jun 2013 00:30:53 +0800	[thread overview]
Message-ID: <1372264261-17442-2-git-send-email-liuj97@gmail.com> (raw)
In-Reply-To: <1372264261-17442-1-git-send-email-liuj97@gmail.com>

From: Jiang Liu <jiang.liu@huawei.com>

Function dock_add() will be called multiple times if there are multiple
dock stations, which causes acpi_dock_notifier_list being initialized
multiple times. So move initialization of acpi_dock_notifier_list from
dock_add() to acpi_dock_init().

Signed-off-by: Jiang Liu <jiang.liu@huawei.com>
Cc: Len Brown <lenb@kernel.org>
Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
Cc: linux-acpi@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
---
 drivers/acpi/dock.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/acpi/dock.c b/drivers/acpi/dock.c
index 14de9f4..e944e39 100644
--- a/drivers/acpi/dock.c
+++ b/drivers/acpi/dock.c
@@ -1007,7 +1007,6 @@ static int __init dock_add(acpi_handle handle)
 	mutex_init(&dock_station->hp_lock);
 	spin_lock_init(&dock_station->dd_lock);
 	INIT_LIST_HEAD(&dock_station->sibling);
-	ATOMIC_INIT_NOTIFIER_HEAD(&dock_notifier_list);
 	INIT_LIST_HEAD(&dock_station->dependent_devices);
 
 	/* we want the dock device to send uevents */
@@ -1078,6 +1077,7 @@ int __init acpi_dock_init(void)
 		return 0;
 	}
 
+	ATOMIC_INIT_NOTIFIER_HEAD(&dock_notifier_list);
 	register_acpi_bus_notifier(&dock_acpi_notifier);
 	pr_info(PREFIX "%s: %d docks/bays found\n",
 		ACPI_DOCK_DRIVER_DESCRIPTION, dock_station_count);
-- 
1.8.1.2


  reply	other threads:[~2013-06-26 16:33 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-26 16:30 [PATCH v2 0/9] minor improvements for ACPI dock and acpiphp drivers Jiang Liu
2013-06-26 16:30 ` Jiang Liu [this message]
2013-06-26 16:30 ` [PATCH v2 2/9] ACPI, DOCK: kill redundant spin lock in dock station object Jiang Liu
2013-06-26 16:30 ` [PATCH v2 3/9] ACPI, DOCK: mark initialization functions with __init Jiang Liu
2013-06-26 16:30 ` [PATCH v2 4/9] ACPI, DOCK: simplify implementation of dock_create_acpi_device() Jiang Liu
2013-06-26 16:30 ` [PATCH v2 5/9] ACPI: introduce three helper functions Jiang Liu
2013-06-26 18:49   ` Rafael J. Wysocki
2013-06-26 23:46     ` Rafael J. Wysocki
2013-06-26 16:30 ` [PATCH v2 6/9] ACPI: change acpi_[bay|dock]_match() in scan.c as global functions Jiang Liu
2013-06-26 16:30 ` [PATCH v2 7/9] ACPI: simplify dock driver with new interfaces Jiang Liu
2013-06-26 23:12   ` Bjorn Helgaas
2013-06-26 16:31 ` [PATCH v2 8/9] ACPI: simpilify scan.c " Jiang Liu
2013-06-26 16:31 ` [PATCH v2 9/9] ACPI: simplify acpiphp driver " Jiang Liu
2013-06-26 18:34 ` [PATCH v2 0/9] minor improvements for ACPI dock and acpiphp drivers Rafael J. Wysocki

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=1372264261-17442-2-git-send-email-liuj97@gmail.com \
    --to=liuj97@gmail.com \
    --cc=jiang.liu@huawei.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rjw@sisk.pl \
    --cc=wangyijing@huawei.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.