From patchwork Fri Jun 28 16:24:34 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiang Liu X-Patchwork-Id: 2800151 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 88CF89F245 for ; Fri, 28 Jun 2013 16:29:56 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A4BF120224 for ; Fri, 28 Jun 2013 16:29:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B0FA620218 for ; Fri, 28 Jun 2013 16:29:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755513Ab3F1Q1I (ORCPT ); Fri, 28 Jun 2013 12:27:08 -0400 Received: from mail-pd0-f175.google.com ([209.85.192.175]:37042 "EHLO mail-pd0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755496Ab3F1Q1H (ORCPT ); Fri, 28 Jun 2013 12:27:07 -0400 Received: by mail-pd0-f175.google.com with SMTP id 4so1127315pdd.34 for ; Fri, 28 Jun 2013 09:27:06 -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=Hk9RRbBtrU1midf9VpdrJBmjqR+yfhZUrJKdqbUKDT/O0T8bpvC9r00dw5T6kgjbKx UgSkgM9G0b6dNxDbb64bNl+eb5JLUlg+P7jRBacf8xKkEzyhP+nowihjwOU6T8ywYgaR FNMx7B/93XKD7BkK9R79gH6dZZeHA1YLUYZc5k95fLK1MXr3yq0hycpukZNhTr8avOWi kjySBh91qUes6ssbce2nhnRrVHp7Fnhs7kLMz66X40kbwpB3dyqO51yKaaRCdcj/UMvc /ccTxyWWFmq11AAouOLafpfaeHFGPBuWPzODccrdAC6nY80xNRGwOXKSh2j2rgZiYDgw fV+w== X-Received: by 10.66.161.166 with SMTP id xt6mr12346910pab.87.1372436826603; Fri, 28 Jun 2013 09:27:06 -0700 (PDT) Received: from localhost.localdomain ([114.250.94.88]) by mx.google.com with ESMTPSA id jf4sm8827948pbb.19.2013.06.28.09.27.02 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 28 Jun 2013 09:27:05 -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 v3 01/10] ACPI, DOCK: avoid initializing acpi_dock_notifier_list multiple times Date: Sat, 29 Jun 2013 00:24:34 +0800 Message-Id: <1372436683-31711-2-git-send-email-liuj97@gmail.com> X-Mailer: git-send-email 1.8.1.2 In-Reply-To: <1372436683-31711-1-git-send-email-liuj97@gmail.com> References: <1372436683-31711-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);