Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752349AbdHIRoA (ORCPT ); Wed, 9 Aug 2017 13:44:00 -0400 Received: from mail-wr0-f194.google.com ([209.85.128.194]:38122 "EHLO mail-wr0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751704AbdHIRn7 (ORCPT ); Wed, 9 Aug 2017 13:43:59 -0400 Subject: Re: [PATCH] mtd: spi-nor: cqspi: fix error return code in cqspi_probe() To: "Gustavo A. R. Silva" , Cyrille Pitchen , David Woodhouse , Brian Norris , Boris Brezillon , Richard Weinberger Cc: linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org References: <20170809162204.GA370@embeddedgus> From: Marek Vasut Message-ID: <63cb3b21-f6cb-ae5c-f349-d21c3208e66e@gmail.com> Date: Wed, 9 Aug 2017 19:16:03 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <20170809162204.GA370@embeddedgus> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1238 Lines: 39 On 08/09/2017 06:22 PM, Gustavo A. R. Silva wrote: > platform_get_irq() returns an error code, but the cadence-quadspi > driver ignores it and always returns -ENXIO. This is not correct > and, prevents -EPROBE_DEFER from being propagated properly. > > Print and propagate the return value of platform_get_irq on failure. > > This issue was detected with the help of Coccinelle. > > Signed-off-by: Gustavo A. R. Silva > --- > drivers/mtd/spi-nor/cadence-quadspi.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/mtd/spi-nor/cadence-quadspi.c b/drivers/mtd/spi-nor/cadence-quadspi.c > index 53c7d8e..15dacf5 100644 > --- a/drivers/mtd/spi-nor/cadence-quadspi.c > +++ b/drivers/mtd/spi-nor/cadence-quadspi.c > @@ -1202,8 +1202,8 @@ static int cqspi_probe(struct platform_device *pdev) > /* Obtain IRQ line. */ > irq = platform_get_irq(pdev, 0); > if (irq < 0) { > - dev_err(dev, "Cannot obtain IRQ.\n"); > - return -ENXIO; > + dev_err(dev, "Cannot obtain IRQ: %d\n", irq); "Cannot obtain IRQ, ret=%i\n" please . It's inobvious what the value means otherwise. > + return irq; > } > > ret = clk_prepare_enable(cqspi->clk); > -- Best regards, Marek Vasut