diff mbox

[56/64] parisc: remove driver_data direct access of struct device

Message ID 1245131213-24168-56-git-send-email-gregkh@suse.de (mailing list archive)
State Superseded
Delegated to: kyle mcmartin
Headers show

Commit Message

Greg Kroah-Hartman June 16, 2009, 5:46 a.m. UTC
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: linux-parisc@vger.kernel.org
Cc: Helge Deller <deller@gmx.de>
Cc: Kyle McMartin <kyle@mcmartin.ca>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
 drivers/parisc/eisa.c      |    2 +-
 drivers/parisc/sba_iommu.c |    6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

Comments

kyle mcmartin June 16, 2009, 3:15 p.m. UTC | #1
On Mon, Jun 15, 2009 at 10:46:45PM -0700, Greg Kroah-Hartman 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: linux-parisc@vger.kernel.org
> Cc: Helge Deller <deller@gmx.de>
> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

Acked-by: Kyle McMartin <kyle@mcmartin.ca>

Do you want to push it along with the rest of them, or would you like me
to apply it?

regards, Kyle
--
To unsubscribe from this list: send the line "unsubscribe linux-parisc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Greg Kroah-Hartman June 16, 2009, 4:25 p.m. UTC | #2
On Tue, Jun 16, 2009 at 11:15:24AM -0400, Kyle McMartin wrote:
> On Mon, Jun 15, 2009 at 10:46:45PM -0700, Greg Kroah-Hartman 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: linux-parisc@vger.kernel.org
> > Cc: Helge Deller <deller@gmx.de>
> > Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
> 
> Acked-by: Kyle McMartin <kyle@mcmartin.ca>
> 
> Do you want to push it along with the rest of them, or would you like me
> to apply it?

This was sent a while ago, and is going to Linus right now.  So if you
want to also add it to your tree, so that it is sure to not get lost,
that is fine with me :)

thanks,

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-parisc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
kyle mcmartin June 16, 2009, 5:24 p.m. UTC | #3
On Tue, Jun 16, 2009 at 09:25:24AM -0700, Greg KH wrote:
> On Tue, Jun 16, 2009 at 11:15:24AM -0400, Kyle McMartin wrote:
> > On Mon, Jun 15, 2009 at 10:46:45PM -0700, Greg Kroah-Hartman 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: linux-parisc@vger.kernel.org
> > > Cc: Helge Deller <deller@gmx.de>
> > > Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
> > 
> > Acked-by: Kyle McMartin <kyle@mcmartin.ca>
> > 
> > Do you want to push it along with the rest of them, or would you like me
> > to apply it?
> 
> This was sent a while ago, and is going to Linus right now.  So if you
> want to also add it to your tree, so that it is sure to not get lost,
> that is fine with me :)
> 

Ah, it probably already was, but I've been so busy in the last month or
two that I missed sending anything after .30-rc$early. (I only asked
because Linus wasn't on the CC so I figured it was out for review
again, or something.)

cheers, Kyle
--
To unsubscribe from this list: send the line "unsubscribe linux-parisc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/parisc/eisa.c b/drivers/parisc/eisa.c
index f415fdd..5b89f40 100644
--- a/drivers/parisc/eisa.c
+++ b/drivers/parisc/eisa.c
@@ -373,7 +373,7 @@  static int __init eisa_probe(struct parisc_device *dev)
 	if (result >= 0) {
 		/* FIXME : Don't enumerate the bus twice. */
 		eisa_dev.root.dev = &dev->dev;
-		dev->dev.driver_data = &eisa_dev.root;
+		dev_set_drvdata(&dev->dev, &eisa_dev.root);
 		eisa_dev.root.bus_base_addr = 0;
 		eisa_dev.root.res = &eisa_dev.hba.io_space;
 		eisa_dev.root.slots = result;
diff --git a/drivers/parisc/sba_iommu.c b/drivers/parisc/sba_iommu.c
index e5999c4..d46dd57 100644
--- a/drivers/parisc/sba_iommu.c
+++ b/drivers/parisc/sba_iommu.c
@@ -2010,7 +2010,7 @@  void __init sba_init(void)
 void * sba_get_iommu(struct parisc_device *pci_hba)
 {
 	struct parisc_device *sba_dev = parisc_parent(pci_hba);
-	struct sba_device *sba = sba_dev->dev.driver_data;
+	struct sba_device *sba = dev_get_drvdata(&sba_dev->dev);
 	char t = sba_dev->id.hw_type;
 	int iocnum = (pci_hba->hw_path >> 3);	/* rope # */
 
@@ -2031,7 +2031,7 @@  void * sba_get_iommu(struct parisc_device *pci_hba)
 void sba_directed_lmmio(struct parisc_device *pci_hba, struct resource *r)
 {
 	struct parisc_device *sba_dev = parisc_parent(pci_hba);
-	struct sba_device *sba = sba_dev->dev.driver_data;
+	struct sba_device *sba = dev_get_drvdata(&sba_dev->dev);
 	char t = sba_dev->id.hw_type;
 	int i;
 	int rope = (pci_hba->hw_path & (ROPES_PER_IOC-1));  /* rope # */
@@ -2073,7 +2073,7 @@  void sba_directed_lmmio(struct parisc_device *pci_hba, struct resource *r)
 void sba_distributed_lmmio(struct parisc_device *pci_hba, struct resource *r )
 {
 	struct parisc_device *sba_dev = parisc_parent(pci_hba);
-	struct sba_device *sba = sba_dev->dev.driver_data;
+	struct sba_device *sba = dev_get_drvdata(&sba_dev->dev);
 	char t = sba_dev->id.hw_type;
 	int base, size;
 	int rope = (pci_hba->hw_path & (ROPES_PER_IOC-1));  /* rope # */