From patchwork Wed Jul 23 23:44:16 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Grant Likely X-Patchwork-Id: 34188 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ig0-f198.google.com (mail-ig0-f198.google.com [209.85.213.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 129A92AFC2 for ; Wed, 23 Jul 2014 23:47:38 +0000 (UTC) Received: by mail-ig0-f198.google.com with SMTP id h18sf7682422igc.5 for ; Wed, 23 Jul 2014 16:47:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=DUu1N6jjruUKEAi+sZnGzVmXfHSFrTLKRAzTs0UYk1s=; b=j76Fjol8YQc7l/l7Bu09qa0lddwgpkEDzzQC8gpNQJH77tMf6i50wQU+oduhuj9TmG w/EArSlidXkE7vB9IjWC52P0u2e6mD3M3f1Kme7PW8EAFxsqtEHUYpFhHfmpWmcXV1DO LVgVdIe/hEhutv9My/gs2keElKbrDZ4qGlxu3hMEYqhXYxOgCnC14IgDhAW4I24qr1Uw uAKl1+SvxTL/jVi/UQ2y6dAa/6sL4MTi63HwkWDcI6ReixFmhM/FixQw6nfPhCQNty+g UrVvHzfxkfBrbpteQAnQ0Mjg2FJdq8oFsmq5Vk9vNmaDDoGPmB1043TzyLyP4r982k0A 8+GA== X-Gm-Message-State: ALoCoQmKgcnHymaFG1PAbdpH8eKfp9c7R4sOfDCBUwO3aptazNhqmOPVlWTpPZNM2POMjR+KPslI X-Received: by 10.182.81.161 with SMTP id b1mr2201668oby.1.1406159256455; Wed, 23 Jul 2014 16:47:36 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.21.203 with SMTP id 69ls552204qgl.13.gmail; Wed, 23 Jul 2014 16:47:36 -0700 (PDT) X-Received: by 10.53.10.65 with SMTP id dy1mr5891178vdd.92.1406159256366; Wed, 23 Jul 2014 16:47:36 -0700 (PDT) Received: from mail-vc0-f179.google.com (mail-vc0-f179.google.com [209.85.220.179]) by mx.google.com with ESMTPS id aq17si3827967vdc.13.2014.07.23.16.47.36 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 23 Jul 2014 16:47:36 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.179 as permitted sender) client-ip=209.85.220.179; Received: by mail-vc0-f179.google.com with SMTP id hq11so3601006vcb.38 for ; Wed, 23 Jul 2014 16:47:36 -0700 (PDT) X-Received: by 10.52.248.146 with SMTP id ym18mr6065911vdc.8.1406159256288; Wed, 23 Jul 2014 16:47:36 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.221.37.5 with SMTP id tc5csp321092vcb; Wed, 23 Jul 2014 16:47:35 -0700 (PDT) X-Received: by 10.68.68.134 with SMTP id w6mr5767374pbt.129.1406159255459; Wed, 23 Jul 2014 16:47:35 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id zw4si4020303pbc.241.2014.07.23.16.47.34 for ; Wed, 23 Jul 2014 16:47:35 -0700 (PDT) Received-SPF: none (google.com: devicetree-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758227AbaGWXrd (ORCPT + 7 others); Wed, 23 Jul 2014 19:47:33 -0400 Received: from mail-pd0-f171.google.com ([209.85.192.171]:43472 "EHLO mail-pd0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758554AbaGWXog (ORCPT ); Wed, 23 Jul 2014 19:44:36 -0400 Received: by mail-pd0-f171.google.com with SMTP id z10so2501152pdj.2 for ; Wed, 23 Jul 2014 16:44:36 -0700 (PDT) X-Received: by 10.70.15.197 with SMTP id z5mr2750590pdc.126.1406159076119; Wed, 23 Jul 2014 16:44:36 -0700 (PDT) Received: from trevor.secretlab.ca (S0106602ad082623c.cg.shawcable.net. [68.146.69.61]) by mx.google.com with ESMTPSA id n2sm4785956pdo.32.2014.07.23.16.44.33 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 23 Jul 2014 16:44:34 -0700 (PDT) Received: by trevor.secretlab.ca (Postfix, from userid 1000) id C0725C439A8; Wed, 23 Jul 2014 17:44:26 -0600 (MDT) From: Grant Likely To: linux-kernel@vger.kernel.org, Nathan Fontenot , Tyrel Datwyler , Pantelis Antoniou , devicetree@vger.kernel.org Cc: Grant Likely Subject: [PATCH 02/10] of: rename of_aliases_mutex to just of_mutex Date: Wed, 23 Jul 2014 17:44:16 -0600 Message-Id: <1406159064-21366-3-git-send-email-grant.likely@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1406159064-21366-1-git-send-email-grant.likely@linaro.org> References: <1406159064-21366-1-git-send-email-grant.likely@linaro.org> Sender: devicetree-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: devicetree@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: grant.likely@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.179 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: Pantelis Antoniou We're overloading usage of of_aliases_mutex for sysfs changes, so rename to something that is more generic. Signed-off-by: Pantelis Antoniou Signed-off-by: Grant Likely --- drivers/of/base.c | 19 +++++++++---------- drivers/of/device.c | 4 ++-- drivers/of/of_private.h | 2 +- 3 files changed, 12 insertions(+), 13 deletions(-) diff --git a/drivers/of/base.c b/drivers/of/base.c index b9864806e9b8..e48a1b90a392 100644 --- a/drivers/of/base.c +++ b/drivers/of/base.c @@ -40,10 +40,9 @@ static struct device_node *of_stdout; static struct kset *of_kset; /* - * Used to protect the of_aliases; but also overloaded to hold off addition of - * nodes to sysfs + * Used to protect the of_aliases, to hold off addition of nodes to sysfs */ -DEFINE_MUTEX(of_aliases_mutex); +DEFINE_MUTEX(of_mutex); /* use when traversing tree through the allnext, child, sibling, * or parent members of struct device_node. @@ -255,13 +254,13 @@ int of_node_add(struct device_node *np) * Grab the mutex here so that in a race condition between of_init() and * of_node_add(), node addition will still be consistent. */ - mutex_lock(&of_aliases_mutex); + mutex_lock(&of_mutex); if (of_kset) rc = __of_node_add(np); else /* This scenario may be perfectly valid, but report it anyway */ pr_info("of_node_add(%s) before of_init()\n", np->full_name); - mutex_unlock(&of_aliases_mutex); + mutex_unlock(&of_mutex); return rc; } @@ -289,15 +288,15 @@ static int __init of_init(void) struct device_node *np; /* Create the kset, and register existing nodes */ - mutex_lock(&of_aliases_mutex); + mutex_lock(&of_mutex); of_kset = kset_create_and_add("devicetree", NULL, firmware_kobj); if (!of_kset) { - mutex_unlock(&of_aliases_mutex); + mutex_unlock(&of_mutex); return -ENOMEM; } for_each_of_allnodes(np) __of_node_add(np); - mutex_unlock(&of_aliases_mutex); + mutex_unlock(&of_mutex); /* Symlink in /proc as required by userspace ABI */ if (of_allnodes) @@ -2122,7 +2121,7 @@ int of_alias_get_id(struct device_node *np, const char *stem) struct alias_prop *app; int id = -ENODEV; - mutex_lock(&of_aliases_mutex); + mutex_lock(&of_mutex); list_for_each_entry(app, &aliases_lookup, link) { if (strcmp(app->stem, stem) != 0) continue; @@ -2132,7 +2131,7 @@ int of_alias_get_id(struct device_node *np, const char *stem) break; } } - mutex_unlock(&of_aliases_mutex); + mutex_unlock(&of_mutex); return id; } diff --git a/drivers/of/device.c b/drivers/of/device.c index dafb9736ab9b..46d6c75c1404 100644 --- a/drivers/of/device.c +++ b/drivers/of/device.c @@ -160,7 +160,7 @@ void of_device_uevent(struct device *dev, struct kobj_uevent_env *env) add_uevent_var(env, "OF_COMPATIBLE_N=%d", seen); seen = 0; - mutex_lock(&of_aliases_mutex); + mutex_lock(&of_mutex); list_for_each_entry(app, &aliases_lookup, link) { if (dev->of_node == app->np) { add_uevent_var(env, "OF_ALIAS_%d=%s", seen, @@ -168,7 +168,7 @@ void of_device_uevent(struct device *dev, struct kobj_uevent_env *env) seen++; } } - mutex_unlock(&of_aliases_mutex); + mutex_unlock(&of_mutex); } int of_device_uevent_modalias(struct device *dev, struct kobj_uevent_env *env) diff --git a/drivers/of/of_private.h b/drivers/of/of_private.h index ff350c8fa7ac..fcc70e74dfe0 100644 --- a/drivers/of/of_private.h +++ b/drivers/of/of_private.h @@ -31,6 +31,6 @@ struct alias_prop { char stem[0]; }; -extern struct mutex of_aliases_mutex; +extern struct mutex of_mutex; extern struct list_head aliases_lookup; #endif /* _LINUX_OF_PRIVATE_H */