Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 344460
b: refs/heads/master
c: f9e007f
h: refs/heads/master
v: v3
  • Loading branch information
Jingoo Han authored and Bryan Wu committed Nov 26, 2012
1 parent 15afc5a commit d3103ae
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 12 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f87ef101056a34d69d7aa2611da0eb95ff4414f9
refs/heads/master: f9e007fffd44ba508c0b9c62c8126eb350bcff1e
17 changes: 6 additions & 11 deletions trunk/drivers/leds/leds-renesas-tpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -263,18 +263,18 @@ static int __devinit r_tpu_probe(struct platform_device *pdev)
}

/* map memory, let mapbase point to our channel */
p->mapbase = ioremap_nocache(res->start, resource_size(res));
p->mapbase = devm_ioremap_nocache(&pdev->dev, res->start,
resource_size(res));
if (p->mapbase == NULL) {
dev_err(&pdev->dev, "failed to remap I/O memory\n");
return -ENXIO;
}

/* get hold of clock */
p->clk = clk_get(&pdev->dev, NULL);
p->clk = devm_clk_get(&pdev->dev, NULL);
if (IS_ERR(p->clk)) {
dev_err(&pdev->dev, "cannot get clock\n");
ret = PTR_ERR(p->clk);
goto err0;
return PTR_ERR(p->clk);
}

p->pdev = pdev;
Expand All @@ -293,19 +293,16 @@ static int __devinit r_tpu_probe(struct platform_device *pdev)
p->ldev.flags |= LED_CORE_SUSPENDRESUME;
ret = led_classdev_register(&pdev->dev, &p->ldev);
if (ret < 0)
goto err1;
goto err0;

/* max_brightness may be updated by the LED core code */
p->min_rate = p->ldev.max_brightness * p->refresh_rate;

pm_runtime_enable(&pdev->dev);
return 0;

err1:
r_tpu_set_pin(p, R_TPU_PIN_UNUSED, LED_OFF);
clk_put(p->clk);
err0:
iounmap(p->mapbase);
r_tpu_set_pin(p, R_TPU_PIN_UNUSED, LED_OFF);
return ret;
}

Expand All @@ -320,9 +317,7 @@ static int __devexit r_tpu_remove(struct platform_device *pdev)
r_tpu_set_pin(p, R_TPU_PIN_UNUSED, LED_OFF);

pm_runtime_disable(&pdev->dev);
clk_put(p->clk);

iounmap(p->mapbase);
return 0;
}

Expand Down

0 comments on commit d3103ae

Please sign in to comment.