From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756126AbbJAHTY (ORCPT ); Thu, 1 Oct 2015 03:19:24 -0400 Received: from mail-wi0-f171.google.com ([209.85.212.171]:33246 "EHLO mail-wi0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753402AbbJAHTW (ORCPT ); Thu, 1 Oct 2015 03:19:22 -0400 Date: Thu, 1 Oct 2015 08:19:18 +0100 From: Lee Jones To: Javier Martinez Canillas Cc: linux-kernel@vger.kernel.org, Samuel Ortiz Subject: Re: [PATCH 4/8] mfd: kempld-core: Simplify function return logic Message-ID: <20151001071918.GE3214@x1> References: <1443525968-30899-1-git-send-email-javier@osg.samsung.com> <1443525968-30899-5-git-send-email-javier@osg.samsung.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1443525968-30899-5-git-send-email-javier@osg.samsung.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 29 Sep 2015, Javier Martinez Canillas wrote: > The invoked functions already return zero on success or a negative > errno code so there is no need to open code the logic in the caller. > > Signed-off-by: Javier Martinez Canillas > --- > > drivers/mfd/kempld-core.c | 14 ++------------ > 1 file changed, 2 insertions(+), 12 deletions(-) Applied, thanks. > diff --git a/drivers/mfd/kempld-core.c b/drivers/mfd/kempld-core.c > index 463f4eae20c1..05b924542ee2 100644 > --- a/drivers/mfd/kempld-core.c > +++ b/drivers/mfd/kempld-core.c > @@ -448,7 +448,6 @@ static int kempld_probe(struct platform_device *pdev) > struct device *dev = &pdev->dev; > struct kempld_device_data *pld; > struct resource *ioport; > - int ret; > > pld = devm_kzalloc(dev, sizeof(*pld), GFP_KERNEL); > if (!pld) > @@ -471,11 +470,7 @@ static int kempld_probe(struct platform_device *pdev) > mutex_init(&pld->lock); > platform_set_drvdata(pdev, pld); > > - ret = kempld_detect_device(pld); > - if (ret) > - return ret; > - > - return 0; > + return kempld_detect_device(pld); > } > > static int kempld_remove(struct platform_device *pdev) > @@ -756,7 +751,6 @@ MODULE_DEVICE_TABLE(dmi, kempld_dmi_table); > static int __init kempld_init(void) > { > const struct dmi_system_id *id; > - int ret; > > if (force_device_id[0]) { > for (id = kempld_dmi_table; > @@ -771,11 +765,7 @@ static int __init kempld_init(void) > return -ENODEV; > } > > - ret = platform_driver_register(&kempld_driver); > - if (ret) > - return ret; > - > - return 0; > + return platform_driver_register(&kempld_driver); > } > > static void __exit kempld_exit(void) -- Lee Jones Linaro STMicroelectronics Landing Team Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog