diff options
author | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2013-11-07 13:24:20 -0500 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2013-11-07 13:24:20 -0500 |
commit | 230b4b376e6b860275dccb1c00e7c213ed7fe311 (patch) | |
tree | 784dcff11a02732a1c78cc245297d83ccb2f7e37 /drivers/devfreq/exynos/exynos5_bus.c | |
parent | a4aaf2e0dfcc05578e8c822fce975a7d5836dc7f (diff) | |
parent | 1c5054d9e34b7f8c57e2db1ce02ee90e643c0314 (diff) |
Merge branch 'pm-devfreq'
* pm-devfreq:
PM / devfreq: create_freezable_workqueue() doesn't return an ERR_PTR
PM / devfreq: Remove duplicate header file inclusion in exynos5_bus.c
PM / devfreq: Use devm_* APIs in exynos5_bus.c
PM / devfreq: Remove redundant platform_set_drvdata() in exynos5_bus.c
PM / devfreq: Fix incorrect usage of IS_ERR_OR_NULL in exynos5_bus.c
Diffstat (limited to 'drivers/devfreq/exynos/exynos5_bus.c')
-rw-r--r-- | drivers/devfreq/exynos/exynos5_bus.c | 30 |
1 files changed, 9 insertions, 21 deletions
diff --git a/drivers/devfreq/exynos/exynos5_bus.c b/drivers/devfreq/exynos/exynos5_bus.c index 0e0bfc17cd5b..a60da3c1c48e 100644 --- a/drivers/devfreq/exynos/exynos5_bus.c +++ b/drivers/devfreq/exynos/exynos5_bus.c | |||
@@ -350,20 +350,18 @@ static int exynos5_busfreq_int_probe(struct platform_device *pdev) | |||
350 | 350 | ||
351 | err = exynos5250_init_int_tables(data); | 351 | err = exynos5250_init_int_tables(data); |
352 | if (err) | 352 | if (err) |
353 | goto err_regulator; | 353 | return err; |
354 | 354 | ||
355 | data->vdd_int = regulator_get(dev, "vdd_int"); | 355 | data->vdd_int = devm_regulator_get(dev, "vdd_int"); |
356 | if (IS_ERR(data->vdd_int)) { | 356 | if (IS_ERR(data->vdd_int)) { |
357 | dev_err(dev, "Cannot get the regulator \"vdd_int\"\n"); | 357 | dev_err(dev, "Cannot get the regulator \"vdd_int\"\n"); |
358 | err = PTR_ERR(data->vdd_int); | 358 | return PTR_ERR(data->vdd_int); |
359 | goto err_regulator; | ||
360 | } | 359 | } |
361 | 360 | ||
362 | data->int_clk = clk_get(dev, "int_clk"); | 361 | data->int_clk = devm_clk_get(dev, "int_clk"); |
363 | if (IS_ERR(data->int_clk)) { | 362 | if (IS_ERR(data->int_clk)) { |
364 | dev_err(dev, "Cannot get clock \"int_clk\"\n"); | 363 | dev_err(dev, "Cannot get clock \"int_clk\"\n"); |
365 | err = PTR_ERR(data->int_clk); | 364 | return PTR_ERR(data->int_clk); |
366 | goto err_clock; | ||
367 | } | 365 | } |
368 | 366 | ||
369 | rcu_read_lock(); | 367 | rcu_read_lock(); |
@@ -373,8 +371,7 @@ static int exynos5_busfreq_int_probe(struct platform_device *pdev) | |||
373 | rcu_read_unlock(); | 371 | rcu_read_unlock(); |
374 | dev_err(dev, "Invalid initial frequency %lu kHz.\n", | 372 | dev_err(dev, "Invalid initial frequency %lu kHz.\n", |
375 | exynos5_devfreq_int_profile.initial_freq); | 373 | exynos5_devfreq_int_profile.initial_freq); |
376 | err = PTR_ERR(opp); | 374 | return PTR_ERR(opp); |
377 | goto err_opp_add; | ||
378 | } | 375 | } |
379 | initial_freq = dev_pm_opp_get_freq(opp); | 376 | initial_freq = dev_pm_opp_get_freq(opp); |
380 | initial_volt = dev_pm_opp_get_voltage(opp); | 377 | initial_volt = dev_pm_opp_get_voltage(opp); |
@@ -384,12 +381,12 @@ static int exynos5_busfreq_int_probe(struct platform_device *pdev) | |||
384 | err = clk_set_rate(data->int_clk, initial_freq * 1000); | 381 | err = clk_set_rate(data->int_clk, initial_freq * 1000); |
385 | if (err) { | 382 | if (err) { |
386 | dev_err(dev, "Failed to set initial frequency\n"); | 383 | dev_err(dev, "Failed to set initial frequency\n"); |
387 | goto err_opp_add; | 384 | return err; |
388 | } | 385 | } |
389 | 386 | ||
390 | err = exynos5_int_setvolt(data, initial_volt); | 387 | err = exynos5_int_setvolt(data, initial_volt); |
391 | if (err) | 388 | if (err) |
392 | goto err_opp_add; | 389 | return err; |
393 | 390 | ||
394 | platform_set_drvdata(pdev, data); | 391 | platform_set_drvdata(pdev, data); |
395 | 392 | ||
@@ -418,12 +415,6 @@ static int exynos5_busfreq_int_probe(struct platform_device *pdev) | |||
418 | 415 | ||
419 | err_devfreq_add: | 416 | err_devfreq_add: |
420 | devfreq_remove_device(data->devfreq); | 417 | devfreq_remove_device(data->devfreq); |
421 | platform_set_drvdata(pdev, NULL); | ||
422 | err_opp_add: | ||
423 | clk_put(data->int_clk); | ||
424 | err_clock: | ||
425 | regulator_put(data->vdd_int); | ||
426 | err_regulator: | ||
427 | return err; | 418 | return err; |
428 | } | 419 | } |
429 | 420 | ||
@@ -434,9 +425,6 @@ static int exynos5_busfreq_int_remove(struct platform_device *pdev) | |||
434 | pm_qos_remove_request(&data->int_req); | 425 | pm_qos_remove_request(&data->int_req); |
435 | unregister_pm_notifier(&data->pm_notifier); | 426 | unregister_pm_notifier(&data->pm_notifier); |
436 | devfreq_remove_device(data->devfreq); | 427 | devfreq_remove_device(data->devfreq); |
437 | regulator_put(data->vdd_int); | ||
438 | clk_put(data->int_clk); | ||
439 | platform_set_drvdata(pdev, NULL); | ||
440 | 428 | ||
441 | return 0; | 429 | return 0; |
442 | } | 430 | } |
@@ -478,7 +466,7 @@ static int __init exynos5_busfreq_int_init(void) | |||
478 | 466 | ||
479 | exynos5_devfreq_pdev = | 467 | exynos5_devfreq_pdev = |
480 | platform_device_register_simple("exynos5-bus-int", -1, NULL, 0); | 468 | platform_device_register_simple("exynos5-bus-int", -1, NULL, 0); |
481 | if (IS_ERR_OR_NULL(exynos5_devfreq_pdev)) { | 469 | if (IS_ERR(exynos5_devfreq_pdev)) { |
482 | ret = PTR_ERR(exynos5_devfreq_pdev); | 470 | ret = PTR_ERR(exynos5_devfreq_pdev); |
483 | goto out1; | 471 | goto out1; |
484 | } | 472 | } |