From patchwork Mon Jan 6 08:22:10 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 3436361 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 356A3C02DC for ; Mon, 6 Jan 2014 08:23:04 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6843D2018E for ; Mon, 6 Jan 2014 08:23:03 +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 5A40E2018A for ; Mon, 6 Jan 2014 08:23:02 +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 1W05Sc-00062x-5G; Mon, 06 Jan 2014 08:22:58 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1W05SZ-0003Eg-6F; Mon, 06 Jan 2014 08:22:55 +0000 Received: from mail-wi0-f171.google.com ([209.85.212.171]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1W05SV-0003Br-2u for linux-arm-kernel@lists.infradead.org; Mon, 06 Jan 2014 08:22:51 +0000 Received: by mail-wi0-f171.google.com with SMTP id bz8so2493949wib.10 for ; Mon, 06 Jan 2014 00:22:25 -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=VpKw1cQOtRt2Vcldz4Gb/U/JSS7orBmcpoWaNk92+KE=; b=dTHKhO3Z/tKKm0DHMNA5LK7xBY1U11TVfvWlFIQyN7yCaVT8evRprRoc2GRUdWKlKu o7QTw0kRRAFTbC+/YXbjFs0RBoEDMdQgkMLxKwPQsGkNa8HxDhS3PRKlyaDKsdYvNp/l fVu1a1doIbKwu22pEDThSz4P6ISMHh3A8/umwiXHAma9sO4B4vamK/Vhb1bb5LIMerjS kRHpVJezHFtVwSEXtFw6r4WNK/JAq/V55Hy2sh+Kc40wtEwpe+gE2U6qmbCUhCsMlaHI USNpCjgJPEw+Yzc8zJVz2GO/0Mz4BF6cksX8SoomYjmCw5LdVgHKT26IIrhiw/YJo+cG rCRQ== X-Gm-Message-State: ALoCoQnEGiKkdOp431lswcdMSxJpaXc4X7oej+JeKZkG/rT+BriPZvGmx80DXr9pSTXxF3gE0P93 X-Received: by 10.194.104.66 with SMTP id gc2mr284667wjb.75.1388996545592; Mon, 06 Jan 2014 00:22:25 -0800 (PST) Received: from ards-mac-mini.local (cag06-7-83-153-85-71.fbx.proxad.net. [83.153.85.71]) by mx.google.com with ESMTPSA id ci4sm41930498wjc.21.2014.01.06.00.22.24 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 06 Jan 2014 00:22:25 -0800 (PST) From: Ard Biesheuvel To: catalin.marinas@arm.com, will.deacon@arm.com, gregkh@linuxfoundation.org, akpm@linux-foundation.org, hpa@zytor.com, ak@linux.intel.com Subject: [PATCH 2/8] x86: move arch_cpu_uevent() to generic code Date: Mon, 6 Jan 2014 09:22:10 +0100 Message-Id: <1388996536-27014-3-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1388996536-27014-1-git-send-email-ard.biesheuvel@linaro.org> References: <1388996536-27014-1-git-send-email-ard.biesheuvel@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140106_032251_233792_500B8A36 X-CRM114-Status: GOOD ( 11.69 ) X-Spam-Score: -2.6 (--) Cc: Ard Biesheuvel , herbert@gondor.apana.org.au, nico@linaro.org, x86@kernel.org, linux-kernel@vger.kernel.org, mingo@redhat.com, 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.5 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. 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);