From patchwork Wed Jun 26 16:30:53 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiang Liu X-Patchwork-Id: 2787081 Return-Path: X-Original-To: patchwork-linux-acpi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 198B39F968 for ; Wed, 26 Jun 2013 16:33:53 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0EF29205B6 for ; Wed, 26 Jun 2013 16:33:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E99DD205B4 for ; Wed, 26 Jun 2013 16:33:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752241Ab3FZQdo (ORCPT ); Wed, 26 Jun 2013 12:33:44 -0400 Received: from mail-pa0-f52.google.com ([209.85.220.52]:61422 "EHLO mail-pa0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752487Ab3FZQdn (ORCPT ); Wed, 26 Jun 2013 12:33:43 -0400 Received: by mail-pa0-f52.google.com with SMTP id kq13so14403946pab.39 for ; Wed, 26 Jun 2013 09:33:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=HF1wSr84EfvCV7vXBw3ED6+OqEQ6aBsVe1GnnuGEvxA=; b=0moJJ2u5pWjKrUjDYlkGawyD8VQTAUhgWd8nf9r1MyVuNY9uhnzAPKAsGKONKJrT87 iyM44XCOgLiazocBaozNu7KL37g6bZ0V6ESIRvPlm4DKhuZmYq+T7YdDnF/bXuXLLwuI 6WHHbPm0JYTQuAXimu6/a1+1jdXUdjBalDYsGFw9MMXyvp4t4ghROHmbeQLtOiNoMbII oiocU505hhgNg9rzj6IeMlZE5Ae0G6SA2CNFwRrJqc72cR+xAxL330jQ/AN40QBjf8UV DKq+vm8gBcp7JBLCnmu2F0qfeXvOTArKH4NbIhzVjbz1CBgMTG0qx/uOOc689Mc4DNQa GbHA== X-Received: by 10.68.196.167 with SMTP id in7mr1546307pbc.170.1372264422444; Wed, 26 Jun 2013 09:33:42 -0700 (PDT) Received: from localhost.localdomain ([114.250.101.234]) by mx.google.com with ESMTPSA id ib9sm28981911pbc.43.2013.06.26.09.33.24 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 26 Jun 2013 09:33:41 -0700 (PDT) From: Jiang Liu To: "Rafael J . Wysocki" Cc: liuj97@gmail.com, Jiang Liu , Yijing Wang , linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, Len Brown Subject: [PATCH v2 1/9] ACPI, DOCK: avoid initializing acpi_dock_notifier_list multiple times Date: Thu, 27 Jun 2013 00:30:53 +0800 Message-Id: <1372264261-17442-2-git-send-email-liuj97@gmail.com> X-Mailer: git-send-email 1.8.1.2 In-Reply-To: <1372264261-17442-1-git-send-email-liuj97@gmail.com> References: <1372264261-17442-1-git-send-email-liuj97@gmail.com> Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Spam-Status: No, score=-8.1 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Jiang Liu 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 Cc: Len Brown Cc: "Rafael J. Wysocki" 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);