[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1445812883-23551-3-git-send-email-Lijun.Pan@freescale.com>
Date: Sun, 25 Oct 2015 17:41:20 -0500
From: Lijun Pan <Lijun.Pan@...escale.com>
To: <gregkh@...uxfoundation.org>, <arnd@...db.de>,
<devel@...verdev.osuosl.org>, <linux-kernel@...r.kernel.org>
CC: <stuart.yoder@...escale.com>, <itai.katz@...escale.com>,
<german.rivera@...escale.com>, <leoli@...escale.com>,
<scottwood@...escale.com>, <agraf@...e.de>,
<bhamciu1@...escale.com>, <R89243@...escale.com>,
<bhupesh.sharma@...escale.com>, <nir.erez@...escale.com>,
<richard.schmitt@...escale.com>, <dan.carpenter@...cle.com>,
Lijun Pan <Lijun.Pan@...escale.com>
Subject: [PATCH 2/5] staging: fsl-mc: define a macro to differentiate root dprc
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@...escale.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))
+
+/**
* Default DMA mask for devices on a fsl-mc bus
*/
#define FSL_MC_DEFAULT_DMA_MASK (~0ULL)
--
2.3.3
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists