* [PATCH] xen block: remove driver_data direct access of struct device
@ 2009-04-30 22:24 Greg Kroah-Hartman
2009-04-30 22:35 ` Chris Wright
0 siblings, 1 reply; 6+ messages in thread
From: Greg Kroah-Hartman @ 2009-04-30 22:24 UTC (permalink / raw)
To: Chris Wright, Jeremy Fitzhardinge; +Cc: virtualization, xen-devel, 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: xen-devel@lists.xensource.com
Cc: virtualization@lists.osdl.org
Cc: Chris Wright <chrisw@sous-sol.org>
Cc: Jeremy Fitzhardinge <jeremy@xensource.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/block/xen-blkfront.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
--- a/drivers/block/xen-blkfront.c
+++ b/drivers/block/xen-blkfront.c
@@ -755,12 +755,12 @@ static int blkfront_probe(struct xenbus_
/* Front end dir is a number, which is used as the id. */
info->handle = simple_strtoul(strrchr(dev->nodename, '/')+1, NULL, 0);
- dev->dev.driver_data = info;
+ dev_det_drvdata(&dev->dev, info);
err = talk_to_backend(dev, info);
if (err) {
kfree(info);
- dev->dev.driver_data = NULL;
+ dev_det_drvdata(&dev->dev, NULL);
return err;
}
@@ -845,7 +845,7 @@ static int blkif_recover(struct blkfront
*/
static int blkfront_resume(struct xenbus_device *dev)
{
- struct blkfront_info *info = dev->dev.driver_data;
+ struct blkfront_info *info = dev_get_drvdata(&dev->dev);
int err;
dev_dbg(&dev->dev, "blkfront_resume: %s\n", dev->nodename);
@@ -924,7 +924,7 @@ static void blkfront_connect(struct blkf
*/
static void blkfront_closing(struct xenbus_device *dev)
{
- struct blkfront_info *info = dev->dev.driver_data;
+ struct blkfront_info *info = dev_get_drvdata(&dev->dev);
unsigned long flags;
dev_dbg(&dev->dev, "blkfront_closing: %s removed\n", dev->nodename);
@@ -959,7 +959,7 @@ static void blkfront_closing(struct xenb
static void backend_changed(struct xenbus_device *dev,
enum xenbus_state backend_state)
{
- struct blkfront_info *info = dev->dev.driver_data;
+ struct blkfront_info *info = dev_get_drvdata(&dev->dev);
struct block_device *bd;
dev_dbg(&dev->dev, "blkfront:backend_changed.\n");
@@ -997,7 +997,7 @@ static void backend_changed(struct xenbu
static int blkfront_remove(struct xenbus_device *dev)
{
- struct blkfront_info *info = dev->dev.driver_data;
+ struct blkfront_info *info = dev_get_drvdata(&dev->dev);
dev_dbg(&dev->dev, "blkfront_remove: %s removed\n", dev->nodename);
@@ -1010,7 +1010,7 @@ static int blkfront_remove(struct xenbus
static int blkfront_is_ready(struct xenbus_device *dev)
{
- struct blkfront_info *info = dev->dev.driver_data;
+ struct blkfront_info *info = dev_get_drvdata(&dev->dev);
return info->is_ready;
}
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] xen block: remove driver_data direct access of struct device
2009-04-30 22:24 [PATCH] xen block: remove driver_data direct access of struct device Greg Kroah-Hartman
@ 2009-04-30 22:35 ` Chris Wright
2009-04-30 22:37 ` Greg KH
0 siblings, 1 reply; 6+ messages in thread
From: Chris Wright @ 2009-04-30 22:35 UTC (permalink / raw)
To: Greg Kroah-Hartman; +Cc: Chris Wright, virtualization, xen-devel, Greg KH
* Greg Kroah-Hartman (gregkh@suse.de) wrote:
> 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: xen-devel@lists.xensource.com
> Cc: virtualization@lists.osdl.org
> Cc: Chris Wright <chrisw@sous-sol.org>
> Cc: Jeremy Fitzhardinge <jeremy@xensource.com>
> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Acked-by: Chris Wright <chrisw@sous-sol.org>
after...
> - dev->dev.driver_data = NULL;
> + dev_det_drvdata(&dev->dev, NULL);
...fixing your fingers/script so it compiles ;-)
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] xen block: remove driver_data direct access of struct device
2009-04-30 22:35 ` Chris Wright
@ 2009-04-30 22:37 ` Greg KH
2009-04-30 22:43 ` Chris Wright
0 siblings, 1 reply; 6+ messages in thread
From: Greg KH @ 2009-04-30 22:37 UTC (permalink / raw)
To: Chris Wright; +Cc: xen-devel, virtualization, Greg Kroah-Hartman
On Thu, Apr 30, 2009 at 03:35:35PM -0700, Chris Wright wrote:
> * Greg Kroah-Hartman (gregkh@suse.de) wrote:
> > 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: xen-devel@lists.xensource.com
> > Cc: virtualization@lists.osdl.org
> > Cc: Chris Wright <chrisw@sous-sol.org>
> > Cc: Jeremy Fitzhardinge <jeremy@xensource.com>
> > Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
>
> Acked-by: Chris Wright <chrisw@sous-sol.org>
Thanks, will add it. Any objections for this to go through my
driver-core tree to Linus for 2.6.31?
> after...
>
> > - dev->dev.driver_data = NULL;
> > + dev_det_drvdata(&dev->dev, NULL);
>
> ...fixing your fingers/script so it compiles ;-)
Doh!
And here I thought I had built that one, I guess I hadn't, my mistake.
Thanks for catching that, I've now fixed it.
greg k-h
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] xen block: remove driver_data direct access of struct device
2009-04-30 22:37 ` Greg KH
@ 2009-04-30 22:43 ` Chris Wright
2009-04-30 23:25 ` Jeremy Fitzhardinge
0 siblings, 1 reply; 6+ messages in thread
From: Chris Wright @ 2009-04-30 22:43 UTC (permalink / raw)
To: Greg KH; +Cc: Chris Wright, xen-devel, Greg Kroah-Hartman, virtualization
* Greg KH (greg@kroah.com) wrote:
> On Thu, Apr 30, 2009 at 03:35:35PM -0700, Chris Wright wrote:
> > * Greg Kroah-Hartman (gregkh@suse.de) wrote:
> > > 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: xen-devel@lists.xensource.com
> > > Cc: virtualization@lists.osdl.org
> > > Cc: Chris Wright <chrisw@sous-sol.org>
> > > Cc: Jeremy Fitzhardinge <jeremy@xensource.com>
> > > Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
> >
> > Acked-by: Chris Wright <chrisw@sous-sol.org>
>
> Thanks, will add it. Any objections for this to go through my
> driver-core tree to Linus for 2.6.31?
None from me.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] xen block: remove driver_data direct access of struct device
2009-04-30 22:43 ` Chris Wright
@ 2009-04-30 23:25 ` Jeremy Fitzhardinge
2009-04-30 23:38 ` Greg KH
0 siblings, 1 reply; 6+ messages in thread
From: Jeremy Fitzhardinge @ 2009-04-30 23:25 UTC (permalink / raw)
To: Chris Wright; +Cc: Greg KH, xen-devel, Greg Kroah-Hartman, virtualization
Chris Wright wrote:
> * Greg KH (greg@kroah.com) wrote:
>
>> Thanks, will add it. Any objections for this to go through my
>> driver-core tree to Linus for 2.6.31?
>>
>
> None from me.
>
Fine by me.
Acked-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
J
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] xen block: remove driver_data direct access of struct device
2009-04-30 23:25 ` Jeremy Fitzhardinge
@ 2009-04-30 23:38 ` Greg KH
0 siblings, 0 replies; 6+ messages in thread
From: Greg KH @ 2009-04-30 23:38 UTC (permalink / raw)
To: Jeremy Fitzhardinge
Cc: Chris Wright, virtualization, xen-devel, Greg Kroah-Hartman
On Thu, Apr 30, 2009 at 04:25:36PM -0700, Jeremy Fitzhardinge wrote:
> Chris Wright wrote:
> > * Greg KH (greg@kroah.com) wrote:
> >
> >> Thanks, will add it. Any objections for this to go through my
> >> driver-core tree to Linus for 2.6.31?
> >>
> >
> > None from me.
> >
>
> Fine by me.
>
> Acked-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Thanks, will add this ack and push it myself.
greg k-h
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2009-04-30 23:38 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:24 [PATCH] xen block: remove driver_data direct access of struct device Greg Kroah-Hartman
2009-04-30 22:35 ` Chris Wright
2009-04-30 22:37 ` Greg KH
2009-04-30 22:43 ` Chris Wright
2009-04-30 23:25 ` Jeremy Fitzhardinge
2009-04-30 23:38 ` Greg KH
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).