From: SF Markus Elfring <elfring@users.sourceforge.net>
To: Lee Jones <lee.jones@linaro.org>,
Tony Lindgren <tony@atomide.com>,
linux-omap@vger.kernel.org
Cc: LKML <linux-kernel@vger.kernel.org>,
kernel-janitors@vger.kernel.org,
Julia Lawall <julia.lawall@lip6.fr>
Subject: [PATCH 6/6] mfd: smsc-ece1099: Return directly after a function failure in smsc_i2c_probe()
Date: Sun, 26 Jun 2016 15:54:20 +0200 [thread overview]
Message-ID: <7de4f21e-30a2-fab6-204d-890619ccbbe6@users.sourceforge.net> (raw)
In-Reply-To: <e4eaf0b4-e539-b400-c8a2-70f210cee1fa@users.sourceforge.net>
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sun, 26 Jun 2016 14:30:46 +0200
This issue was detected by using the Coccinelle software.
Return directly if a call of the function "devm_regmap_init_i2c"
or "regmap_write" failed.
Delete the jump label "err" then.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/mfd/smsc-ece1099.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/drivers/mfd/smsc-ece1099.c b/drivers/mfd/smsc-ece1099.c
index 2aaf89f..cd18c09 100644
--- a/drivers/mfd/smsc-ece1099.c
+++ b/drivers/mfd/smsc-ece1099.c
@@ -46,10 +46,8 @@ static int smsc_i2c_probe(struct i2c_client *i2c,
}
smsc->regmap = devm_regmap_init_i2c(i2c, &smsc_regmap_config);
- if (IS_ERR(smsc->regmap)) {
- ret = PTR_ERR(smsc->regmap);
- goto err;
- }
+ if (IS_ERR(smsc->regmap))
+ return PTR_ERR(smsc->regmap);
i2c_set_clientdata(i2c, smsc);
smsc->dev = &i2c->dev;
@@ -68,7 +66,7 @@ static int smsc_i2c_probe(struct i2c_client *i2c,
ret = regmap_write(smsc->regmap, SMSC_CLK_CTRL, smsc->clk);
if (ret)
- goto err;
+ return ret;
#ifdef CONFIG_OF
if (i2c->dev.of_node)
@@ -76,7 +74,6 @@ static int smsc_i2c_probe(struct i2c_client *i2c,
NULL, NULL, &i2c->dev);
#endif
-err:
return ret;
}
--
2.9.0
next prev parent reply other threads:[~2016-06-26 13:54 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <566ABCD9.1060404@users.sourceforge.net>
2015-12-29 18:34 ` [PATCH] mfd: twl-core: One function call less in add_numbered_child() after error detection SF Markus Elfring
2016-01-11 8:29 ` Lee Jones
2016-05-15 18:11 ` [PATCH 0/2] mfd: twl-core: Fine-tuning for add_numbered_child() SF Markus Elfring
2016-05-16 6:26 ` [PATCH 1/2] mfd: twl-core: Return directly after a failed platform_device_alloc() in add_numbered_child() SF Markus Elfring
2016-05-16 6:51 ` Julia Lawall
2016-05-16 7:54 ` SF Markus Elfring
2016-05-16 8:07 ` Julia Lawall
2016-05-17 6:00 ` Lee Jones
2016-05-17 14:15 ` SF Markus Elfring
2016-05-16 6:28 ` [PATCH 2/2] mfd: twl-core: Refactoring for add_numbered_child() SF Markus Elfring
2016-06-08 11:14 ` Lee Jones
2016-06-26 13:34 ` [PATCH 0/6] mfd: Fine-tuning for three function implementations SF Markus Elfring
2016-06-26 13:45 ` [PATCH 1/6] mfd: twl-core: Return directly after a failed platform_device_alloc() in add_numbered_child() SF Markus Elfring
2016-06-28 15:02 ` Lee Jones
2016-06-26 13:47 ` [PATCH 2/6] mfd: twl-core: Refactoring for add_numbered_child() SF Markus Elfring
2016-06-28 15:03 ` Lee Jones
2016-06-26 13:48 ` [PATCH 3/6] mfd: dm355evm_msp: Return directly after a failed platform_device_alloc() in add_child() SF Markus Elfring
2016-06-28 15:03 ` Lee Jones
2016-06-26 13:50 ` [PATCH 4/6] mfd: dm355evm_msp: Refactoring for add_child() SF Markus Elfring
2016-06-28 15:07 ` Lee Jones
2016-06-28 15:40 ` SF Markus Elfring
2016-06-28 16:31 ` Lee Jones
2016-06-26 13:51 ` [PATCH 5/6] mfd: smsc-ece1099: Delete an unnecessary variable initialisation in smsc_i2c_probe() SF Markus Elfring
2016-06-28 15:07 ` Lee Jones
2016-06-26 13:54 ` SF Markus Elfring [this message]
2016-06-28 15:08 ` [PATCH 6/6] mfd: smsc-ece1099: Return directly after a function failure " Lee Jones
2016-06-28 15:01 ` [PATCH 0/6] mfd: Fine-tuning for three function implementations 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=7de4f21e-30a2-fab6-204d-890619ccbbe6@users.sourceforge.net \
--to=elfring@users.sourceforge.net \
--cc=julia.lawall@lip6.fr \
--cc=kernel-janitors@vger.kernel.org \
--cc=lee.jones@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=tony@atomide.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).