From patchwork Wed Jan 29 16:50:42 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 23884 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pb0-f71.google.com (mail-pb0-f71.google.com [209.85.160.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 6196020300 for ; Wed, 29 Jan 2014 16:51:40 +0000 (UTC) Received: by mail-pb0-f71.google.com with SMTP id jt11sf4472722pbb.2 for ; Wed, 29 Jan 2014 08:51:39 -0800 (PST) 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=vQXXNMmnYzZf5QrNlL4U3x0m1z7flTMoAeHiq1x9sgE=; b=X902RL6eZBh0PXlEdoOBwjHCnlbE2CD8Ndynbr+HufjZGTKIAV2bhzmVR6G1SGN7ZY S2xFiom9tTmTvmx5m0q2/JTEg1Jqv7u45Q1WEr03BTIbbFP+1m+FeqIxIJm5o1EPhkLZ E+gIz4+bQTTwtGxIFNkjNuKkO7tRGlw4prRBokBDg9RiTS4WjgtCuJnO2m38aHJXtrAY tbBTrVLoNwWxYhILn6XJjB/hxnbTGIGAJTZSVJAumbHvNEBNfrAw3F4/4AS/U9ZbBtr0 VPrk3leVv+BsDm6TGEjdnyvEESE2XWiYjOM5nM+L3y962qEABUhGdc4f8rMhP41jFc40 GwGQ== X-Gm-Message-State: ALoCoQmfbRqff2Hjfb/+OYH6OOwaeyb+5YOQry/ENtArq9eeHinUiQ0d8zQL2IOg6wyhjrle59pS X-Received: by 10.66.218.70 with SMTP id pe6mr3270780pac.33.1391014299674; Wed, 29 Jan 2014 08:51:39 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.34.76 with SMTP id k70ls174145qgk.30.gmail; Wed, 29 Jan 2014 08:51:39 -0800 (PST) X-Received: by 10.52.185.196 with SMTP id fe4mr1012737vdc.27.1391014299392; Wed, 29 Jan 2014 08:51:39 -0800 (PST) Received: from mail-ve0-f180.google.com (mail-ve0-f180.google.com [209.85.128.180]) by mx.google.com with ESMTPS id j5si964388vcg.89.2014.01.29.08.51.39 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 29 Jan 2014 08:51:39 -0800 (PST) Received-SPF: neutral (google.com: 209.85.128.180 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.180; Received: by mail-ve0-f180.google.com with SMTP id db12so1400863veb.11 for ; Wed, 29 Jan 2014 08:51:39 -0800 (PST) X-Received: by 10.52.116.71 with SMTP id ju7mr1550804vdb.31.1391014298255; Wed, 29 Jan 2014 08:51:38 -0800 (PST) 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.220.174.196 with SMTP id u4csp128165vcz; Wed, 29 Jan 2014 08:51:37 -0800 (PST) X-Received: by 10.68.37.42 with SMTP id v10mr8962308pbj.127.1391014297201; Wed, 29 Jan 2014 08:51:37 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id gx4si3272889pbc.171.2014.01.29.08.51.36; Wed, 29 Jan 2014 08:51:36 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753156AbaA2QvQ (ORCPT + 27 others); Wed, 29 Jan 2014 11:51:16 -0500 Received: from mail-ee0-f53.google.com ([74.125.83.53]:56833 "EHLO mail-ee0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752758AbaA2QvK (ORCPT ); Wed, 29 Jan 2014 11:51:10 -0500 Received: by mail-ee0-f53.google.com with SMTP id t10so1023915eei.26 for ; Wed, 29 Jan 2014 08:51:09 -0800 (PST) X-Received: by 10.15.93.203 with SMTP id w51mr10854742eez.33.1391014269609; Wed, 29 Jan 2014 08:51:09 -0800 (PST) Received: from ards-macbook-pro.local (cag06-7-83-153-85-71.fbx.proxad.net. [83.153.85.71]) by mx.google.com with ESMTPSA id m1sm10892118een.7.2014.01.29.08.51.03 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 29 Jan 2014 08:51:08 -0800 (PST) From: Ard Biesheuvel To: linux-kernel@vger.kernel.org Cc: catalin.marinas@arm.com, will.deacon@arm.com, tglx@linutronix.de, mingo@redhat.com, hpa@zytor.com, x86@kernel.org, gregkh@linuxfoundation.org, akpm@linux-foundation.org, arnd@arndb.de, linux-arm-kernel@lists.infradead.org, Ard Biesheuvel Subject: [PATCH 1/5] cpu: move arch_cpu_uevent() to generic code Date: Wed, 29 Jan 2014 17:50:42 +0100 Message-Id: <1391014246-9715-2-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1391014246-9715-1-git-send-email-ard.biesheuvel@linaro.org> References: <1391014246-9715-1-git-send-email-ard.biesheuvel@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: ard.biesheuvel@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.180 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) 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: , Only x86 implements arch_cpu_uevent(), and there is nothing arch specific about it, so move it to drivers/base/cpu.c and rename it to cpu_uevent(). Signed-off-by: Ard Biesheuvel --- arch/x86/kernel/cpu/match.c | 11 ----------- drivers/base/cpu.c | 15 ++++++++++++++- include/linux/cpu.h | 1 - 3 files changed, 14 insertions(+), 13 deletions(-) diff --git a/arch/x86/kernel/cpu/match.c b/arch/x86/kernel/cpu/match.c index 36565373af87..ab6082a9020e 100644 --- a/arch/x86/kernel/cpu/match.c +++ b/arch/x86/kernel/cpu/match.c @@ -78,14 +78,3 @@ ssize_t arch_print_cpu_modalias(struct device *dev, *buf++ = '\n'; return buf - bufptr; } - -int arch_cpu_uevent(struct device *dev, struct kobj_uevent_env *env) -{ - char *buf = kzalloc(PAGE_SIZE, GFP_KERNEL); - if (buf) { - arch_print_cpu_modalias(NULL, NULL, buf); - add_uevent_var(env, "MODALIAS=%s", buf); - kfree(buf); - } - return 0; -} diff --git a/drivers/base/cpu.c b/drivers/base/cpu.c index f48370dfc908..270649012e64 100644 --- a/drivers/base/cpu.c +++ b/drivers/base/cpu.c @@ -286,6 +286,19 @@ static void cpu_device_release(struct device *dev) */ } +#ifdef CONFIG_ARCH_HAS_CPU_AUTOPROBE +static int cpu_uevent(struct device *dev, struct kobj_uevent_env *env) +{ + char *buf = kzalloc(PAGE_SIZE, GFP_KERNEL); + if (buf) { + arch_print_cpu_modalias(NULL, NULL, buf); + add_uevent_var(env, "MODALIAS=%s", buf); + kfree(buf); + } + return 0; +} +#endif + /* * register_cpu - Setup a sysfs device for a CPU. * @cpu - cpu->hotpluggable field set to 1 will generate a control file in @@ -307,7 +320,7 @@ int register_cpu(struct cpu *cpu, int num) cpu->dev.offline = !cpu_online(num); cpu->dev.of_node = of_get_cpu_node(num, NULL); #ifdef CONFIG_ARCH_HAS_CPU_AUTOPROBE - cpu->dev.bus->uevent = arch_cpu_uevent; + cpu->dev.bus->uevent = cpu_uevent; #endif cpu->dev.groups = common_cpu_attr_groups; if (cpu->hotpluggable) diff --git a/include/linux/cpu.h b/include/linux/cpu.h index 03e235ad1bba..dcc4a0d9c45f 100644 --- a/include/linux/cpu.h +++ b/include/linux/cpu.h @@ -47,7 +47,6 @@ extern ssize_t arch_cpu_release(const char *, size_t); struct notifier_block; #ifdef CONFIG_ARCH_HAS_CPU_AUTOPROBE -extern int arch_cpu_uevent(struct device *dev, struct kobj_uevent_env *env); extern ssize_t arch_print_cpu_modalias(struct device *dev, struct device_attribute *attr, char *bufptr);