From patchwork Wed Sep 23 07:09:08 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans-Christian Egtvedt X-Patchwork-Id: 34118 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from mail-yx0-f158.google.com (mail-yx0-f158.google.com [209.85.210.158]) by ozlabs.org (Postfix) with ESMTP id 5ED82B7B72 for ; Wed, 23 Sep 2009 17:09:50 +1000 (EST) Received: by yxe30 with SMTP id 30so567790yxe.29 for ; Wed, 23 Sep 2009 00:09:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=beta; h=domainkey-signature:received:received:x-sender:x-apparently-to :received:received:received:received-spf:received:date:from:to:cc :subject:message-id:in-reply-to:references:organization:x-mailer :mime-version:content-type:content-transfer-encoding:reply-to:sender :precedence:x-google-loop:mailing-list:list-id:list-post:list-help :list-unsubscribe:x-beenthere-env:x-beenthere; bh=hEL7Dom5O7kzItMsPX5k4ShxCoBoUx3w/QrFXC0/UFo=; b=hCdhHruaBmMpKkuhXPskNGTEIior4KbVhgEOgnuO/CIB9O6GWnzc1tK9g1CyTmTN1S fNFaNTWii7k9Cq0l/KDiMt1yJIUOqKwJUDj9XVj7JB8ygQBRH0/u5sIVG1GnIpvgrTO5 AqiPd/hxAQDDG+iBy3sM8gjuGanvRLoYmbhVE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlegroups.com; s=beta; h=x-sender:x-apparently-to:received-spf:authentication-results:date :from:to:cc:subject:message-id:in-reply-to:references:organization :x-mailer:mime-version:content-type:content-transfer-encoding :reply-to:sender:precedence:x-google-loop:mailing-list:list-id :list-post:list-help:list-unsubscribe:x-beenthere-env:x-beenthere; b=gP5Z/dOw2ZctXk3tRUhBV81NKStKoA1JuAL9bNIinqICbBnec2QjDdCPZoznTOqx/k OAYsN/qdEIYf9YsmHI/Pwxz1psMumWZeuC02sj9DWt9b2lnafjRJ2OjsnnkZmlbq2b2f KEKf3xl1i8zuT9LgFjsC2MPfarCK417RRLJ3g= Received: by 10.100.249.2 with SMTP id w2mr221003anh.31.1253689786734; Wed, 23 Sep 2009 00:09:46 -0700 (PDT) Received: by 10.177.128.16 with SMTP id f16gr2889yqn.0; Wed, 23 Sep 2009 00:09:46 -0700 (PDT) X-Sender: hans-christian.egtvedt@atmel.com X-Apparently-To: rtc-linux@googlegroups.com Received: by 10.211.153.19 with SMTP id f19mr257709ebo.8.1253689786187; Wed, 23 Sep 2009 00:09:46 -0700 (PDT) Received: by 10.211.153.19 with SMTP id f19mr257708ebo.8.1253689786161; Wed, 23 Sep 2009 00:09:46 -0700 (PDT) Received: from relay.atmel.no (relay.atmel.no [80.232.32.139]) by gmr-mx.google.com with ESMTP id 15si137130ewy.0.2009.09.23.00.09.45; Wed, 23 Sep 2009 00:09:46 -0700 (PDT) Received-SPF: pass (google.com: domain of hans-christian.egtvedt@atmel.com designates 80.232.32.139 as permitted sender) client-ip=80.232.32.139; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of hans-christian.egtvedt@atmel.com designates 80.232.32.139 as permitted sender) smtp.mail=hans-christian.egtvedt@atmel.com Received: from hcegtvedt.norway.atmel.com (dhcp-252-083.norway.atmel.com [10.191.252.83]) by relay.atmel.no (8.13.4/8.13.4) with ESMTP id n8N77pU3022193; Wed, 23 Sep 2009 09:07:51 +0200 (CEST) (envelope-from hans-christian.egtvedt@atmel.com) Date: Wed, 23 Sep 2009 09:09:08 +0200 From: Hans-Christian Egtvedt To: Alessandro Zummo Cc: Andrew Morton , Hans-Christian Egtvedt , Thomas Bogendoerfer , Andrew Sharp , Atsushi Nemoto , Alexander Bigga , Mark Zhan , Thomas Hommel , Paul Mundt , Raphael Assenat , Russell King , Subject: [rtc-linux] Re: [PATCH] fix driver data issues in several rtc drivers Message-ID: <20090923090908.7347fdf4@hcegtvedt.norway.atmel.com> In-Reply-To: <20090922223610.1195b9ab@i1501.lan.towertech.it> References: <20090922223610.1195b9ab@i1501.lan.towertech.it> Organization: Atmel X-Mailer: Claws Mail 3.7.2 (GTK+ 2.17.11; i486-pc-linux-gnu) Mime-Version: 1.0 Reply-To: rtc-linux@googlegroups.com Sender: rtc-linux@googlegroups.com Precedence: bulk X-Google-Loop: groups Mailing-List: list rtc-linux@googlegroups.com; contact rtc-linux+owner@googlegroups.com List-Id: List-Post: List-Help: List-Unsubscribe: , X-BeenThere-Env: rtc-linux@googlegroups.com X-BeenThere: rtc-linux@googlegroups.com On Tue, 22 Sep 2009 22:36:10 +0200 Alessandro Zummo wrote: > > Herton Ronaldo Krzesinski recently raised up, and fixed, > an issue with the rtc_cmos driver, which was referring > to an inconsistent driver data. > > I have checked every single driver and fixed similar > bugs. Driver authors are advised to verify my corrections. > Thanks for the fix for at32ap700x rtc, I've modified it a bit to also include a quick cleanup if a later call fails. > While the bug it's not easy to trigger, it would be fine > if we can get this fix in the kernel asap. The patch is against > latest git. > > Signed-off-by: Alessandro Zummo From 42d244ca330c2f2e1e20407ea9d9212c78e05a83 Mon Sep 17 00:00:00 2001 From: Hans-Christian Egtvedt Date: Wed, 23 Sep 2009 09:03:17 +0200 Subject: [PATCH 1/1] fix driver data issues in at32ap700x rtc driver Register the rtc struct in platform driver data before registering the rtc. Signed-off-by: Alessandro Zummo Signed-off-by: Hans-Christian Egtvedt --- drivers/rtc/rtc-at32ap700x.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/drivers/rtc/rtc-at32ap700x.c b/drivers/rtc/rtc-at32ap700x.c index e1ec33e..8825695 100644 --- a/drivers/rtc/rtc-at32ap700x.c +++ b/drivers/rtc/rtc-at32ap700x.c @@ -256,6 +256,8 @@ static int __init at32_rtc_probe(struct platform_device *pdev) goto out_iounmap; } + platform_set_drvdata(pdev, rtc); + rtc->rtc = rtc_device_register(pdev->name, &pdev->dev, &at32_rtc_ops, THIS_MODULE); if (IS_ERR(rtc->rtc)) { @@ -264,7 +266,6 @@ static int __init at32_rtc_probe(struct platform_device *pdev) goto out_free_irq; } - platform_set_drvdata(pdev, rtc); device_init_wakeup(&pdev->dev, 1); dev_info(&pdev->dev, "Atmel RTC for AT32AP700x at %08lx irq %ld\n", @@ -273,6 +274,7 @@ static int __init at32_rtc_probe(struct platform_device *pdev) return 0; out_free_irq: + platform_set_drvdata(pdev, NULL); free_irq(irq, rtc); out_iounmap: iounmap(rtc->regs);