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: 3552631 Return-Path: X-Original-To: patchwork-linux-arm@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 49DE79F382 for ; Wed, 29 Jan 2014 16:52:25 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 97A10201C0 for ; Wed, 29 Jan 2014 16:52:20 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2B4F3201BF for ; Wed, 29 Jan 2014 16:52:19 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1W8YMh-0007VS-Sk; Wed, 29 Jan 2014 16:51:52 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1W8YMa-0001Yh-Vy; Wed, 29 Jan 2014 16:51:45 +0000 Received: from mail-ea0-f177.google.com ([209.85.215.177]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1W8YMO-0001Vk-59 for linux-arm-kernel@lists.infradead.org; Wed, 29 Jan 2014 16:51:33 +0000 Received: by mail-ea0-f177.google.com with SMTP id n15so1055924ead.8 for ; Wed, 29 Jan 2014 08:51:09 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=XN+mVzg/niWUCaTIsAUmCT8G1pzvnmfZck7urjaDd0Y=; b=czE1a/bq0Zyq639vevogMs+tFgmoHyKUcKx+v9ZPm5RYh8ykby8O3H+kkUFENZ/Jl+ mjsSJ0JXNzjU1L7cqFBejb/kBvt5Q2bSplD/VCbdYB1B3goglRpW0F75bhH6rqqEAGVT UJAhuCUYDWuti2bH5UeuEcvr0qCq3il9WLSDiHVnVPeIdz3hOOYv+hNNDMaa7DSqEagN LkOehRqPfsr0ZV2rpPIgwCuGH0Kh3GLQTx3VR87AQIw6oecq/6alU30p/vVcUV5PFvWC TcSxHwGEcd3DfneEDlXiz8ef6mFMzgwOYrHxXBEGb4ma5RfW4uGIMKU7W/kThHfSb+L7 jMmw== X-Gm-Message-State: ALoCoQmf+CZ4LqjUFZeg5Oj6DVGLESNv5J492gXc+uytxnmh+hLeHC/v6pQ22MCIQeFAwhgjgnuK 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 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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140129_115132_358108_47D4BA99 X-CRM114-Status: GOOD ( 12.17 ) X-Spam-Score: -2.6 (--) Cc: Ard Biesheuvel , arnd@arndb.de, gregkh@linuxfoundation.org, catalin.marinas@arm.com, x86@kernel.org, will.deacon@arm.com, mingo@redhat.com, hpa@zytor.com, tglx@linutronix.de, akpm@linux-foundation.org, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, 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 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);