[PATCH V6] powerpc/MPIC: Add get_version API both for internal and external use

Scott Wood scottwood at freescale.com
Tue Jul 2 09:58:35 EST 2013


On 07/01/2013 12:26:06 AM, Jia Hongtao wrote:
> From: Hongtao Jia <hongtao.jia at freescale.com>
> 
> MPIC version is useful information for both mpic_alloc() and  
> mpic_init().
> The patch provide an API to get MPIC version for reusing the code.
> Also, some other IP block may need MPIC version for their own use.
> The API for external use is also provided.
> 
> Signed-off-by: Jia Hongtao <hongtao.jia at freescale.com>
> Signed-off-by: Li Yang <leoli at freescale.com>
> ---
> V6:
> * Fix compile error on mpc83xx.

I already applied V5 before realizing that it was this patch that you  
updated, rather than the MSI patch that depends on it.  There is no  
compile error until the MSI patch that starts using this (which I  
haven't yet applied, due to the error).  Could you send a followup  
patch that just adds the stub?

> +/* Get the version of primary MPIC */
> +#ifdef CONFIG_MPIC
> +extern u32 fsl_mpic_primary_get_version(void);
> +#else
> +static inline u32 fsl_mpic_primary_get_version(void)
> +{
> +	return -ENOTSUPP;
> +}
> +#endif
[snip]
> +static u32 fsl_mpic_get_version(struct mpic *mpic)
> +{
> +	u32 brr1;
> +
> +	if (!(mpic->flags & MPIC_FSL))
> +		return 0;

In one case, calling this without having an FSL MPIC returns -ENOTSUPP,  
and in another case it returns 0...  Shouldn't it be consistent?

Also returning a negative number as a u32 is not very nice.

-Scott


More information about the Linuxppc-dev mailing list