public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: Frans Pop <elendil@planet.nl>
Cc: Alan Cox <alan@linux.intel.com>, Erik Ekman <erik@kryo.se>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH -tip][RFC] serial8250: update to dev_pm_ops
Date: Sat, 25 Jul 2009 22:18:45 +0200	[thread overview]
Message-ID: <200907252218.46364.rjw@sisk.pl> (raw)
In-Reply-To: <200907251612.34140.elendil@planet.nl>

On Saturday 25 July 2009, Frans Pop wrote:
> On Wednesday 08 July 2009, Alan Cox wrote:
> > On Wed, 8 Jul 2009 Frans Pop <elendil@planet.nl> wrote:
> > > > From dmesg:
> > > > Platform driver 'serial8250' needs updating - please use dev_pm_ops
> > > >
> > > > Is this how it should be done?
> > >
> > > Alan or Rafael can probably tell.
> >
> > No idea. I've not looked at this so your guess is as good as mine (but
> > looks quite believable. I don't plan to do anything until someone who
> > needs platform 8250 support sends a tested version of the change
> > however.
> 
> I have done a few of these myself now and followed all other similar
> updates for other drivers. From that experience I can say that this update
> is both trivial and correct. Hope you will reconsider your reluctance on
> that basis.
> 
> Below Erik's patch with the commit log cleaned up, one whitespace problem
> fixed and my Reviewed-by added.
> 
> Cheers,
> FJP
> 
> ---
> From: Erik Ekman <erik@kryo.se>
> Subject: serial8250: update to dev_pm_ops
> 
> From dmesg:
> Platform driver 'serial8250' needs updating - please use dev_pm_ops
> 
> Signed-off-by: Erik Ekman <erik@kryo.se>
> Reviewed-by: Frans Pop <elendil@planet.nl>
> 
> diff --git a/drivers/serial/8250.c b/drivers/serial/8250.c
> index fb867a9..496c85f 100644
> --- a/drivers/serial/8250.c
> +++ b/drivers/serial/8250.c
> @@ -2982,42 +2982,46 @@ static int __devexit serial8250_remove(struct platform_device *dev)
>  	return 0;
>  }
>  
> -static int serial8250_suspend(struct platform_device *dev, pm_message_t state)
> +static int serial8250_suspend(struct device *dev)
>  {
>  	int i;
>  
>  	for (i = 0; i < UART_NR; i++) {
>  		struct uart_8250_port *up = &serial8250_ports[i];
>  
> -		if (up->port.type != PORT_UNKNOWN && up->port.dev == &dev->dev)
> +		if (up->port.type != PORT_UNKNOWN && up->port.dev == dev)
>  			uart_suspend_port(&serial8250_reg, &up->port);
>  	}
>  
>  	return 0;
>  }
>  
> -static int serial8250_resume(struct platform_device *dev)
> +static int serial8250_resume(struct device *dev)
>  {
>  	int i;
>  
>  	for (i = 0; i < UART_NR; i++) {
>  		struct uart_8250_port *up = &serial8250_ports[i];
>  
> -		if (up->port.type != PORT_UNKNOWN && up->port.dev == &dev->dev)
> +		if (up->port.type != PORT_UNKNOWN && up->port.dev == dev)
>  			serial8250_resume_port(i);
>  	}
>  
>  	return 0;
>  }
>  
> +static struct dev_pm_ops serial8250_pm_ops = {
> +	.suspend = serial8250_suspend,
> +	.resume  = serial8250_resume,

Please don't forget about hibernation!

> +};
> +
>  static struct platform_driver serial8250_isa_driver = {
>  	.probe		= serial8250_probe,
>  	.remove		= __devexit_p(serial8250_remove),
> -	.suspend	= serial8250_suspend,
> -	.resume		= serial8250_resume,
>  	.driver		= {
>  		.name	= "serial8250",
>  		.owner	= THIS_MODULE,
> +		.pm     = &serial8250_pm_ops,
>  	},
>  };

Best,
Rafael

  reply	other threads:[~2009-07-25 20:18 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-01  6:37 [PATCH -tip][RFC] serial8250: update to dev_pm_ops Erik Ekman
2009-07-08 11:10 ` Frans Pop
2009-07-08 13:43   ` Alan Cox
2009-07-25 14:12     ` Frans Pop
2009-07-25 20:18       ` Rafael J. Wysocki [this message]
2009-07-25 20:59         ` [PATCH v2 " Erik Ekman
2009-07-26  0:52           ` Dmitry Torokhov
2009-07-26 19:45             ` Rafael J. Wysocki
2009-07-26 20:52               ` Frans Pop
2009-07-26 22:38                 ` Rafael J. Wysocki
2009-07-27  2:57                 ` Magnus Damm
2009-08-03 10:42                   ` Erik Ekman
2009-07-25 20:22       ` [PATCH " Frans Pop

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=200907252218.46364.rjw@sisk.pl \
    --to=rjw@sisk.pl \
    --cc=alan@linux.intel.com \
    --cc=elendil@planet.nl \
    --cc=erik@kryo.se \
    --cc=linux-kernel@vger.kernel.org \
    /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