Commit d8498df1 authored by Javier Martinez Canillas's avatar Javier Martinez Canillas Committed by Lee Jones

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: default avatarJavier Martinez Canillas <javier@osg.samsung.com>
Signed-off-by: default avatarLee Jones <lee.jones@linaro.org>
parent e7238fd2
...@@ -448,7 +448,6 @@ static int kempld_probe(struct platform_device *pdev) ...@@ -448,7 +448,6 @@ static int kempld_probe(struct platform_device *pdev)
struct device *dev = &pdev->dev; struct device *dev = &pdev->dev;
struct kempld_device_data *pld; struct kempld_device_data *pld;
struct resource *ioport; struct resource *ioport;
int ret;
pld = devm_kzalloc(dev, sizeof(*pld), GFP_KERNEL); pld = devm_kzalloc(dev, sizeof(*pld), GFP_KERNEL);
if (!pld) if (!pld)
...@@ -471,11 +470,7 @@ static int kempld_probe(struct platform_device *pdev) ...@@ -471,11 +470,7 @@ static int kempld_probe(struct platform_device *pdev)
mutex_init(&pld->lock); mutex_init(&pld->lock);
platform_set_drvdata(pdev, pld); platform_set_drvdata(pdev, pld);
ret = kempld_detect_device(pld); return kempld_detect_device(pld);
if (ret)
return ret;
return 0;
} }
static int kempld_remove(struct platform_device *pdev) static int kempld_remove(struct platform_device *pdev)
...@@ -756,7 +751,6 @@ MODULE_DEVICE_TABLE(dmi, kempld_dmi_table); ...@@ -756,7 +751,6 @@ MODULE_DEVICE_TABLE(dmi, kempld_dmi_table);
static int __init kempld_init(void) static int __init kempld_init(void)
{ {
const struct dmi_system_id *id; const struct dmi_system_id *id;
int ret;
if (force_device_id[0]) { if (force_device_id[0]) {
for (id = kempld_dmi_table; for (id = kempld_dmi_table;
...@@ -771,11 +765,7 @@ static int __init kempld_init(void) ...@@ -771,11 +765,7 @@ static int __init kempld_init(void)
return -ENODEV; return -ENODEV;
} }
ret = platform_driver_register(&kempld_driver); return platform_driver_register(&kempld_driver);
if (ret)
return ret;
return 0;
} }
static void __exit kempld_exit(void) static void __exit kempld_exit(void)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment