summaryrefslogtreecommitdiffstats
path: root/drivers/mfd/kempld-core.c
diff options
context:
space:
mode:
authorJavier Martinez Canillas <javier@osg.samsung.com>2015-09-29 13:26:04 +0200
committerLee Jones <lee.jones@linaro.org>2015-10-30 17:19:43 +0000
commitd8498df1e40e5a232ebe1f1b33edb34887f6a037 (patch)
tree68a89edc51d8c7d01f4247309743622d8efedfe9 /drivers/mfd/kempld-core.c
parente7238fd2554ebfbc2611ae5c7e58d4cd76f276dc (diff)
downloadblackbird-op-linux-d8498df1e40e5a232ebe1f1b33edb34887f6a037.tar.gz
blackbird-op-linux-d8498df1e40e5a232ebe1f1b33edb34887f6a037.zip
mfd: kempld-core: Simplify function return logic
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> Signed-off-by: Lee Jones <lee.jones@linaro.org>
Diffstat (limited to 'drivers/mfd/kempld-core.c')
-rw-r--r--drivers/mfd/kempld-core.c14
1 files changed, 2 insertions, 12 deletions
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)
OpenPOWER on IntegriCloud