diff options
Diffstat (limited to 'drivers')
| -rw-r--r-- | drivers/devfreq/devfreq.c | 4 | ||||
| -rw-r--r-- | drivers/devfreq/exynos/exynos5_bus.c | 31 |
2 files changed, 11 insertions, 24 deletions
diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c index c99c00d35d34..22e5d2ffebd8 100644 --- a/drivers/devfreq/devfreq.c +++ b/drivers/devfreq/devfreq.c | |||
| @@ -993,10 +993,10 @@ static int __init devfreq_init(void) | |||
| 993 | } | 993 | } |
| 994 | 994 | ||
| 995 | devfreq_wq = create_freezable_workqueue("devfreq_wq"); | 995 | devfreq_wq = create_freezable_workqueue("devfreq_wq"); |
| 996 | if (IS_ERR(devfreq_wq)) { | 996 | if (!devfreq_wq) { |
| 997 | class_destroy(devfreq_class); | 997 | class_destroy(devfreq_class); |
| 998 | pr_err("%s: couldn't create workqueue\n", __FILE__); | 998 | pr_err("%s: couldn't create workqueue\n", __FILE__); |
| 999 | return PTR_ERR(devfreq_wq); | 999 | return -ENOMEM; |
| 1000 | } | 1000 | } |
| 1001 | devfreq_class->dev_groups = devfreq_groups; | 1001 | devfreq_class->dev_groups = devfreq_groups; |
| 1002 | 1002 | ||
diff --git a/drivers/devfreq/exynos/exynos5_bus.c b/drivers/devfreq/exynos/exynos5_bus.c index 574b16b59be5..04c164eecf25 100644 --- a/drivers/devfreq/exynos/exynos5_bus.c +++ b/drivers/devfreq/exynos/exynos5_bus.c | |||
| @@ -18,7 +18,6 @@ | |||
| 18 | #include <linux/opp.h> | 18 | #include <linux/opp.h> |
| 19 | #include <linux/slab.h> | 19 | #include <linux/slab.h> |
| 20 | #include <linux/suspend.h> | 20 | #include <linux/suspend.h> |
| 21 | #include <linux/opp.h> | ||
| 22 | #include <linux/clk.h> | 21 | #include <linux/clk.h> |
| 23 | #include <linux/delay.h> | 22 | #include <linux/delay.h> |
| 24 | #include <linux/platform_device.h> | 23 | #include <linux/platform_device.h> |
| @@ -351,20 +350,18 @@ static int exynos5_busfreq_int_probe(struct platform_device *pdev) | |||
| 351 | 350 | ||
| 352 | err = exynos5250_init_int_tables(data); | 351 | err = exynos5250_init_int_tables(data); |
| 353 | if (err) | 352 | if (err) |
| 354 | goto err_regulator; | 353 | return err; |
| 355 | 354 | ||
| 356 | data->vdd_int = regulator_get(dev, "vdd_int"); | 355 | data->vdd_int = devm_regulator_get(dev, "vdd_int"); |
| 357 | if (IS_ERR(data->vdd_int)) { | 356 | if (IS_ERR(data->vdd_int)) { |
| 358 | dev_err(dev, "Cannot get the regulator \"vdd_int\"\n"); | 357 | dev_err(dev, "Cannot get the regulator \"vdd_int\"\n"); |
| 359 | err = PTR_ERR(data->vdd_int); | 358 | return PTR_ERR(data->vdd_int); |
| 360 | goto err_regulator; | ||
| 361 | } | 359 | } |
| 362 | 360 | ||
| 363 | data->int_clk = clk_get(dev, "int_clk"); | 361 | data->int_clk = devm_clk_get(dev, "int_clk"); |
| 364 | if (IS_ERR(data->int_clk)) { | 362 | if (IS_ERR(data->int_clk)) { |
| 365 | dev_err(dev, "Cannot get clock \"int_clk\"\n"); | 363 | dev_err(dev, "Cannot get clock \"int_clk\"\n"); |
| 366 | err = PTR_ERR(data->int_clk); | 364 | return PTR_ERR(data->int_clk); |
| 367 | goto err_clock; | ||
| 368 | } | 365 | } |
| 369 | 366 | ||
| 370 | rcu_read_lock(); | 367 | rcu_read_lock(); |
| @@ -374,8 +371,7 @@ static int exynos5_busfreq_int_probe(struct platform_device *pdev) | |||
| 374 | rcu_read_unlock(); | 371 | rcu_read_unlock(); |
| 375 | dev_err(dev, "Invalid initial frequency %lu kHz.\n", | 372 | dev_err(dev, "Invalid initial frequency %lu kHz.\n", |
| 376 | exynos5_devfreq_int_profile.initial_freq); | 373 | exynos5_devfreq_int_profile.initial_freq); |
| 377 | err = PTR_ERR(opp); | 374 | return PTR_ERR(opp); |
| 378 | goto err_opp_add; | ||
| 379 | } | 375 | } |
| 380 | initial_freq = opp_get_freq(opp); | 376 | initial_freq = opp_get_freq(opp); |
| 381 | initial_volt = opp_get_voltage(opp); | 377 | initial_volt = opp_get_voltage(opp); |
| @@ -385,12 +381,12 @@ static int exynos5_busfreq_int_probe(struct platform_device *pdev) | |||
| 385 | err = clk_set_rate(data->int_clk, initial_freq * 1000); | 381 | err = clk_set_rate(data->int_clk, initial_freq * 1000); |
| 386 | if (err) { | 382 | if (err) { |
| 387 | dev_err(dev, "Failed to set initial frequency\n"); | 383 | dev_err(dev, "Failed to set initial frequency\n"); |
| 388 | goto err_opp_add; | 384 | return err; |
| 389 | } | 385 | } |
| 390 | 386 | ||
| 391 | err = exynos5_int_setvolt(data, initial_volt); | 387 | err = exynos5_int_setvolt(data, initial_volt); |
| 392 | if (err) | 388 | if (err) |
| 393 | goto err_opp_add; | 389 | return err; |
| 394 | 390 | ||
| 395 | platform_set_drvdata(pdev, data); | 391 | platform_set_drvdata(pdev, data); |
| 396 | 392 | ||
| @@ -419,12 +415,6 @@ static int exynos5_busfreq_int_probe(struct platform_device *pdev) | |||
| 419 | 415 | ||
| 420 | err_devfreq_add: | 416 | err_devfreq_add: |
| 421 | devfreq_remove_device(data->devfreq); | 417 | devfreq_remove_device(data->devfreq); |
| 422 | platform_set_drvdata(pdev, NULL); | ||
| 423 | err_opp_add: | ||
| 424 | clk_put(data->int_clk); | ||
| 425 | err_clock: | ||
| 426 | regulator_put(data->vdd_int); | ||
| 427 | err_regulator: | ||
| 428 | return err; | 418 | return err; |
| 429 | } | 419 | } |
| 430 | 420 | ||
| @@ -435,9 +425,6 @@ static int exynos5_busfreq_int_remove(struct platform_device *pdev) | |||
| 435 | pm_qos_remove_request(&data->int_req); | 425 | pm_qos_remove_request(&data->int_req); |
| 436 | unregister_pm_notifier(&data->pm_notifier); | 426 | unregister_pm_notifier(&data->pm_notifier); |
| 437 | devfreq_remove_device(data->devfreq); | 427 | devfreq_remove_device(data->devfreq); |
| 438 | regulator_put(data->vdd_int); | ||
| 439 | clk_put(data->int_clk); | ||
| 440 | platform_set_drvdata(pdev, NULL); | ||
| 441 | 428 | ||
| 442 | return 0; | 429 | return 0; |
| 443 | } | 430 | } |
| @@ -479,7 +466,7 @@ static int __init exynos5_busfreq_int_init(void) | |||
| 479 | 466 | ||
| 480 | exynos5_devfreq_pdev = | 467 | exynos5_devfreq_pdev = |
| 481 | platform_device_register_simple("exynos5-bus-int", -1, NULL, 0); | 468 | platform_device_register_simple("exynos5-bus-int", -1, NULL, 0); |
| 482 | if (IS_ERR_OR_NULL(exynos5_devfreq_pdev)) { | 469 | if (IS_ERR(exynos5_devfreq_pdev)) { |
| 483 | ret = PTR_ERR(exynos5_devfreq_pdev); | 470 | ret = PTR_ERR(exynos5_devfreq_pdev); |
| 484 | goto out1; | 471 | goto out1; |
| 485 | } | 472 | } |
