From patchwork Wed May 29 06:58:03 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guennadi Liakhovetski X-Patchwork-Id: 2627991 Return-Path: X-Original-To: patchwork-linux-mmc@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 932883FC23 for ; Wed, 29 May 2013 06:58:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935022Ab3E2G6T (ORCPT ); Wed, 29 May 2013 02:58:19 -0400 Received: from moutng.kundenserver.de ([212.227.126.171]:51584 "EHLO moutng.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933908Ab3E2G6T (ORCPT ); Wed, 29 May 2013 02:58:19 -0400 Received: from axis700.grange (dslb-088-076-029-116.pools.arcor-ip.net [88.76.29.116]) by mrelayeu.kundenserver.de (node=mreu3) with ESMTP (Nemesis) id 0Mgltb-1V2q4a2Hfr-00O0WS; Wed, 29 May 2013 08:58:03 +0200 Received: by axis700.grange (Postfix, from userid 1000) id 3017640BB4; Wed, 29 May 2013 08:58:03 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by axis700.grange (Postfix) with ESMTP id 2D31D40BB3; Wed, 29 May 2013 08:58:03 +0200 (CEST) Date: Wed, 29 May 2013 08:58:03 +0200 (CEST) From: Guennadi Liakhovetski X-X-Sender: lyakh@axis700.grange To: Wei Yongjun cc: ian@mnementh.co.uk, cjb@laptop.org, grant.likely@linaro.org, rob.herring@calxeda.com, yongjun_wei@trendmicro.com.cn, linux-mmc@vger.kernel.org, devicetree-discuss@lists.ozlabs.org Subject: Re: [PATCH] mmc: sh_mobile_sdhi: fix error return code in sh_mobile_sdhi_probe() In-Reply-To: Message-ID: References: MIME-Version: 1.0 X-Provags-ID: V02:K0:xJUwJfx1lS8JIBCkrGxwZRlTQB6dBFb3jqqhEsa0piB tXC6euG/uayEJgSxIpVTKceDOfHVzpBcNBO1IQfe00J1HNuCZ7 wo9JfFgM6e+kr0QENdH4gsho9e2n1hQmgMVp3RcWBVHtCEwTnR sSHT2GDF22EAPBr/JuLjJ4dubrIlmbU/CD9eNpeyT3T0rJwJFF pj9vY3mybhaYks70RjWv318D+5dDRIjzGkMA6y8WSjtRFKFcSk kY9nT24KGF1RVxlUGcZXJbR9DruwXhtj7oFiSX+jQqbbmeLQyq hDVrO/lCJFuSqFkYSQXxHZE8W9xGH6p7g6JeEEVwxhtH/MEcX0 lS+EW0XVvHRWQcMY7S7Q80MzENknxF4SXfS4w7E75H+pjQwdcU MKeUNlKZfaimA== Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org Hi On Tue, 28 May 2013, Wei Yongjun wrote: > From: Wei Yongjun > > Fix to return a negative error code instead of 0 when we cannot get > IRQ source by platform_get_irq(), as done elsewhere in this function. > > Signed-off-by: Wei Yongjun Thanks for the patch. Do you think the following version would be even a bit simpler? If you agree, maybe you could send a v2 of your patch in this form, I'll ack it then. Thanks Guennadi > --- > drivers/mmc/host/sh_mobile_sdhi.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/drivers/mmc/host/sh_mobile_sdhi.c b/drivers/mmc/host/sh_mobile_sdhi.c > index cc4c872..a4316b3 100644 > --- a/drivers/mmc/host/sh_mobile_sdhi.c > +++ b/drivers/mmc/host/sh_mobile_sdhi.c > @@ -273,8 +273,10 @@ static int sh_mobile_sdhi_probe(struct platform_device *pdev) > } > > /* There must be at least one IRQ source */ > - if (!i) > + if (!i) { > + ret = irq; > goto eirq; > + } > } > > dev_info(&pdev->dev, "%s base at 0x%08lx clock rate %u MHz\n", > Acked-by: Guennadi Liakhovetski --- Guennadi Liakhovetski, Ph.D. Freelance Open-Source Software Developer http://www.open-technology.de/ -- To unsubscribe from this list: send the line "unsubscribe linux-mmc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/mmc/host/sh_mobile_sdhi.c b/drivers/mmc/host/sh_mobile_sdhi.c index fe90853..76661b6 100644 --- a/drivers/mmc/host/sh_mobile_sdhi.c +++ b/drivers/mmc/host/sh_mobile_sdhi.c @@ -255,18 +255,17 @@ static int sh_mobile_sdhi_probe(struct platform_device *pdev) if (multiplexed_isr) { while (1) { irq = platform_get_irq(pdev, i); - if (irq < 0) - break; + /* There must be at least one IRQ source */ + if (irq < 0) { + ret = irq; + goto eirq; + } i++; ret = devm_request_irq(&pdev->dev, irq, tmio_mmc_irq, 0, dev_name(&pdev->dev), host); if (ret) goto eirq; } - - /* There must be at least one IRQ source */ - if (!i) - goto eirq; } dev_info(&pdev->dev, "%s base at 0x%08lx clock rate %u MHz\n",