Skip to content

Commit

Permalink
tty: serial: imx: adopt pinctrl support
Browse files Browse the repository at this point in the history
Cc: linux-serial@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Acked-by: Dong Aisheng <dong.aisheng@linaro.org>
  • Loading branch information
Shawn Guo committed May 11, 2012
1 parent e62d8b8 commit fed78ce
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions drivers/tty/serial/imx.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
#include <linux/slab.h>
#include <linux/of.h>
#include <linux/of_device.h>
#include <linux/pinctrl/consumer.h>

#include <asm/io.h>
#include <asm/irq.h>
Expand Down Expand Up @@ -1464,6 +1465,7 @@ static int serial_imx_probe(struct platform_device *pdev)
void __iomem *base;
int ret = 0;
struct resource *res;
struct pinctrl *pinctrl;

sport = kzalloc(sizeof(*sport), GFP_KERNEL);
if (!sport)
Expand Down Expand Up @@ -1503,6 +1505,12 @@ static int serial_imx_probe(struct platform_device *pdev)
sport->timer.function = imx_timeout;
sport->timer.data = (unsigned long)sport;

pinctrl = devm_pinctrl_get_select_default(&pdev->dev);
if (IS_ERR(pinctrl)) {
ret = PTR_ERR(pinctrl);
goto unmap;
}

sport->clk = clk_get(&pdev->dev, "uart");
if (IS_ERR(sport->clk)) {
ret = PTR_ERR(sport->clk);
Expand Down

0 comments on commit fed78ce

Please sign in to comment.