* [PATCH] i2c-au1550: dev_pm_ops conversion.
@ 2009-07-20 18:47 Manuel Lauss
[not found] ` <1248115661-20189-1-git-send-email-manuel.lauss-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
0 siblings, 1 reply; 4+ messages in thread
From: Manuel Lauss @ 2009-07-20 18:47 UTC (permalink / raw)
To: linux-i2c-u79uwXL29TY76Z2rM5mHXA; +Cc: Manuel Lauss
Signed-off-by: Manuel Lauss <manuel.lauss-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
---
Run-tested on Au1200.
drivers/i2c/busses/i2c-au1550.c | 23 ++++++++++-------------
1 files changed, 10 insertions(+), 13 deletions(-)
diff --git a/drivers/i2c/busses/i2c-au1550.c b/drivers/i2c/busses/i2c-au1550.c
index 532828b..6565012 100644
--- a/drivers/i2c/busses/i2c-au1550.c
+++ b/drivers/i2c/busses/i2c-au1550.c
@@ -440,40 +440,37 @@ i2c_au1550_remove(struct platform_device *pdev)
return 0;
}
-#ifdef CONFIG_PM
-static int
-i2c_au1550_suspend(struct platform_device *pdev, pm_message_t state)
+static int i2c_au1550_suspend(struct device *dev)
{
- struct i2c_au1550_data *priv = platform_get_drvdata(pdev);
+ struct i2c_au1550_data *priv = dev_get_drvdata(dev);
i2c_au1550_disable(priv);
return 0;
}
-static int
-i2c_au1550_resume(struct platform_device *pdev)
+static int i2c_au1550_resume(struct device *dev)
{
- struct i2c_au1550_data *priv = platform_get_drvdata(pdev);
+ struct i2c_au1550_data *priv = dev_get_drvdata(dev);
i2c_au1550_setup(priv);
return 0;
}
-#else
-#define i2c_au1550_suspend NULL
-#define i2c_au1550_resume NULL
-#endif
+
+static struct dev_pm_ops au1xpsc_smbus_pmops = {
+ .resume = i2c_au1550_resume,
+ .suspend = i2c_au1550_suspend,
+};
static struct platform_driver au1xpsc_smbus_driver = {
.driver = {
.name = "au1xpsc_smbus",
.owner = THIS_MODULE,
+ .pm = &au1xpsc_smbus_pmops,
},
.probe = i2c_au1550_probe,
.remove = __devexit_p(i2c_au1550_remove),
- .suspend = i2c_au1550_suspend,
- .resume = i2c_au1550_resume,
};
static int __init
--
1.6.3.3
^ permalink raw reply related [flat|nested] 4+ messages in thread[parent not found: <1248115661-20189-1-git-send-email-manuel.lauss-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>]
* Re: [PATCH] i2c-au1550: dev_pm_ops conversion. [not found] ` <1248115661-20189-1-git-send-email-manuel.lauss-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> @ 2009-07-20 21:06 ` Ben Dooks [not found] ` <20090720210617.GA28218-elnMNo+KYs3pIgCt6eIbzw@public.gmane.org> 0 siblings, 1 reply; 4+ messages in thread From: Ben Dooks @ 2009-07-20 21:06 UTC (permalink / raw) To: Manuel Lauss; +Cc: linux-i2c-u79uwXL29TY76Z2rM5mHXA, Manuel Lauss On Mon, Jul 20, 2009 at 08:47:41PM +0200, Manuel Lauss wrote: > Signed-off-by: Manuel Lauss <manuel.lauss-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > --- > Run-tested on Au1200. > > drivers/i2c/busses/i2c-au1550.c | 23 ++++++++++------------- > 1 files changed, 10 insertions(+), 13 deletions(-) > > diff --git a/drivers/i2c/busses/i2c-au1550.c b/drivers/i2c/busses/i2c-au1550.c > index 532828b..6565012 100644 > --- a/drivers/i2c/busses/i2c-au1550.c > +++ b/drivers/i2c/busses/i2c-au1550.c > @@ -440,40 +440,37 @@ i2c_au1550_remove(struct platform_device *pdev) > return 0; > } > > -#ifdef CONFIG_PM > -static int > -i2c_au1550_suspend(struct platform_device *pdev, pm_message_t state) > +static int i2c_au1550_suspend(struct device *dev) > { > - struct i2c_au1550_data *priv = platform_get_drvdata(pdev); > + struct i2c_au1550_data *priv = dev_get_drvdata(dev); > > i2c_au1550_disable(priv); > > return 0; > } > > -static int > -i2c_au1550_resume(struct platform_device *pdev) > +static int i2c_au1550_resume(struct device *dev) > { > - struct i2c_au1550_data *priv = platform_get_drvdata(pdev); > + struct i2c_au1550_data *priv = dev_get_drvdata(dev); > > i2c_au1550_setup(priv); > > return 0; > } > -#else > -#define i2c_au1550_suspend NULL > -#define i2c_au1550_resume NULL > -#endif > + > +static struct dev_pm_ops au1xpsc_smbus_pmops = { > + .resume = i2c_au1550_resume, > + .suspend = i2c_au1550_suspend, > +}; > > static struct platform_driver au1xpsc_smbus_driver = { > .driver = { > .name = "au1xpsc_smbus", > .owner = THIS_MODULE, > + .pm = &au1xpsc_smbus_pmops, hmm, why not .pm = (struct dev_pm_ops &) { .suspend = ..., .resume = ..., }, ? > }, > .probe = i2c_au1550_probe, > .remove = __devexit_p(i2c_au1550_remove), > - .suspend = i2c_au1550_suspend, > - .resume = i2c_au1550_resume, > }; > > static int __init > -- > 1.6.3.3 > > -- > To unsubscribe from this list: send the line "unsubscribe linux-i2c" in > the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org > More majordomo info at http://vger.kernel.org/majordomo-info.html -- Ben (ben-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org, http://www.fluff.org/) 'a smiley only costs 4 bytes' ^ permalink raw reply [flat|nested] 4+ messages in thread
[parent not found: <20090720210617.GA28218-elnMNo+KYs3pIgCt6eIbzw@public.gmane.org>]
* Re: [PATCH] i2c-au1550: dev_pm_ops conversion. [not found] ` <20090720210617.GA28218-elnMNo+KYs3pIgCt6eIbzw@public.gmane.org> @ 2009-07-21 5:02 ` Manuel Lauss [not found] ` <f861ec6f0907202202w104f269au8086a243b68d9b3a-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> 0 siblings, 1 reply; 4+ messages in thread From: Manuel Lauss @ 2009-07-21 5:02 UTC (permalink / raw) To: Ben Dooks; +Cc: linux-i2c-u79uwXL29TY76Z2rM5mHXA, Manuel Lauss Hi Ben, On Mon, Jul 20, 2009 at 11:06 PM, Ben Dooks<ben-linux-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org> wrote: >> + >> +static struct dev_pm_ops au1xpsc_smbus_pmops = { >> + .resume = i2c_au1550_resume, >> + .suspend = i2c_au1550_suspend, >> +}; >> >> static struct platform_driver au1xpsc_smbus_driver = { >> .driver = { >> .name = "au1xpsc_smbus", >> .owner = THIS_MODULE, >> + .pm = &au1xpsc_smbus_pmops, > > hmm, why not > .pm = (struct dev_pm_ops &) { > .suspend = ..., > .resume = ..., > }, > > ? I remember one patch being shot down on account of having this style. I prefer the original style too, but I've no objections to changing it... Thank you! Manuel Lauss ^ permalink raw reply [flat|nested] 4+ messages in thread
[parent not found: <f861ec6f0907202202w104f269au8086a243b68d9b3a-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>]
* Re: [PATCH] i2c-au1550: dev_pm_ops conversion. [not found] ` <f861ec6f0907202202w104f269au8086a243b68d9b3a-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> @ 2009-07-29 23:47 ` Ben Dooks 0 siblings, 0 replies; 4+ messages in thread From: Ben Dooks @ 2009-07-29 23:47 UTC (permalink / raw) To: Manuel Lauss; +Cc: Ben Dooks, linux-i2c-u79uwXL29TY76Z2rM5mHXA, Manuel Lauss On Tue, Jul 21, 2009 at 07:02:58AM +0200, Manuel Lauss wrote: > Hi Ben, > > On Mon, Jul 20, 2009 at 11:06 PM, Ben Dooks<ben-linux-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org> wrote: > > >> + > >> +static struct dev_pm_ops au1xpsc_smbus_pmops = { > >> + ? ? .resume ? ? ? ? = i2c_au1550_resume, > >> + ? ? .suspend ? ? ? ?= i2c_au1550_suspend, > >> +}; > >> > >> ?static struct platform_driver au1xpsc_smbus_driver = { > >> ? ? ? .driver = { > >> ? ? ? ? ? ? ? .name ? = "au1xpsc_smbus", > >> ? ? ? ? ? ? ? .owner ?= THIS_MODULE, > >> + ? ? ? ? ? ? .pm ? ? = &au1xpsc_smbus_pmops, > > > > hmm, why not > > ? ? ? ? ? ? ? ?.pm ? ? = (struct dev_pm_ops &) { > > ? ? ? ? ? ? ? ? ? ? ? ?.suspend ? ? ? ?= ..., > > ? ? ? ? ? ? ? ? ? ? ? ?.resume ? ? ? ? = ..., > > ? ? ? ? ? ? ? ?}, > > > > ? > > I remember one patch being shot down on account of having this > style. I prefer the original style too, but I've no objections to changing > it... no objections on style, the only thing to change is to put the #ifdef CONFIG_PM back. > Thank you! > Manuel Lauss > -- > To unsubscribe from this list: send the line "unsubscribe linux-i2c" in > the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org > More majordomo info at http://vger.kernel.org/majordomo-info.html -- Ben (ben-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org, http://www.fluff.org/) 'a smiley only costs 4 bytes' ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2009-07-29 23:47 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-20 18:47 [PATCH] i2c-au1550: dev_pm_ops conversion Manuel Lauss
[not found] ` <1248115661-20189-1-git-send-email-manuel.lauss-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2009-07-20 21:06 ` Ben Dooks
[not found] ` <20090720210617.GA28218-elnMNo+KYs3pIgCt6eIbzw@public.gmane.org>
2009-07-21 5:02 ` Manuel Lauss
[not found] ` <f861ec6f0907202202w104f269au8086a243b68d9b3a-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2009-07-29 23:47 ` Ben Dooks
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).