[PATCH] usb: Fix build error due to dma_mask is not at pdev_archdata at ARM

Subsystems: the rest, usb subsystem

STALE5285d REVIEWED: 1 (0M)

1 review trailer.

2 messages, 2 authors, 2012-02-18 · open the first message on its own page

[PATCH] usb: Fix build error due to dma_mask is not at pdev_archdata at ARM

From: Peter Chen <hidden>
Date: 2012-02-16 01:42:07

When build i.mx platform with imx_v6_v7_defconfig, and after adding
USB Gadget support, it has below build error:

CC      drivers/usb/host/fsl-mph-dr-of.o
drivers/usb/host/fsl-mph-dr-of.c: In function 'fsl_usb2_device_register':
drivers/usb/host/fsl-mph-dr-of.c:97: error: 'struct pdev_archdata'
has no member named 'dma_mask'

It has discussed at: http://www.spinics.net/lists/linux-usb/msg57302.html

For PowerPC, there is dma_mask at struct pdev_archdata, but there is
no dma_mask at struct pdev_archdata for ARM. The pdev_archdata is
related to specific platform, it should NOT be accessed by
cross platform drivers, like USB.

The code for pdev_archdata should be useless, as for PowerPC,
it has already gotten the value for pdev->dev.dma_mask at function
arch_setup_pdev_archdata of arch/powerpc/kernel/setup-common.c.

Tested-by: Ramneek Mehresh <redacted>
Signed-off-by: Peter Chen <redacted>
---
 drivers/usb/host/fsl-mph-dr-of.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)
diff --git a/drivers/usb/host/fsl-mph-dr-of.c b/drivers/usb/host/fsl-mph-dr-of.c
index 7916e56..ab333ac 100644
--- a/drivers/usb/host/fsl-mph-dr-of.c
+++ b/drivers/usb/host/fsl-mph-dr-of.c
@@ -94,7 +94,6 @@ struct platform_device * __devinit fsl_usb2_device_register(
 	pdev->dev.parent = &ofdev->dev;
 
 	pdev->dev.coherent_dma_mask = ofdev->dev.coherent_dma_mask;
-	pdev->dev.dma_mask = &pdev->archdata.dma_mask;
 	*pdev->dev.dma_mask = *ofdev->dev.dma_mask;
 
 	retval = platform_device_add_data(pdev, pdata, sizeof(*pdata));
-- 
1.7.0.4

Re: [PATCH] usb: Fix build error due to dma_mask is not at pdev_archdata at ARM

From: Peter Chen <hidden>
Date: 2012-02-18 10:22:48

On Thu, Feb 16, 2012 at 9:41 AM, Peter Chen [off-list ref] wrot=
e:
quoted hunk
When build i.mx platform with imx_v6_v7_defconfig, and after adding
USB Gadget support, it has below build error:

CC =A0 =A0 =A0drivers/usb/host/fsl-mph-dr-of.o
drivers/usb/host/fsl-mph-dr-of.c: In function 'fsl_usb2_device_register':
drivers/usb/host/fsl-mph-dr-of.c:97: error: 'struct pdev_archdata'
has no member named 'dma_mask'

It has discussed at: http://www.spinics.net/lists/linux-usb/msg57302.html

For PowerPC, there is dma_mask at struct pdev_archdata, but there is
no dma_mask at struct pdev_archdata for ARM. The pdev_archdata is
related to specific platform, it should NOT be accessed by
cross platform drivers, like USB.

The code for pdev_archdata should be useless, as for PowerPC,
it has already gotten the value for pdev->dev.dma_mask at function
arch_setup_pdev_archdata of arch/powerpc/kernel/setup-common.c.

Tested-by: Ramneek Mehresh <redacted>
Signed-off-by: Peter Chen <redacted>
---
=A0drivers/usb/host/fsl-mph-dr-of.c | =A0 =A01 -
=A01 files changed, 0 insertions(+), 1 deletions(-)
diff --git a/drivers/usb/host/fsl-mph-dr-of.c b/drivers/usb/host/fsl-mph-=
dr-of.c
quoted hunk
index 7916e56..ab333ac 100644
--- a/drivers/usb/host/fsl-mph-dr-of.c
+++ b/drivers/usb/host/fsl-mph-dr-of.c
@@ -94,7 +94,6 @@ struct platform_device * __devinit fsl_usb2_device_regi=
ster(
=A0 =A0 =A0 =A0pdev->dev.parent =3D &ofdev->dev;

=A0 =A0 =A0 =A0pdev->dev.coherent_dma_mask =3D ofdev->dev.coherent_dma_ma=
sk;
- =A0 =A0 =A0 pdev->dev.dma_mask =3D &pdev->archdata.dma_mask;
=A0 =A0 =A0 =A0*pdev->dev.dma_mask =3D *ofdev->dev.dma_mask;

=A0 =A0 =A0 =A0retval =3D platform_device_add_data(pdev, pdata, sizeof(*p=
data));
Hi Leo, can your guys give me an ACK for it?  Then, Alan can apply it.
Ramneek has already tested it, and confirmed it did not break host
function at his platform.

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at =A0http://vger.kernel.org/majordomo-info.html


--=20
BR,
Peter Chen
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help