* [PATCH] mfd: remove driver_data direct access of struct device
@ 2009-04-30 22:18 Greg Kroah-Hartman
2009-05-01 11:25 ` Mark Brown
0 siblings, 1 reply; 6+ messages in thread
From: Greg Kroah-Hartman @ 2009-04-30 22:18 UTC (permalink / raw)
To: Samuel Ortiz; +Cc: linux-kernel, Greg KH
From: Greg Kroah-Hartman <gregkh@suse.de>
In the near future, the driver core is going to not allow direct access
to the driver_data pointer in struct device. Instead, the functions
dev_get_drvdata() and dev_set_drvdata() should be used. These functions
have been around since the beginning, so are backwards compatible with
all older kernel versions.
Cc: Samuel Ortiz <sameo@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/mfd/htc-pasic3.c | 4 ++--
drivers/mfd/pcf50633-core.c | 2 +-
drivers/mfd/wm8400-core.c | 2 +-
3 files changed, 4 insertions(+), 4 deletions(-)
--- a/drivers/mfd/htc-pasic3.c
+++ b/drivers/mfd/htc-pasic3.c
@@ -35,7 +35,7 @@ struct pasic3_data {
*/
void pasic3_write_register(struct device *dev, u32 reg, u8 val)
{
- struct pasic3_data *asic = dev->driver_data;
+ struct pasic3_data *asic = dev_get_drvdata(dev);
int bus_shift = asic->bus_shift;
void __iomem *addr = asic->mapping + (REG_ADDR << bus_shift);
void __iomem *data = asic->mapping + (REG_DATA << bus_shift);
@@ -50,7 +50,7 @@ EXPORT_SYMBOL(pasic3_write_register); /*
*/
u8 pasic3_read_register(struct device *dev, u32 reg)
{
- struct pasic3_data *asic = dev->driver_data;
+ struct pasic3_data *asic = dev_get_drvdata(dev);
int bus_shift = asic->bus_shift;
void __iomem *addr = asic->mapping + (REG_ADDR << bus_shift);
void __iomem *data = asic->mapping + (REG_DATA << bus_shift);
--- a/drivers/mfd/pcf50633-core.c
+++ b/drivers/mfd/pcf50633-core.c
@@ -618,7 +618,7 @@ static int __devinit pcf50633_probe(stru
pdev->dev.parent = pcf->dev;
pdev->dev.platform_data = &pdata->reg_init_data[i];
- pdev->dev.driver_data = pcf;
+ dev_set_drvdata(&pdev->dev, pcf);
pcf->regulator_pdev[i] = pdev;
platform_device_add(pdev);
--- a/drivers/mfd/wm8400-core.c
+++ b/drivers/mfd/wm8400-core.c
@@ -265,7 +265,7 @@ static int wm8400_init(struct wm8400 *wm
mutex_init(&wm8400->io_lock);
- wm8400->dev->driver_data = wm8400;
+ dev_set_drvdata(wm8400->dev, wm8400);
/* Check that this is actually a WM8400 */
ret = wm8400->read_dev(wm8400->io_data, WM8400_RESET_ID, 1, ®);
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] mfd: remove driver_data direct access of struct device
2009-04-30 22:18 [PATCH] mfd: remove driver_data direct access of struct device Greg Kroah-Hartman
@ 2009-05-01 11:25 ` Mark Brown
2009-05-01 15:15 ` Greg KH
0 siblings, 1 reply; 6+ messages in thread
From: Mark Brown @ 2009-05-01 11:25 UTC (permalink / raw)
To: Greg Kroah-Hartman; +Cc: Samuel Ortiz, linux-kernel, Greg KH
On Thu, Apr 30, 2009 at 03:18:50PM -0700, Greg Kroah-Hartman wrote:
> From: Greg Kroah-Hartman <gregkh@suse.de>
> In the near future, the driver core is going to not allow direct access
> to the driver_data pointer in struct device. Instead, the functions
> dev_get_drvdata() and dev_set_drvdata() should be used. These functions
> have been around since the beginning, so are backwards compatible with
> all older kernel versions.
> Cc: Samuel Ortiz <sameo@linux.intel.com>
> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
For wm8400:
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] mfd: remove driver_data direct access of struct device
2009-05-01 11:25 ` Mark Brown
@ 2009-05-01 15:15 ` Greg KH
2009-05-01 15:48 ` Samuel Ortiz
2009-05-03 21:59 ` Samuel Ortiz
0 siblings, 2 replies; 6+ messages in thread
From: Greg KH @ 2009-05-01 15:15 UTC (permalink / raw)
To: Mark Brown; +Cc: Samuel Ortiz, linux-kernel, Greg KH
On Fri, May 01, 2009 at 12:25:25PM +0100, Mark Brown wrote:
> On Thu, Apr 30, 2009 at 03:18:50PM -0700, Greg Kroah-Hartman wrote:
> > From: Greg Kroah-Hartman <gregkh@suse.de>
>
> > In the near future, the driver core is going to not allow direct access
> > to the driver_data pointer in struct device. Instead, the functions
> > dev_get_drvdata() and dev_set_drvdata() should be used. These functions
> > have been around since the beginning, so are backwards compatible with
> > all older kernel versions.
>
> > Cc: Samuel Ortiz <sameo@linux.intel.com>
> > Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
>
> For wm8400:
>
> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Thanks. Do you mind if I take this in my tree? Or is there a mfd tree
somewhere that it should go through?
greg k-h
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] mfd: remove driver_data direct access of struct device
2009-05-01 15:15 ` Greg KH
@ 2009-05-01 15:48 ` Samuel Ortiz
2009-05-03 21:59 ` Samuel Ortiz
1 sibling, 0 replies; 6+ messages in thread
From: Samuel Ortiz @ 2009-05-01 15:48 UTC (permalink / raw)
To: Greg KH; +Cc: Mark Brown, linux-kernel, Greg KH
Hi Greg,
On Fri, May 01, 2009 at 08:15:35AM -0700, Greg KH wrote:
> On Fri, May 01, 2009 at 12:25:25PM +0100, Mark Brown wrote:
> > On Thu, Apr 30, 2009 at 03:18:50PM -0700, Greg Kroah-Hartman wrote:
> > > From: Greg Kroah-Hartman <gregkh@suse.de>
> >
> > > In the near future, the driver core is going to not allow direct access
> > > to the driver_data pointer in struct device. Instead, the functions
> > > dev_get_drvdata() and dev_set_drvdata() should be used. These functions
> > > have been around since the beginning, so are backwards compatible with
> > > all older kernel versions.
> >
> > > Cc: Samuel Ortiz <sameo@linux.intel.com>
> > > Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
> >
> > For wm8400:
> >
> > Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
>
> Thanks. Do you mind if I take this in my tree? Or is there a mfd tree
> somewhere that it should go through?
It should probably go through the mfd tree, I'll take it.
Thanks,
Samuel.
--
Intel Open Source Technology Centre
http://oss.intel.com/
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] mfd: remove driver_data direct access of struct device
2009-05-01 15:15 ` Greg KH
2009-05-01 15:48 ` Samuel Ortiz
@ 2009-05-03 21:59 ` Samuel Ortiz
2009-05-04 1:15 ` Greg KH
1 sibling, 1 reply; 6+ messages in thread
From: Samuel Ortiz @ 2009-05-03 21:59 UTC (permalink / raw)
To: Greg KH; +Cc: Mark Brown, linux-kernel, Greg KH
Hi Greg,
On Fri, May 01, 2009 at 08:15:35AM -0700, Greg KH wrote:
> On Fri, May 01, 2009 at 12:25:25PM +0100, Mark Brown wrote:
> > On Thu, Apr 30, 2009 at 03:18:50PM -0700, Greg Kroah-Hartman wrote:
> > > From: Greg Kroah-Hartman <gregkh@suse.de>
> >
> > > In the near future, the driver core is going to not allow direct access
> > > to the driver_data pointer in struct device. Instead, the functions
> > > dev_get_drvdata() and dev_set_drvdata() should be used. These functions
> > > have been around since the beginning, so are backwards compatible with
> > > all older kernel versions.
> >
> > > Cc: Samuel Ortiz <sameo@linux.intel.com>
> > > Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
> >
> > For wm8400:
> >
> > Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
>
> Thanks. Do you mind if I take this in my tree? Or is there a mfd tree
> somewhere that it should go through?
I applied this one to my for-next branch.
When do you plan to remove the direct driver_data direct access ? I'm asking
to know if I should schedule this patch for sometimes earlier than the next
merge window.
Cheers,
Samuel.
> greg k-h
--
Intel Open Source Technology Centre
http://oss.intel.com/
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] mfd: remove driver_data direct access of struct device
2009-05-03 21:59 ` Samuel Ortiz
@ 2009-05-04 1:15 ` Greg KH
0 siblings, 0 replies; 6+ messages in thread
From: Greg KH @ 2009-05-04 1:15 UTC (permalink / raw)
To: Samuel Ortiz; +Cc: Mark Brown, linux-kernel, Greg KH
On Sun, May 03, 2009 at 11:59:41PM +0200, Samuel Ortiz wrote:
> Hi Greg,
>
> On Fri, May 01, 2009 at 08:15:35AM -0700, Greg KH wrote:
> > On Fri, May 01, 2009 at 12:25:25PM +0100, Mark Brown wrote:
> > > On Thu, Apr 30, 2009 at 03:18:50PM -0700, Greg Kroah-Hartman wrote:
> > > > From: Greg Kroah-Hartman <gregkh@suse.de>
> > >
> > > > In the near future, the driver core is going to not allow direct access
> > > > to the driver_data pointer in struct device. Instead, the functions
> > > > dev_get_drvdata() and dev_set_drvdata() should be used. These functions
> > > > have been around since the beginning, so are backwards compatible with
> > > > all older kernel versions.
> > >
> > > > Cc: Samuel Ortiz <sameo@linux.intel.com>
> > > > Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
> > >
> > > For wm8400:
> > >
> > > Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
> >
> > Thanks. Do you mind if I take this in my tree? Or is there a mfd tree
> > somewhere that it should go through?
> I applied this one to my for-next branch.
> When do you plan to remove the direct driver_data direct access ?
In 2.6.31.
> I'm asking to know if I should schedule this patch for sometimes
> earlier than the next merge window.
next merge window is fine with me.
thanks,
greg k-h
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2009-05-04 1:20 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-30 22:18 [PATCH] mfd: remove driver_data direct access of struct device Greg Kroah-Hartman
2009-05-01 11:25 ` Mark Brown
2009-05-01 15:15 ` Greg KH
2009-05-01 15:48 ` Samuel Ortiz
2009-05-03 21:59 ` Samuel Ortiz
2009-05-04 1:15 ` Greg KH
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox