summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2015-03-09 08:30:24 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2015-03-09 08:30:24 +0100
commit696bd3833712e2b0f1ce296353a5cfbfb5ef3321 (patch)
tree9bbe59cf28419ad700a028beaf06301c1de4c092 /drivers
parentac1bffb220f6ca82960bf4a2c6f543e953b3b806 (diff)
parent478fb5c3ddcc1bdc9f05583b42fa2ad8a9ad1a78 (diff)
downloadbarebox-696bd3833712e2b0f1ce296353a5cfbfb5ef3321.tar.gz
barebox-696bd3833712e2b0f1ce296353a5cfbfb5ef3321.tar.xz
Merge branch 'for-next/imx'
Diffstat (limited to 'drivers')
-rw-r--r--drivers/pwm/pwm-imx.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/drivers/pwm/pwm-imx.c b/drivers/pwm/pwm-imx.c
index fbfc3af0cd..b00bf7e80b 100644
--- a/drivers/pwm/pwm-imx.c
+++ b/drivers/pwm/pwm-imx.c
@@ -226,21 +226,19 @@ static int imx_pwm_probe(struct device_d *dev)
if (IS_ERR(imx->clk_per))
return PTR_ERR(imx->clk_per);
+ imx->mmio_base = dev_request_mem_region(dev, 0);
+ if (IS_ERR(imx->mmio_base))
+ return PTR_ERR(imx->mmio_base);
+
imx->chip.ops = &imx_pwm_ops;
if (dev->device_node) {
imx->chip.devname = of_alias_get(dev->device_node);
- if (!imx->chip.devname) {
- dev_err(dev, "no alias for pwm\n");
- return -EINVAL;
- }
+ if (!imx->chip.devname)
+ imx->chip.devname = asprintf("pwm_%p", imx->mmio_base);
} else {
imx->chip.devname = asprintf("pwm%d", dev->id);
}
- imx->mmio_base = dev_request_mem_region(dev, 0);
- if (IS_ERR(imx->mmio_base))
- return PTR_ERR(imx->mmio_base);
-
imx->config = data->config;
imx->set_enable = data->set_enable;