* [PATCH] parisc: remove driver_data direct access of struct device
@ 2009-05-04 20:13 Greg Kroah-Hartman
2009-05-04 21:33 ` Kyle McMartin
0 siblings, 1 reply; 3+ messages in thread
From: Greg Kroah-Hartman @ 2009-05-04 20:13 UTC (permalink / raw)
To: Helge Deller, Kyle McMartin; +Cc: linux-parisc, 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: 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(-)
--- a/drivers/parisc/eisa.c
+++ b/drivers/parisc/eisa.c
@@ -373,7 +373,7 @@ static int __init eisa_probe(struct pari
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;
--- 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_devic
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_de
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 # */
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] parisc: remove driver_data direct access of struct device
2009-05-04 20:13 [PATCH] parisc: remove driver_data direct access of struct device Greg Kroah-Hartman
@ 2009-05-04 21:33 ` Kyle McMartin
2009-05-04 21:36 ` Greg KH
0 siblings, 1 reply; 3+ messages in thread
From: Kyle McMartin @ 2009-05-04 21:33 UTC (permalink / raw)
To: Greg Kroah-Hartman; +Cc: Helge Deller, Kyle McMartin, linux-parisc, Greg KH
On Mon, May 04, 2009 at 01:13:59PM -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.
>
Cool, applied and will be sent along tonight unless you'd rather merge
it yourself in which case:
Acked-by: Kyle McMartin <kyle@mcmartin.ca>
> 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(-)
>
> --- a/drivers/parisc/eisa.c
> +++ b/drivers/parisc/eisa.c
> @@ -373,7 +373,7 @@ static int __init eisa_probe(struct pari
> 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;
> --- 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_devic
> 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_de
> 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 # */
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] parisc: remove driver_data direct access of struct device
2009-05-04 21:33 ` Kyle McMartin
@ 2009-05-04 21:36 ` Greg KH
0 siblings, 0 replies; 3+ messages in thread
From: Greg KH @ 2009-05-04 21:36 UTC (permalink / raw)
To: Kyle McMartin; +Cc: Helge Deller, linux-parisc, Greg KH
On Mon, May 04, 2009 at 05:33:49PM -0400, Kyle McMartin wrote:
> On Mon, May 04, 2009 at 01:13:59PM -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.
> >
>
> Cool, applied and will be sent along tonight unless you'd rather merge
> it yourself in which case:
>
> Acked-by: Kyle McMartin <kyle@mcmartin.ca>
Nope, feel free to send it yourself, no objection from me at all :)
thanks,
greg k-h
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-05-04 21:36 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-04 20:13 [PATCH] parisc: remove driver_data direct access of struct device Greg Kroah-Hartman
2009-05-04 21:33 ` Kyle McMartin
2009-05-04 21:36 ` 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).