From patchwork Fri Sep 27 10:47:45 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 2953701 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 611889F288 for ; Fri, 27 Sep 2013 10:48:24 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 50E2C20343 for ; Fri, 27 Sep 2013 10:48:23 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 473D520336 for ; Fri, 27 Sep 2013 10:48:22 +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 1VPVat-0001W6-HF; Fri, 27 Sep 2013 10:48:19 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VPVar-0006iR-2I; Fri, 27 Sep 2013 10:48:17 +0000 Received: from mail-we0-f178.google.com ([74.125.82.178]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VPVao-0006hi-K1 for linux-arm-kernel@lists.infradead.org; Fri, 27 Sep 2013 10:48:15 +0000 Received: by mail-we0-f178.google.com with SMTP id u57so2416542wes.23 for ; Fri, 27 Sep 2013 03:47:52 -0700 (PDT) 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; bh=qOKIRx4ulf9qvyOglHX8rd4L1hmAaq7V4K1R1WI+Zm0=; b=eINjZC7/QDbxQRLzqYPDY8it+p6ebBNdI9IA00CoEhOYIaEp9AbSmYkxFZiMsTOpMe JsaRjFWw9sCGMPre6FWkz3VqelkymR1aFi+BI6uy2TZa6Zu8Di6HHHHYMejqXF+zsDpt n4pU1fWuIz4/+6kqg/I3+vBZpqfGM7fWSxMTtAO2m+fP6e2WU/kdBCtbTA0dYWkoajTk A/s1rtzkFzXNEff8lFtpYvvlyRcr9UTrUg1FPL5mEpkHdMIXMs+WlVHRyctKKFDdw2H1 fsiOW9KiIMfsu3WXB/LTWIifJ3WdDtM7UNNDOzgzlTsEUSvnmhV0E5G0yMNLUHVcBXjl PyDQ== X-Gm-Message-State: ALoCoQngV6KTg7IGXmFMDgE+0AM3+cm0Vsl0Qkg5n2WlW/7t2aPKhw9RYGdNmmOyzB0KEhpyYZU5 X-Received: by 10.180.108.199 with SMTP id hm7mr2038406wib.31.1380278872521; Fri, 27 Sep 2013 03:47:52 -0700 (PDT) Received: from mai.home (AToulouse-654-1-326-179.w86-199.abo.wanadoo.fr. [86.199.213.179]) by mx.google.com with ESMTPSA id eg1sm8937604wib.11.1969.12.31.16.00.00 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 27 Sep 2013 03:47:51 -0700 (PDT) From: Daniel Lezcano To: rob.herring@calxeda.com Subject: [PATCH] ARM: highbank: cpuidle: convert to platform driver Date: Fri, 27 Sep 2013 12:47:45 +0200 Message-Id: <1380278865-27457-1-git-send-email-daniel.lezcano@linaro.org> X-Mailer: git-send-email 1.7.9.5 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130927_064814_814839_C8E125BA X-CRM114-Status: GOOD ( 14.97 ) X-Spam-Score: -2.6 (--) Cc: linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.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=-6.6 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 As the ux500 and the kirkwood driver, make the calxeda driver a platform driver [Compiled only] Signed-off-by: Daniel Lezcano --- arch/arm/mach-highbank/highbank.c | 8 ++++++++ drivers/cpuidle/cpuidle-calxeda.c | 18 ++++++++++++------ 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/arch/arm/mach-highbank/highbank.c b/arch/arm/mach-highbank/highbank.c index 8e63ccd..a78ed62 100644 --- a/arch/arm/mach-highbank/highbank.c +++ b/arch/arm/mach-highbank/highbank.c @@ -25,6 +25,7 @@ #include #include #include +#include #include #include @@ -153,6 +154,10 @@ static struct notifier_block highbank_platform_nb = { .notifier_call = highbank_platform_notifier, }; +static struct platform_device highbank_cpuidle_device = { + .name = "cpuidle-calxeda", +}; + static void __init highbank_init(void) { pm_power_off = highbank_power_off; @@ -162,6 +167,9 @@ static void __init highbank_init(void) bus_register_notifier(&amba_bustype, &highbank_amba_nb); of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); + + if (of_machine_is_compatible("calxeda,highbank")) + platform_device_register(&highbank_cpuidle_device); } static const char *highbank_match[] __initconst = { diff --git a/drivers/cpuidle/cpuidle-calxeda.c b/drivers/cpuidle/cpuidle-calxeda.c index 3460584..7b6105b 100644 --- a/drivers/cpuidle/cpuidle-calxeda.c +++ b/drivers/cpuidle/cpuidle-calxeda.c @@ -23,10 +23,10 @@ #include #include #include -#include #include #include #include +#include #include #include #include @@ -88,11 +88,17 @@ static struct cpuidle_driver calxeda_idle_driver = { .state_count = 2, }; -static int __init calxeda_cpuidle_init(void) +static int __init calxeda_cpuidle_probe(struct platform_device *pdev) { - if (!of_machine_is_compatible("calxeda,highbank")) - return -ENODEV; - return cpuidle_register(&calxeda_idle_driver, NULL); } -module_init(calxeda_cpuidle_init); + +static struct platform_driver calxeda_cpuidle_plat_driver = { + .driver = { + .name = "cpuidle-calxeda", + .owner = THIS_MODULE, + }, + .probe = calxeda_cpuidle_probe, +}; + +module_platform_driver(calxeda_cpuidle_plat_driver);