From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754704AbcFGJCp (ORCPT ); Tue, 7 Jun 2016 05:02:45 -0400 Received: from mail-wm0-f43.google.com ([74.125.82.43]:37219 "EHLO mail-wm0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752333AbcFGJCk (ORCPT ); Tue, 7 Jun 2016 05:02:40 -0400 Date: Tue, 7 Jun 2016 10:03:12 +0100 From: Lee Jones To: Peter Griffin Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-pwm@vger.kernel.org, kernel@stlinux.com, thierry.reding@gmail.com Subject: Re: [STLinux Kernel] [[PATCH v2] 09/11] pwm: sti: Add support for PWM Capture IRQs Message-ID: <20160607090312.GB18047@dell> References: <1461320295-20414-1-git-send-email-lee.jones@linaro.org> <1461320295-20414-10-git-send-email-lee.jones@linaro.org> <20160607081455.GB22744@griffinp-ThinkPad-X1-Carbon-2nd> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20160607081455.GB22744@griffinp-ThinkPad-X1-Carbon-2nd> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 07 Jun 2016, Peter Griffin wrote: > Hi Lee, > > On Fri, 22 Apr 2016, Lee Jones wrote: > > > Here we're requesting the PWM Capture IRQ and supplying the > > handler which will be called in the event of an IRQ fire to > > handle it. > > > > Signed-off-by: Lee Jones > > --- > > drivers/pwm/pwm-sti.c | 92 ++++++++++++++++++++++++++++++++++++++++++++++++++- > > 1 file changed, 91 insertions(+), 1 deletion(-) > > > > diff --git a/drivers/pwm/pwm-sti.c b/drivers/pwm/pwm-sti.c > > index 9d597bb..2230afb 100644 > > --- a/drivers/pwm/pwm-sti.c > > +++ b/drivers/pwm/pwm-sti.c [...] Please cut any large chunks of unnecessary cruft when reviewing. > > @@ -367,7 +444,7 @@ static int sti_pwm_probe(struct platform_device *pdev) > > struct sti_pwm_chip *pc; > > struct resource *res; > > unsigned int devnum; > > - int ret; > > + int irq, ret; > > > > pc = devm_kzalloc(dev, sizeof(*pc), GFP_KERNEL); > > if (!pc) > > @@ -388,6 +465,19 @@ static int sti_pwm_probe(struct platform_device *pdev) > > if (IS_ERR(pc->regmap)) > > return PTR_ERR(pc->regmap); > > > > + irq = platform_get_irq(pdev, 0); > > + if (irq < 0) { > > + dev_err(&pdev->dev, "Failed to obtain IRQ\n"); > > + return irq; > > + } > > + > > + ret = devm_request_irq(&pdev->dev, irq, sti_pwm_interrupt, > > + 0, pdev->name, pc); > > + if (ret < 0) { > > + dev_err(&pdev->dev, "Failed to request IRQ\n"); > > + return ret; > > + } > > + > > /* > > * Setup PWM data with default values: some values could be replaced > > * with specific ones provided from Device Tree. > > pwm-st.txt dt binding document and pwm example needs updating to document this > irq. Yes, it does. I will update the documentation and place it into this patch-set on next submission. -- Lee Jones Linaro STMicroelectronics Landing Team Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog