From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nishanth Menon Subject: Re: [PATCH] mtd:elm: Use correct check on return value of pm_runtime_get_sync Date: Wed, 5 Feb 2014 08:17:32 -0600 Message-ID: <52F247FC.9040505@ti.com> References: <1391607760-29826-1-git-send-email-stefan.sorensen@spectralink.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Return-path: Received: from bear.ext.ti.com ([192.94.94.41]:35154 "EHLO bear.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751159AbaBEORi (ORCPT ); Wed, 5 Feb 2014 09:17:38 -0500 In-Reply-To: <1391607760-29826-1-git-send-email-stefan.sorensen@spectralink.com> Sender: linux-omap-owner@vger.kernel.org List-Id: linux-omap@vger.kernel.org To: =?UTF-8?B?U3RlZmFuIFPDuHJlbnNlbg==?= , linux-omap@vger.kernel.org -avinash On 02/05/2014 07:42 AM, Stefan S=C3=B8rensen wrote: > The ELM driver incorrectly reagard any non-zero return value from > pm_runtime_get_sync as an error, but it may return 1 if the device > was already active. Fix to only error when return value is negative. >=20 > Signed-off-by: Stefan S=C3=B8rensen > --- > drivers/mtd/devices/elm.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) >=20 > diff --git a/drivers/mtd/devices/elm.c b/drivers/mtd/devices/elm.c > index d1dd6a3..e2c073c 100644 > --- a/drivers/mtd/devices/elm.c > +++ b/drivers/mtd/devices/elm.c > @@ -380,7 +380,7 @@ static int elm_probe(struct platform_device *pdev= ) > } > =20 > pm_runtime_enable(&pdev->dev); > - if (pm_runtime_get_sync(&pdev->dev)) { > + if (pm_runtime_get_sync(&pdev->dev) < 0) { > ret =3D -EINVAL; > pm_runtime_disable(&pdev->dev); > dev_err(&pdev->dev, "can't enable clock\n"); >=20 Though unrelated to specifically this, elm_resume has a get_sync without error check.. =46urther, you might want to cc the mailing lists generated by =2E/scripts/get_maintainer.pl --=20 Regards, Nishanth Menon -- To unsubscribe from this list: send the line "unsubscribe linux-omap" i= n the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html