Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933677AbbHKDDB (ORCPT ); Mon, 10 Aug 2015 23:03:01 -0400 Received: from mail-ob0-f182.google.com ([209.85.214.182]:34784 "EHLO mail-ob0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933326AbbHKDC7 (ORCPT ); Mon, 10 Aug 2015 23:02:59 -0400 MIME-Version: 1.0 In-Reply-To: <1439256949-626-7-git-send-email-edubezval@gmail.com> References: <1439256949-626-1-git-send-email-edubezval@gmail.com> <1439256949-626-7-git-send-email-edubezval@gmail.com> Date: Tue, 11 Aug 2015 00:02:58 -0300 Message-ID: Subject: Re: [PATCHv2 6/8] serial: imx: add runtime pm support From: Fabio Estevam To: Eduardo Valentin Cc: Greg Kroah-Hartman , Jiri Slaby , Sascha Hauer , Linux PM , "linux-serial@vger.kernel.org" , LKML Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1578 Lines: 51 On Mon, Aug 10, 2015 at 10:35 PM, Eduardo Valentin wrote: > static int imx_poll_get_char(struct uart_port *port) > { > - if (!(readl_relaxed(port->membase + USR2) & USR2_RDR)) > - return NO_POLL_CHAR; > + int ret; > + > + pm_runtime_get_sync(sport->dev); > + if (!(readl_relaxed(port->membase + USR2) & USR2_RDR)) { > + ret = NO_POLL_CHAR; > + goto mark_last; > + } > > - return readl_relaxed(port->membase + URXD0) & URXD_RX_DATA; > + ret = readl_relaxed(port->membase + URXD0) & URXD_RX_DATA; > + > +mark_last: > + pm_runtime_mark_last_busy(sport->dev); > + pm_runtime_put_autosuspend(sport->dev); You should return ret here. > +static int serial_imx_runtime_resume(struct device *dev) > +{ > + struct imx_port *sport = dev_get_drvdata(dev); > + > + clk_enable(sport->clk_per); clk_enable() may fail. > + clk_enable(sport->clk_ipg); Same here. > @@ -2096,6 +2212,8 @@ static int imx_serial_port_resume(struct device *dev) > struct platform_device *pdev = to_platform_device(dev); > struct imx_port *sport = platform_get_drvdata(pdev); > > + clk_prepare_enable(sport->clk_per); clk_prepare_enable() may fail. > + clk_prepare_enable(sport->clk_ipg); Ditto. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/