]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - drivers/pwm/pwm-pxa.c
pwm: make the PWM_POLARITY flag in DTB optional
[karo-tx-linux.git] / drivers / pwm / pwm-pxa.c
index 8d995731cef8d13a96f8168161a038c7446e3d5a..56560529aa879f7ac6e4a98301352ff599f3aa18 100644 (file)
@@ -127,12 +127,12 @@ static struct pwm_ops pxa_pwm_ops = {
 
 #ifdef CONFIG_OF
 /*
- * Device tree users must create one device instance for each pwm channel.
+ * Device tree users must create one device instance for each PWM channel.
  * Hence we dispense with the HAS_SECONDARY_PWM and "tell" the original driver
  * code that this is a single channel pxa25x-pwm.  Currently all devices are
  * supported identically.
  */
-static struct of_device_id pwm_of_match[] = {
+static const struct of_device_id pwm_of_match[] = {
        { .compatible = "marvell,pxa250-pwm", .data = &pwm_id_table[0]},
        { .compatible = "marvell,pxa270-pwm", .data = &pwm_id_table[0]},
        { .compatible = "marvell,pxa168-pwm", .data = &pwm_id_table[0]},
@@ -179,10 +179,8 @@ static int pwm_probe(struct platform_device *pdev)
                return -EINVAL;
 
        pwm = devm_kzalloc(&pdev->dev, sizeof(*pwm), GFP_KERNEL);
-       if (pwm == NULL) {
-               dev_err(&pdev->dev, "failed to allocate memory\n");
+       if (pwm == NULL)
                return -ENOMEM;
-       }
 
        pwm->clk = devm_clk_get(&pdev->dev, NULL);
        if (IS_ERR(pwm->clk))
@@ -193,10 +191,9 @@ static int pwm_probe(struct platform_device *pdev)
        pwm->chip.base = -1;
        pwm->chip.npwm = (id->driver_data & HAS_SECONDARY_PWM) ? 2 : 1;
 
-       if (IS_ENABLED(CONFIG_OF)) {
+       if (IS_ENABLED(CONFIG_OF))
                pwm->chip.of_xlate = pxa_pwm_of_xlate;
-               pwm->chip.of_pwm_n_cells = 1;
-       }
+
 
        r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
        pwm->mmio_base = devm_ioremap_resource(&pdev->dev, r);