Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1255593 > unrolled thread

Re: [PATCH 2/5] staging: fsl-mc: define a macro to differentiate root dprc

Started byGreg KH <gregkh@linuxfoundation.org>
First post2015-10-26 01:20 +0100
Last post2015-10-26 17:20 +0100
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH 2/5] staging: fsl-mc: define a macro to differentiate  root dprc Greg KH <gregkh@linuxfoundation.org> - 2015-10-26 01:20 +0100
    RE: [PATCH 2/5] staging: fsl-mc: define a macro to differentiate root  dprc Lijun Pan <Lijun.Pan@freescale.com> - 2015-10-26 17:20 +0100

#1255593 — Re: [PATCH 2/5] staging: fsl-mc: define a macro to differentiate root dprc

FromGreg KH <gregkh@linuxfoundation.org>
Date2015-10-26 01:20 +0100
SubjectRe: [PATCH 2/5] staging: fsl-mc: define a macro to differentiate root dprc
Message-ID<qnDG2-1hB-15@gated-at.bofh.it>
On Sun, Oct 25, 2015 at 05:41:20PM -0500, Lijun Pan wrote:
> Define is_root_dprc(dev) to tell whether a device is
> root dprc or not via platform_bus_type.
> 
> Signed-off-by: Lijun Pan <Lijun.Pan@freescale.com>
> ---
>  drivers/staging/fsl-mc/include/mc.h | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/drivers/staging/fsl-mc/include/mc.h b/drivers/staging/fsl-mc/include/mc.h
> index a933291..483763e 100644
> --- a/drivers/staging/fsl-mc/include/mc.h
> +++ b/drivers/staging/fsl-mc/include/mc.h
> @@ -14,6 +14,7 @@
>  #include <linux/device.h>
>  #include <linux/mod_devicetable.h>
>  #include <linux/list.h>
> +#include <linux/platform_device.h>
>  #include "../include/dprc.h"
>  
>  #define FSL_MC_VENDOR_FREESCALE	0x1957
> @@ -109,6 +110,15 @@ struct fsl_mc_resource {
>  #define FSL_MC_IS_DPRC	0x0001
>  
>  /**
> +  * root dprc's parent is a platform device
> +  * that platform device's bus type is platform_bus_type.
> +  */
> +#define is_root_dprc(dev) \
> +	((to_fsl_mc_device(dev)->flags & FSL_MC_IS_DPRC) && \
> +	((dev)->bus == &fsl_mc_bus_type) && \
> +	((dev)->parent->bus == &platform_bus_type))
> +

It's best to make this type of thing a static inline function, to ensure
you get the correct typechecking.

thanks,

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1256139 — RE: [PATCH 2/5] staging: fsl-mc: define a macro to differentiate root dprc

FromLijun Pan <Lijun.Pan@freescale.com>
Date2015-10-26 17:20 +0100
SubjectRE: [PATCH 2/5] staging: fsl-mc: define a macro to differentiate root dprc
Message-ID<qnSF4-1ZZ-9@gated-at.bofh.it>
In reply to#1255593

> -----Original Message-----
> From: Greg KH [mailto:gregkh@linuxfoundation.org]
> Sent: Sunday, October 25, 2015 7:13 PM
> To: Pan Lijun-B44306 <Lijun.Pan@freescale.com>
> Cc: arnd@arndb.de; devel@driverdev.osuosl.org; linux-
> kernel@vger.kernel.org; Yoder Stuart-B08248 <stuart.yoder@freescale.com>;
> katz Itai-RM05202 <itai.katz@freescale.com>; Rivera Jose-B46482
> <German.Rivera@freescale.com>; Li Yang-Leo-R58472 <LeoLi@freescale.com>;
> Wood Scott-B07421 <scottwood@freescale.com>; agraf@suse.de; Hamciuc
> Bogdan-BHAMCIU1 <bhamciu1@freescale.com>; Marginean Alexandru-R89243
> <R89243@freescale.com>; Sharma Bhupesh-B45370
> <bhupesh.sharma@freescale.com>; Erez Nir-RM30794
> <nir.erez@freescale.com>; Schmitt Richard-B43082
> <richard.schmitt@freescale.com>; dan.carpenter@oracle.com
> Subject: Re: [PATCH 2/5] staging: fsl-mc: define a macro to differentiate root
> dprc
> 
> On Sun, Oct 25, 2015 at 05:41:20PM -0500, Lijun Pan wrote:
> > Define is_root_dprc(dev) to tell whether a device is root dprc or not
> > via platform_bus_type.
> >
> > Signed-off-by: Lijun Pan <Lijun.Pan@freescale.com>
> > ---
> >  drivers/staging/fsl-mc/include/mc.h | 10 ++++++++++
> >  1 file changed, 10 insertions(+)
> >
> > diff --git a/drivers/staging/fsl-mc/include/mc.h
> > b/drivers/staging/fsl-mc/include/mc.h
> > index a933291..483763e 100644
> > --- a/drivers/staging/fsl-mc/include/mc.h
> > +++ b/drivers/staging/fsl-mc/include/mc.h
> > @@ -14,6 +14,7 @@
> >  #include <linux/device.h>
> >  #include <linux/mod_devicetable.h>
> >  #include <linux/list.h>
> > +#include <linux/platform_device.h>
> >  #include "../include/dprc.h"
> >
> >  #define FSL_MC_VENDOR_FREESCALE	0x1957
> > @@ -109,6 +110,15 @@ struct fsl_mc_resource {
> >  #define FSL_MC_IS_DPRC	0x0001
> >
> >  /**
> > +  * root dprc's parent is a platform device
> > +  * that platform device's bus type is platform_bus_type.
> > +  */
> > +#define is_root_dprc(dev) \
> > +	((to_fsl_mc_device(dev)->flags & FSL_MC_IS_DPRC) && \
> > +	((dev)->bus == &fsl_mc_bus_type) && \
> > +	((dev)->parent->bus == &platform_bus_type))
> > +
> 
> It's best to make this type of thing a static inline function, to ensure you get the
> correct typechecking.
> 

I will take your suggestion and make changes in patch v2.
Lijun


> thanks,
> 
> greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web