From patchwork Thu Jun 13 16:32:27 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiang Liu X-Patchwork-Id: 2717771 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 A8A069F472 for ; Thu, 13 Jun 2013 16:37:09 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 972B82043B for ; Thu, 13 Jun 2013 16:37:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5F9CB20453 for ; Thu, 13 Jun 2013 16:37:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757305Ab3FMQfh (ORCPT ); Thu, 13 Jun 2013 12:35:37 -0400 Received: from mail-pd0-f177.google.com ([209.85.192.177]:51038 "EHLO mail-pd0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758658Ab3FMQfg (ORCPT ); Thu, 13 Jun 2013 12:35:36 -0400 Received: by mail-pd0-f177.google.com with SMTP id p10so6021670pdj.36 for ; Thu, 13 Jun 2013 09:35:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references; bh=nZ1s/xhk+NzbSbhk+m7i1MWtxhySGaKvDJWNAsUKp+A=; b=PoqhE/kO5hR/lQ2Yjv8zMjNlvg1bezshXGEc8u89STBq4+mq0irNq8nTNjExkcz6ab gb7J+0LjmSAL5jTs/xO8I+MLKhmrN7vdlC/hCZ6WbaTbAZgXZ3TjmVwFV+lenFNyUN4U BGfi6lAJYw1pXeSps1rD01JjDNzACXww1hbPQb4I1FCl7s0qKzSiFLTgC3UVIaXfip7k VWb2Gop1XYuKujkX6WsVqcYJwUQrXtdFnHDBljVYGRQY57NgLwJIfjFvSoiIkf2Fqe2j IaYi0aoV1CfkKyaBfyOA4P0UpYxA9XkI/lNMpDjXPja8vjUjzveJaDgjMbx4iaHGoill JYUA== X-Received: by 10.66.19.234 with SMTP id i10mr3568085pae.152.1371141335349; Thu, 13 Jun 2013 09:35:35 -0700 (PDT) Received: from localhost.localdomain ([114.250.95.159]) by mx.google.com with ESMTPSA id ty8sm176964pac.8.2013.06.13.09.35.30 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 13 Jun 2013 09:35:34 -0700 (PDT) From: Jiang Liu To: "Rafael J . Wysocki" , Bjorn Helgaas , Yinghai Lu , "Alexander E . Patrakov" Cc: Jiang Liu , Greg Kroah-Hartman , Yijing Wang , Jiang Liu , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, Shaohua Li , Len Brown , linux-acpi@vger.kernel.org Subject: [BUGFIX 4/9] ACPI, DOCK: avoid initializing acpi_dock_notifier_list multiple times Date: Fri, 14 Jun 2013 00:32:27 +0800 Message-Id: <1371141152-9468-5-git-send-email-jiang.liu@huawei.com> X-Mailer: git-send-email 1.8.1.2 In-Reply-To: <1371141152-9468-1-git-send-email-jiang.liu@huawei.com> References: <1371141152-9468-1-git-send-email-jiang.liu@huawei.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=-7.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, 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 Initialize acpi_dock_notifier_list from function acpi_dock_init() instead of dock_add() to avoid initializing it multiple times. Signed-off-by: Jiang Liu Cc: Shaohua Li 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 50e38b7..8e578aa 100644 --- a/drivers/acpi/dock.c +++ b/drivers/acpi/dock.c @@ -967,7 +967,6 @@ static int __init dock_add(acpi_handle handle) spin_lock_init(&dock_station->dd_lock); INIT_LIST_HEAD(&dock_station->sibling); INIT_LIST_HEAD(&dock_station->hotplug_devices); - ATOMIC_INIT_NOTIFIER_HEAD(&dock_notifier_list); INIT_LIST_HEAD(&dock_station->dependent_devices); /* we want the dock device to send uevents */ @@ -1038,6 +1037,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);