From: Jingoo Han <jg1.han@samsung.com>
To: "'Andrew Morton'" <akpm@linux-foundation.org>,
"'LKML'" <linux-kernel@vger.kernel.org>
Cc: "'Richard Purdie'" <rpurdie@rpsys.net>,
"'Jin Park'" <jinyoungp@nvidia.com>,
"'Jingoo Han'" <jg1.han@samsung.com>
Subject: [PATCH 2/3] backlight: aat2870: remove goto out
Date: Mon, 06 Aug 2012 18:32:59 +0900 [thread overview]
Message-ID: <003f01cd73b6$77ce18d0$676a4a70$%han@samsung.com> (raw)
This patch removes goto out, which makes code a bit smaller.
Cc: Jin Park <jinyoungp@nvidia.com>
Cc: Richard Purdie <rpurdie@rpsys.net>
Signed-off-by: Jingoo Han <jg1.han@samsung.com>
---
drivers/video/backlight/aat2870_bl.c | 13 ++++---------
1 files changed, 4 insertions(+), 9 deletions(-)
diff --git a/drivers/video/backlight/aat2870_bl.c b/drivers/video/backlight/aat2870_bl.c
index 7ff7522..619a1e0 100644
--- a/drivers/video/backlight/aat2870_bl.c
+++ b/drivers/video/backlight/aat2870_bl.c
@@ -135,14 +135,12 @@ static int aat2870_bl_probe(struct platform_device *pdev)
if (!pdata) {
dev_err(&pdev->dev, "No platform data\n");
- ret = -ENXIO;
- goto out;
+ return -ENXIO;
}
if (pdev->id != AAT2870_ID_BL) {
dev_err(&pdev->dev, "Invalid device ID, %d\n", pdev->id);
- ret = -EINVAL;
- goto out;
+ return -EINVAL;
}
aat2870_bl = devm_kzalloc(&pdev->dev,
@@ -151,8 +149,7 @@ static int aat2870_bl_probe(struct platform_device *pdev)
if (!aat2870_bl) {
dev_err(&pdev->dev,
"Failed to allocate memory for aat2870 backlight\n");
- ret = -ENOMEM;
- goto out;
+ return -ENOMEM;
}
memset(&props, 0, sizeof(struct backlight_properties));
@@ -163,8 +160,7 @@ static int aat2870_bl_probe(struct platform_device *pdev)
if (IS_ERR(bd)) {
dev_err(&pdev->dev,
"Failed allocate memory for backlight device\n");
- ret = PTR_ERR(bd);
- goto out;
+ return PTR_ERR(bd);
}
aat2870_bl->pdev = pdev;
@@ -201,7 +197,6 @@ static int aat2870_bl_probe(struct platform_device *pdev)
out_bl_dev_unregister:
backlight_device_unregister(bd);
-out:
return ret;
}
--
1.7.1
next reply other threads:[~2012-08-06 9:33 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-06 9:32 Jingoo Han [this message]
2012-08-07 4:36 ` jinyoungp
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='003f01cd73b6$77ce18d0$676a4a70$%han@samsung.com' \
--to=jg1.han@samsung.com \
--cc=akpm@linux-foundation.org \
--cc=jinyoungp@nvidia.com \
--cc=linux-kernel@vger.kernel.org \
--cc=rpurdie@rpsys.net \
/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
all inboxes | Powered by JetHome®