[PATCH] powerpc/85xx: Add platform_device declaration to fsl_pci.h

Jia Hongtao-B38951 B38951 at freescale.com
Fri Mar 15 17:15:53 EST 2013



> -----Original Message-----
> From: Kumar Gala [mailto:galak at kernel.crashing.org]
> Sent: Wednesday, March 13, 2013 4:46 AM
> To: Jia Hongtao-B38951
> Cc: linuxppc-dev at lists.ozlabs.org; Wood Scott-B07421; Li Yang-R58472
> Subject: Re: [PATCH] powerpc/85xx: Add platform_device declaration to
> fsl_pci.h
> 
> 
> On Mar 10, 2013, at 9:36 PM, Jia Hongtao-B38951 wrote:
> 
> >
> >
> >> -----Original Message-----
> >> From: Kumar Gala [mailto:galak at kernel.crashing.org]
> >> Sent: Saturday, March 09, 2013 4:38 AM
> >> To: Jia Hongtao-B38951
> >> Cc: linuxppc-dev at lists.ozlabs.org; Wood Scott-B07421; Li Yang-R58472
> >> Subject: Re: [PATCH] powerpc/85xx: Add platform_device declaration to
> >> fsl_pci.h
> >>
> >>
> >> On Mar 4, 2013, at 2:40 AM, Jia Hongtao wrote:
> >>
> >>> mpc85xx_pci_err_probe(struct platform_device *op) need
> platform_device
> >>> declaration for definition. Otherwise, it will cause compile error if
> >>> any files including fsl_pci.h without declaration of platform_device.
> >>>
> >>> Signed-off-by: Jia Hongtao <B38951 at freescale.com>
> >>> ---
> >>> arch/powerpc/sysdev/fsl_pci.h |    2 ++
> >>> 1 files changed, 2 insertions(+), 0 deletions(-)
> >>>
> >>
> >> Where does the compile error show up?
> >>
> >> - k
> >
> > The function mpc85xx_pci_err_probe(struct platform_device *op) need
> > *platform_device* declaration so <linux/platform_device.h> must be
> > included.
> >
> > For now there is no compile error occurred just because the file that
> > need fsl_pci.h happened to include <linux/platform_device.h> already.
> >
> > If not the compile error log will be like this:
> > "
> > In file included from arch/powerpc/kernel/traps.c:62:0:
> > arch/powerpc/sysdev/fsl_pci.h:108:34: error: 'struct platform_device'
> declared inside parameter list
> > arch/powerpc/sysdev/fsl_pci.h:108:34: error: its scope is only this
> definition or declaration, which is probably not what you want
> > "
> >
> > You mean I have to show the compile error log in patch description?
> 
> Not necessarily, I'm just trying to decide if we should include
> <linux/platform_device.h> or just do:
> 
> struct platform_device;
> 
> near the top of fsl_pci.h.

Actually just add "struct platform_device;" works too.
Only mpc85xx_edac.c use mpc85xx_pci_err_probe(struct platform_device *op)
and <linux/platform_device.h> has already included there.

I will update and send the new patch.

-Hongtao. 

> 
> >
> > Thanks.
> > -Hongtao.
> >
> >>
> >>> diff --git a/arch/powerpc/sysdev/fsl_pci.h
> >>> b/arch/powerpc/sysdev/fsl_pci.h index c495c00..df66721 100644
> >>> --- a/arch/powerpc/sysdev/fsl_pci.h
> >>> +++ b/arch/powerpc/sysdev/fsl_pci.h
> >>> @@ -14,6 +14,8 @@
> >>> #ifndef __POWERPC_FSL_PCI_H
> >>> #define __POWERPC_FSL_PCI_H
> >>>
> >>> +#include <linux/platform_device.h>
> >>> +
> >>> #define PCIE_LTSSM	0x0404		/* PCIE Link Training and
> >> Status */
> >>> #define PCIE_LTSSM_L0	0x16		/* L0 state */
> >>> #define PCIE_IP_REV_2_2		0x02080202 /* PCIE IP block version
> >> Rev2.2 */
> >>> --
> >>> 1.7.5.1
> >>>
> >>
> >
> 




More information about the Linuxppc-dev mailing list