From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932616AbcHaLEC (ORCPT ); Wed, 31 Aug 2016 07:04:02 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:32952 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759345AbcHaLD7 (ORCPT ); Wed, 31 Aug 2016 07:03:59 -0400 Date: Wed, 31 Aug 2016 13:04:08 +0200 From: Greg Kroah-Hartman To: Jan Viktorin Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Rob Herring , Pawel Moll , Mark Rutland , Ian Campbell , Kumar Gala , "Hans J. Koch" Subject: Re: [PATCH 2/4] uio: UIO_IRQ_NONE is a valid option for uioinfo->irq Message-ID: <20160831110408.GA21059@kroah.com> References: <1463476940-26791-1-git-send-email-viktorin@rehivetech.com> <1463476940-26791-3-git-send-email-viktorin@rehivetech.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1463476940-26791-3-git-send-email-viktorin@rehivetech.com> User-Agent: Mutt/1.7.0 (2016-08-17) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 17, 2016 at 11:22:18AM +0200, Jan Viktorin wrote: > We can simplify handling of platform_get_irq into one place as it is > acceptable to see UIO_IRQ_NONE instead of a valid IRQ number. Some > devices don't have or don't need any interrupt to be handled. The > same change has been already done for uio_pdrv_genirq. > > Signed-off-by: Jan Viktorin > --- > drivers/uio/uio_dmem_genirq.c | 15 ++++++--------- > 1 file changed, 6 insertions(+), 9 deletions(-) > > diff --git a/drivers/uio/uio_dmem_genirq.c b/drivers/uio/uio_dmem_genirq.c > index e1134a4..945515d 100644 > --- a/drivers/uio/uio_dmem_genirq.c > +++ b/drivers/uio/uio_dmem_genirq.c > @@ -165,13 +165,6 @@ static int uio_dmem_genirq_probe(struct platform_device *pdev) > } > uioinfo->name = pdev->dev.of_node->name; > uioinfo->version = "devicetree"; > - > - /* Multiple IRQs are not supported */ > - irq = platform_get_irq(pdev, 0); > - if (irq == -ENXIO) > - uioinfo->irq = UIO_IRQ_NONE; > - else > - uioinfo->irq = irq; > } > > if (!uioinfo || !uioinfo->name || !uioinfo->version) { > @@ -200,14 +193,18 @@ static int uio_dmem_genirq_probe(struct platform_device *pdev) > priv->pdev = pdev; > mutex_init(&priv->alloc_lock); > > + /* Multiple IRQs are not supported */ > if (!uioinfo->irq) { > ret = platform_get_irq(pdev, 0); > - if (ret < 0) { > + uioinfo->irq = ret; > + if (ret == -ENXIO && pdev->dev.of_node) > + uioinfo->irq = UIO_IRQ_NONE; > + else if (ret < 0) { > dev_err(&pdev->dev, "failed to get IRQ\n"); > goto bad1; > } > - uioinfo->irq = ret; > } > + > uiomem = &uioinfo->mem[0]; > > for (i = 0; i < pdev->num_resources; ++i) { This adds a build warning to the system, always test your patches before you send them out :( Now dropped. greg k-h