From patchwork Wed Apr 15 10:50:04 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Magnus Damm X-Patchwork-Id: 18337 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n3FAqlhX007219 for ; Wed, 15 Apr 2009 10:52:47 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753262AbZDOKwq (ORCPT ); Wed, 15 Apr 2009 06:52:46 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753180AbZDOKwq (ORCPT ); Wed, 15 Apr 2009 06:52:46 -0400 Received: from wf-out-1314.google.com ([209.85.200.174]:65200 "EHLO wf-out-1314.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753262AbZDOKwp (ORCPT ); Wed, 15 Apr 2009 06:52:45 -0400 Received: by wf-out-1314.google.com with SMTP id 29so3087812wff.4 for ; Wed, 15 Apr 2009 03:52:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:date:message-id :in-reply-to:references:subject; bh=OuG+JtVal78Y7jI1Z7BcapYaFihqTWlzeCPLwnpR2+E=; b=VBERgpiiWzuSSFxtmdVK7ETR6a/cBfHcb2+apF3PwrBZHCow8aaJByAN8w6eJ0ytkI PXRob7eCCCIT0saY/RF8dloN3wv3EOMMKuTJjJiU/wMWWVMBnoCM2tIdWOh3fChaEwsz M4FnC8NxFwVz4qT6QfPLEJMyGG626eOJh6mTg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:date:message-id:in-reply-to:references:subject; b=HFFvRCUpp+H+H6z7hSrX5eUXN/0tzHCkkjnBY5owZ7PcxCZB3S4+re8ltHt/OH11o1 +jELz2MyRQnGr2Kz6SSHm3NSxIo1mK8c4a4WRd3Xvv337c9AQq0tIcWy8KgMln7FQ7wT mZ2CffzHwmuSYNO+sQEfjJu9TRv47gEkH5ukA= Received: by 10.142.50.6 with SMTP id x6mr112332wfx.165.1239792764149; Wed, 15 Apr 2009 03:52:44 -0700 (PDT) Received: from rx1.opensource.se (210.5.32.202.bf.2iij.net [202.32.5.210]) by mx.google.com with ESMTPS id k37sm18985093rvb.4.2009.04.15.03.52.42 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 15 Apr 2009 03:52:43 -0700 (PDT) From: Magnus Damm To: linux-sh@vger.kernel.org Cc: johnstul@us.ibm.com, Magnus Damm , lethal@linux-sh.org, gregkh@suse.de, akpm@linux-foundation.org Date: Wed, 15 Apr 2009 19:50:04 +0900 Message-Id: <20090415105004.29940.25791.sendpatchset@rx1.opensource.se> In-Reply-To: <20090415104956.29940.86548.sendpatchset@rx1.opensource.se> References: <20090415104956.29940.86548.sendpatchset@rx1.opensource.se> Subject: [PATCH 01/05] clocksource: sh_cmt earlytimer support Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org From: Magnus Damm Add Early Platform Driver support to the sh_cmt driver using the earlytimer class. Signed-off-by: Magnus Damm --- drivers/clocksource/sh_cmt.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-sh" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html --- 0016/drivers/clocksource/sh_cmt.c +++ work/drivers/clocksource/sh_cmt.c 2009-01-22 17:30:35.000000000 +0900 @@ -567,9 +567,19 @@ static int sh_cmt_setup(struct sh_cmt_pr static int __devinit sh_cmt_probe(struct platform_device *pdev) { struct sh_cmt_priv *p = platform_get_drvdata(pdev); + struct sh_cmt_config *cfg = pdev->dev.platform_data; int ret; - p = kmalloc(sizeof(*p), GFP_KERNEL); + if (p) { + pr_info("sh_cmt: %s kept as earlytimer\n", cfg->name); + return 0; + } + + if (is_early_platform_device(pdev)) + p = alloc_bootmem(sizeof(*p)); + else + p = kmalloc(sizeof(*p), GFP_KERNEL); + if (p == NULL) { dev_err(&pdev->dev, "failed to allocate driver data\n"); return -ENOMEM; @@ -577,7 +587,10 @@ static int __devinit sh_cmt_probe(struct ret = sh_cmt_setup(p, pdev); if (ret) { - kfree(p); + if (is_early_platform_device(pdev)) + free_bootmem(__pa(p), sizeof(*p)); + else + kfree(p); platform_set_drvdata(pdev, NULL); } @@ -607,6 +620,7 @@ static void __exit sh_cmt_exit(void) platform_driver_unregister(&sh_cmt_device_driver); } +early_platform_init("earlytimer", &sh_cmt_device_driver); module_init(sh_cmt_init); module_exit(sh_cmt_exit);