From patchwork Thu May 27 21:28:45 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maurus Cuelenaere X-Patchwork-Id: 53814 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from mail-wy0-f184.google.com (mail-wy0-f184.google.com [74.125.82.184]) by ozlabs.org (Postfix) with ESMTP id 0C490B7D1C for ; Fri, 28 May 2010 07:28:50 +1000 (EST) Received: by mail-wy0-f184.google.com with SMTP id 36sf124829wyb.11 for ; Thu, 27 May 2010 14:28:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=beta; h=domainkey-signature:received:x-beenthere:received:received:received :received:received-spf:received:received:received:message-id:date :from:user-agent:mime-version:to:cc:subject:references:in-reply-to :x-original-authentication-results:x-original-sender:reply-to :precedence:mailing-list:list-id:list-post:list-help:list-archive :sender:list-subscribe:list-unsubscribe:content-type; bh=x5c8RT/4c3X2KVOkXZwYamQxClCIJuGEnqnyvp3JCk8=; b=lgLEJC2FDAxBz3qIpz+c6gyxDu8rf0i2D3FRe9+QUo6aGlDfV9PnyVVJNRBXXk3flM pxIeq3kmDlReiuPSCxON75DJROoeR43DfpswL3blD0+NK2dJUnFIIqhdY46t7Uz5oDwh fgNHmkkNUkuwgwhZXMYJVmRpiWpE0Z/FaXFfU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlegroups.com; s=beta; h=x-beenthere:received-spf:message-id:date:from:user-agent :mime-version:to:cc:subject:references:in-reply-to :x-original-authentication-results:x-original-sender:reply-to :precedence:mailing-list:list-id:list-post:list-help:list-archive :sender:list-subscribe:list-unsubscribe:content-type; b=qHQQLp4r3uKg1lLmbxkkmDw8RzBAQr18T61ny/Hf9u/StwGmxqs8SzQQtiO7/7KtqX D907B8bonSiT8zCmX5rpASlewPhDMMEUYDQpzF9WBIsP7HHSC5y4mz4FROWHKyJukymL lJ4Camd8kzVTO22X5R8b0ClaUwANIiVdK6mfc= Received: by 10.216.231.149 with SMTP id l21mr720429weq.12.1274995730190; Thu, 27 May 2010 14:28:50 -0700 (PDT) X-BeenThere: rtc-linux@googlegroups.com Received: by 10.227.87.4 with SMTP id u4ls1272742wbl.2.p; Thu, 27 May 2010 14:28:48 -0700 (PDT) Received: by 10.213.9.3 with SMTP id j3mr150256ebj.1.1274995728135; Thu, 27 May 2010 14:28:48 -0700 (PDT) Received: by 10.213.9.3 with SMTP id j3mr150255ebj.1.1274995728105; Thu, 27 May 2010 14:28:48 -0700 (PDT) Received: from ey-out-1920.google.com (ey-out-1920.google.com [74.125.78.146]) by gmr-mx.google.com with ESMTP id 18si93521ewy.4.2010.05.27.14.28.47; Thu, 27 May 2010 14:28:47 -0700 (PDT) Received-SPF: pass (google.com: domain of mcuelenaere@gmail.com designates 74.125.78.146 as permitted sender) client-ip=74.125.78.146; Received: by ey-out-1920.google.com with SMTP id 5so43196eyb.16 for ; Thu, 27 May 2010 14:28:47 -0700 (PDT) Received: by 10.213.33.135 with SMTP id h7mr1511317ebd.26.1274995726949; Thu, 27 May 2010 14:28:46 -0700 (PDT) Received: from [192.168.1.105] (d54C4B918.access.telenet.be [84.196.185.24]) by mx.google.com with ESMTPS id 15sm854772ewy.0.2010.05.27.14.28.46 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 27 May 2010 14:28:46 -0700 (PDT) Message-ID: <4BFEE40D.4030807@gmail.com> Date: Thu, 27 May 2010 23:28:45 +0200 From: Maurus Cuelenaere User-Agent: Mozilla/5.0 (X11; U; Linux i686; nl; rv:1.9.1.9) Gecko/20100317 Lightning/1.0b1 Thunderbird/3.0.4 MIME-Version: 1.0 To: rtc-linux@googlegroups.com, linux-samsung-soc@vger.kernel.org CC: ben-linux@fluff.org, a.zummo@towertech.it, p_gortmaker@yahoo.com, Jiri.Pinkava@vscht.cz, akpm@linux-foundation.org Subject: [rtc-linux] [PATCH 1/2] RTC: s3c: Initialize driver data before using it References: In-Reply-To: X-Original-Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of mcuelenaere@gmail.com designates 74.125.78.146 as permitted sender) smtp.mail=mcuelenaere@gmail.com; dkim=pass (test mode) header.i=@gmail.com X-Original-Sender: mcuelenaere@gmail.com Reply-To: rtc-linux@googlegroups.com Precedence: list Mailing-list: list rtc-linux@googlegroups.com; contact rtc-linux+owners@googlegroups.com List-ID: List-Post: , List-Help: , List-Archive: Sender: rtc-linux@googlegroups.com List-Subscribe: , List-Unsubscribe: , s3c_rtc_setfreq() uses the platform driver data to derive struct rtc_device, so make sure drvdata is set _before_ s3c_rtc_setfreq() is called. Signed-off-by: Maurus Cuelenaere --- drivers/rtc/rtc-s3c.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/rtc/rtc-s3c.c b/drivers/rtc/rtc-s3c.c index e5972b2..6adebf3 100644 --- a/drivers/rtc/rtc-s3c.c +++ b/drivers/rtc/rtc-s3c.c @@ -495,8 +495,6 @@ static int __devinit s3c_rtc_probe(struct platform_device *pdev) pr_debug("s3c2410_rtc: RTCCON=%02x\n", readb(s3c_rtc_base + S3C2410_RTCCON)); - s3c_rtc_setfreq(&pdev->dev, 1); - device_init_wakeup(&pdev->dev, 1); /* register RTC and exit */ @@ -518,6 +516,9 @@ static int __devinit s3c_rtc_probe(struct platform_device *pdev) s3c_rtc_cpu_type = platform_get_device_id(pdev)->driver_data; platform_set_drvdata(pdev, rtc); + + s3c_rtc_setfreq(&pdev->dev, 1); + return 0; err_nortc: