Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754185Ab2HAU2Q (ORCPT ); Wed, 1 Aug 2012 16:28:16 -0400 Received: from a83-160-107-163.adsl.xs4all.nl ([83.160.107.163]:38020 "EHLO d4rwin.no-ip.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752452Ab2HAU2P (ORCPT ); Wed, 1 Aug 2012 16:28:15 -0400 X-Greylist: delayed 563 seconds by postgrey-1.27 at vger.kernel.org; Wed, 01 Aug 2012 16:28:15 EDT Date: Wed, 1 Aug 2012 22:18:11 +0200 From: Matthias Kaehlcke To: Venu Byravarasu Cc: a.zummo@towertech.it, sameo@linux.intel.com, broonie@opensource.wolfsonmicro.com, ldewangan@nvidia.com, kyle.manna@fuel7.com, sboyd@codeaurora.org, rtc-linux@googlegroups.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] rtc: tps65910: Add RTC driver for TPS65910 PMIC RTC Message-ID: <20120801201811.GK4701@darwin> Mail-Followup-To: Matthias Kaehlcke , Venu Byravarasu , a.zummo@towertech.it, sameo@linux.intel.com, broonie@opensource.wolfsonmicro.com, ldewangan@nvidia.com, kyle.manna@fuel7.com, sboyd@codeaurora.org, rtc-linux@googlegroups.com, linux-kernel@vger.kernel.org References: <1343802157-13600-1-git-send-email-vbyravarasu@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1343802157-13600-1-git-send-email-vbyravarasu@nvidia.com> Organization: sindominio.net User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2298 Lines: 72 hi, El Wed, Aug 01, 2012 at 11:52:37AM +0530 Venu Byravarasu ha dit: > TPS65910 PMIC is a MFD with RTC as one of the device. > Adding RTC driver for supporting RTC device present > inside TPS65910 PMIC. > > Only support for RTC alarm is implemented as part of this patch. > > Signed-off-by: Venu Byravarasu > --- ... > +static irqreturn_t tps65910_rtc_interrupt(int irq, void *rtc) > +{ > + struct device *dev = rtc; > + unsigned long events = 0; > + struct tps65910 *tps = dev_get_drvdata(dev->parent); > + struct tps65910_rtc *tps_rtc = dev_get_drvdata(dev); > > ... > > +static int __devinit tps65910_rtc_probe(struct platform_device *pdev) > +{ > > ... > > + ret = devm_request_threaded_irq(&pdev->dev, irq, NULL, > + tps65910_rtc_interrupt, IRQF_TRIGGER_LOW, > + "rtc-tps65910", &pdev->dev); > + if (ret < 0) { > + dev_err(&pdev->dev, "IRQ is not free.\n"); > + return ret; > + } > + device_init_wakeup(&pdev->dev, 1); > + > + tps_rtc->rtc = rtc_device_register(pdev->name, &pdev->dev, > + &tps65910_rtc_ops, THIS_MODULE); > + if (IS_ERR(tps_rtc->rtc)) { > + ret = PTR_ERR(tps_rtc->rtc); > + dev_err(&pdev->dev, "RTC device register: err %d\n", ret); > + return ret; > + } > + > + platform_set_drvdata(pdev, tps_rtc); the interrupt should be requested after this call. otherwise tps65910_rtc_interrupt() could be executed before the RTC device is registered and the driver data set. normally this shouldn't happen as the RTC interrupts are disabled after reset, but the interrupts could have been enabled for example by the bootloader best regards -- Matthias Kaehlcke Embedded Linux Developer Amsterdam Anyone who has never made a mistake has never tried anything new (Albert Einstein) .''`. using free software / Debian GNU/Linux | http://debian.org : :' : `. `'` gpg --keyserver pgp.mit.edu --recv-keys 47D8E5D4 `- -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/