public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
From: Felipe Balbi <balbi@ti.com>
To: Sourav Poddar <sourav.poddar@ti.com>
Cc: gregkh@linuxfoundation.org, alan@linux.intel.com,
	tony@atomide.com, khilman@ti.com, linux-omap@vger.kernel.org,
	linux-serial@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, balbi@ti.com,
	santosh.shilimkar@ti.com
Subject: Re: [PATCH] serial: omap: Remove unnecessary checks from suspend/resume
Date: Tue, 18 Sep 2012 14:34:46 +0300	[thread overview]
Message-ID: <20120918113444.GG24047@arwen.pp.htv.fi> (raw)
In-Reply-To: <1347968154-27997-1-git-send-email-sourav.poddar@ti.com>

[-- Attachment #1: Type: text/plain, Size: 2321 bytes --]

On Tue, Sep 18, 2012 at 05:05:54PM +0530, Sourav Poddar wrote:
> Drop the check for "up" being valid on suspend/resume callbacks.
> It should be valid always. Get rid of the "pdata" check also as
> serial_omap_get_context_loss_count() checks for it.
> 
> Tested on omap4 panda and 3630 based Beagle board.

you need a blank line here. Other than that:

Reviewed-by: Felipe Balbi <balbi@ti.com>

ps: what kind of tests did you run, btw ?

> Signed-off-by: Sourav Poddar <sourav.poddar@ti.com>
> ---
>  drivers/tty/serial/omap-serial.c |   23 +++++++++--------------
>  1 files changed, 9 insertions(+), 14 deletions(-)
> 
> diff --git a/drivers/tty/serial/omap-serial.c b/drivers/tty/serial/omap-serial.c
> index f175385..3c05c5e 100644
> --- a/drivers/tty/serial/omap-serial.c
> +++ b/drivers/tty/serial/omap-serial.c
> @@ -1222,10 +1222,8 @@ static int serial_omap_suspend(struct device *dev)
>  {
>  	struct uart_omap_port *up = dev_get_drvdata(dev);
>  
> -	if (up) {
> -		uart_suspend_port(&serial_omap_reg, &up->port);
> -		flush_work_sync(&up->qos_work);
> -	}
> +	uart_suspend_port(&serial_omap_reg, &up->port);
> +	flush_work_sync(&up->qos_work);
>  
>  	return 0;
>  }
> @@ -1234,8 +1232,8 @@ static int serial_omap_resume(struct device *dev)
>  {
>  	struct uart_omap_port *up = dev_get_drvdata(dev);
>  
> -	if (up)
> -		uart_resume_port(&serial_omap_reg, &up->port);
> +	uart_resume_port(&serial_omap_reg, &up->port);
> +
>  	return 0;
>  }
>  #endif
> @@ -1553,17 +1551,14 @@ static int serial_omap_runtime_suspend(struct device *dev)
>  static int serial_omap_runtime_resume(struct device *dev)
>  {
>  	struct uart_omap_port *up = dev_get_drvdata(dev);
> -	struct omap_uart_port_info *pdata = dev->platform_data;
>  
> -	if (up && pdata) {
> -			u32 loss_cnt = serial_omap_get_context_loss_count(up);
> +	u32 loss_cnt = serial_omap_get_context_loss_count(up);
>  
> -			if (up->context_loss_cnt != loss_cnt)
> -				serial_omap_restore_context(up);
> +	if (up->context_loss_cnt != loss_cnt)
> +		serial_omap_restore_context(up);
>  
> -		up->latency = up->calc_latency;
> -		schedule_work(&up->qos_work);
> -	}
> +	up->latency = up->calc_latency;
> +	schedule_work(&up->qos_work);
>  
>  	return 0;
>  }
> -- 
> 1.7.1
> 

-- 
balbi

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

  reply	other threads:[~2012-09-18 11:34 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-18 11:35 [PATCH] serial: omap: Remove unnecessary checks from suspend/resume Sourav Poddar
2012-09-18 11:34 ` Felipe Balbi [this message]
2012-09-18 11:44   ` Poddar, Sourav
2012-09-19 21:43     ` Kevin Hilman
2012-09-21  5:10       ` Poddar, Sourav

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120918113444.GG24047@arwen.pp.htv.fi \
    --to=balbi@ti.com \
    --cc=alan@linux.intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=khilman@ti.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=santosh.shilimkar@ti.com \
    --cc=sourav.poddar@ti.com \
    --cc=tony@atomide.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox