From: Lee Jones <lee.jones@linaro.org>
To: Javier Martinez Canillas <javier@osg.samsung.com>
Cc: linux-kernel@vger.kernel.org, Samuel Ortiz <sameo@linux.intel.com>
Subject: Re: [PATCH 4/8] mfd: kempld-core: Simplify function return logic
Date: Thu, 1 Oct 2015 08:19:18 +0100 [thread overview]
Message-ID: <20151001071918.GE3214@x1> (raw)
In-Reply-To: <1443525968-30899-5-git-send-email-javier@osg.samsung.com>
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 <javier@osg.samsung.com>
> ---
>
> 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
next prev parent reply other threads:[~2015-10-01 7:19 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-29 11:26 [PATCH 0/8] mfd: Simplify return logic Javier Martinez Canillas
2015-09-29 11:26 ` [PATCH 1/8] mfd: htc-i2cpld: Remove unneded ret variable Javier Martinez Canillas
2015-10-01 7:17 ` Lee Jones
2015-09-29 11:26 ` [PATCH 2/8] mfd: arizona: " Javier Martinez Canillas
2015-09-29 11:24 ` Charles Keepax
2015-10-01 7:18 ` Lee Jones
2015-09-29 11:26 ` [PATCH 3/8] mfd: pcf50633: " Javier Martinez Canillas
2015-10-01 7:18 ` Lee Jones
2015-09-29 11:26 ` [PATCH 4/8] mfd: kempld-core: Simplify function return logic Javier Martinez Canillas
2015-10-01 7:19 ` Lee Jones [this message]
2015-09-29 11:26 ` [PATCH 5/8] mfd: rtsx: " Javier Martinez Canillas
2015-10-01 7:19 ` Lee Jones
2015-09-29 11:26 ` [PATCH 6/8] mfd: da903x: " Javier Martinez Canillas
2015-09-29 12:24 ` Opensource [Adam Thomson]
2015-10-01 7:20 ` Lee Jones
2015-09-29 11:26 ` [PATCH 7/8] mfd: da9052: " Javier Martinez Canillas
2015-09-29 12:24 ` Opensource [Adam Thomson]
2015-10-01 7:20 ` Lee Jones
2015-09-29 11:26 ` [PATCH 8/8] mfd: lm3533: " Javier Martinez Canillas
2015-09-30 21:04 ` Johan Hovold
2015-09-30 21:41 ` Javier Martinez Canillas
2015-09-30 21:55 ` Johan Hovold
2015-10-01 7:17 ` Lee Jones
2015-10-01 17:59 ` Johan Hovold
2015-10-01 7:21 ` Lee Jones
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20151001071918.GE3214@x1 \
--to=lee.jones@linaro.org \
--cc=javier@osg.samsung.com \
--cc=linux-kernel@vger.kernel.org \
--cc=sameo@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).