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: 2953691 Return-Path: X-Original-To: patchwork-linux-pm@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 2C0059F288 for ; Fri, 27 Sep 2013 10:47:57 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2048820348 for ; Fri, 27 Sep 2013 10:47:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0DB3C20336 for ; Fri, 27 Sep 2013 10:47:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751010Ab3I0Kry (ORCPT ); Fri, 27 Sep 2013 06:47:54 -0400 Received: from mail-we0-f172.google.com ([74.125.82.172]:58494 "EHLO mail-we0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750949Ab3I0Krx (ORCPT ); Fri, 27 Sep 2013 06:47:53 -0400 Received: by mail-we0-f172.google.com with SMTP id w61so2443665wes.17 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=NljAbpgTEoZ8FZmMSaUIfQFMQ+A2sK8GiLU8Ie8OPzRl5x0GTRd1UV7Zofa/5V9QAo ZiGiHJZTChclPBQpZLsx3DjXTfJpqdTtFfokLg7b4exr03R9Y2HrXxSipiOEqnmJp71J 0tcDJr3Hts4wg5hQKpt5ElvnFJO4M6D5nBx8HtY8rH2hFwz54OhnN+/cNZFx8UGjcP5R gfHRDDT2Sf5407MMoO7B646hLIfTW5Xc7hbKLL0pHK0rm6YeOXK0idSmKmtPcJmA7UYb 0TyOazBqAcs+ZYZDzC9dXby2/dZhy446qSJAag0r4LEkrqaTb032UADieydcPWicSRPm qyyQ== X-Gm-Message-State: ALoCoQlpyYHx6bldwuxx5OPcvDK1Izcbg5ZZLlirHF5azW3WWjQ94WxJ5hDr1b4nf47qZ98sFqBf 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 Cc: linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org 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 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Spam-Status: No, score=-9.3 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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);