Merge tag 'random_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso...
[deliverable/linux.git] / drivers / pwm / pwm-mxs.c
index 3b7f3ab116e3a102b04dd7fac889e1fb0759fd23..e5852646f082eadee2fef58feb44f814339847ee 100644 (file)
@@ -16,6 +16,7 @@
 #include <linux/module.h>
 #include <linux/of.h>
 #include <linux/of_address.h>
+#include <linux/pinctrl/consumer.h>
 #include <linux/platform_device.h>
 #include <linux/pwm.h>
 #include <linux/slab.h>
@@ -130,6 +131,7 @@ static int mxs_pwm_probe(struct platform_device *pdev)
        struct device_node *np = pdev->dev.of_node;
        struct mxs_pwm_chip *mxs;
        struct resource *res;
+       struct pinctrl *pinctrl;
        int ret;
 
        mxs = devm_kzalloc(&pdev->dev, sizeof(*mxs), GFP_KERNEL);
@@ -141,6 +143,10 @@ static int mxs_pwm_probe(struct platform_device *pdev)
        if (!mxs->base)
                return -EADDRNOTAVAIL;
 
+       pinctrl = devm_pinctrl_get_select_default(&pdev->dev);
+       if (IS_ERR(pinctrl))
+               return PTR_ERR(pinctrl);
+
        mxs->clk = devm_clk_get(&pdev->dev, NULL);
        if (IS_ERR(mxs->clk))
                return PTR_ERR(mxs->clk);
@@ -172,9 +178,7 @@ static int __devexit mxs_pwm_remove(struct platform_device *pdev)
 {
        struct mxs_pwm_chip *mxs = platform_get_drvdata(pdev);
 
-       pwmchip_remove(&mxs->chip);
-
-       return 0;
+       return pwmchip_remove(&mxs->chip);
 }
 
 static struct of_device_id mxs_pwm_dt_ids[] = {
This page took 0.024067 seconds and 5 git commands to generate.