Thread (51 messages) flat view 51 messages, 3 authors, 2011-05-19

Re: [PATCH 27/37] powerpc fsl_msi: don't abuse platform_data for driver_data

From: Grant Likely <hidden>
Date: 2011-05-11 19:06:15

On Wed, May 11, 2011 at 7:30 AM, Milton Miller [off-list ref] wrote:
The msi platform device driver was abusing dev.platform_data for its
platform_driver_data. =A0Use the correct pointer for storage.

Platform_data is supposed to be for platforms to communicate to drivers
parameters that are not otherwise discoverable. =A0Its lifetime matches
the platform_device not the platform device driver. =A0It is generally
not needed for drivers that only support systems with device trees.

Signed-off-by: Milton Miller <redacted>
Acked-by: Grant Likely <redacted>
quoted hunk ↗ jump to hunk
---
---
=A0arch/powerpc/sysdev/fsl_msi.c | =A0 =A04 ++--
=A01 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/powerpc/sysdev/fsl_msi.c b/arch/powerpc/sysdev/fsl_msi.=
c
quoted hunk ↗ jump to hunk
index d5679dc..077776c 100644
--- a/arch/powerpc/sysdev/fsl_msi.c
+++ b/arch/powerpc/sysdev/fsl_msi.c
@@ -253,7 +253,7 @@ unlock:
=A0static int fsl_of_msi_remove(struct platform_device *ofdev)
=A0{
- =A0 =A0 =A0 struct fsl_msi *msi =3D ofdev->dev.platform_data;
+ =A0 =A0 =A0 struct fsl_msi *msi =3D platform_get_drvdata(ofdev);
=A0 =A0 =A0 =A0int virq, i;
=A0 =A0 =A0 =A0struct fsl_msi_cascade_data *cascade_data;
@@ -327,7 +327,7 @@ static int __devinit fsl_of_msi_probe(struct platform=
_device *dev)
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0dev_err(&dev->dev, "No memory for MSI stru=
cture\n");
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0return -ENOMEM;
=A0 =A0 =A0 =A0}
- =A0 =A0 =A0 dev->dev.platform_data =3D msi;
+ =A0 =A0 =A0 platform_set_drvdata(dev, msi);

=A0 =A0 =A0 =A0msi->irqhost =3D irq_alloc_host(dev->dev.of_node, IRQ_HOST=
_MAP_LINEAR,
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0NR_MSI_IRQS, &fsl_msi_host_ops, 0);
--
1.7.0.4


--=20
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help