From: <itai.katz@freescale.com>
To: <gregkh@linuxfoundation.org>, <arnd@arndb.de>,
<devel@driverdev.osuosl.org>, <linux-kernel@vger.kernel.org>
Cc: <stuart.yoder@freescale.com>, <german.rivera@freescale.com>,
<lijun.pan@freescale.com>, <scottwood@freescale.com>,
<agraf@suse.de>, <bhamciu1@freescale.com>, <R89243@freescale.com>,
<bhupesh.sharma@freescale.com>, <nir.erez@freescale.com>,
<richard.schmitt@freescale.com>, <dan.carpenter@oracle.com>,
Itai Katz <itai.katz@freescale.com>
Subject: [PATCH 1/5] staging: fsl-mc: abstract test for existence of fsl-mc bus
Date: Sun, 4 Oct 2015 10:09:50 +0300 [thread overview]
Message-ID: <1443942594-7189-2-git-send-email-itai.katz@freescale.com> (raw)
In-Reply-To: <1443942594-7189-1-git-send-email-itai.katz@freescale.com>
From: Itai Katz <itai.katz@freescale.com>
Add function to test for existence of an fsl-mc bus instance
instead of doing this by looking directly at a field in the
bus type struct.
Signed-off-by: Itai Katz <itai.katz@freescale.com>
---
drivers/staging/fsl-mc/bus/mc-bus.c | 13 +++++++++++--
drivers/staging/fsl-mc/include/mc.h | 2 ++
2 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/fsl-mc/bus/mc-bus.c b/drivers/staging/fsl-mc/bus/mc-bus.c
index 92e0702..2aaeb3a 100644
--- a/drivers/staging/fsl-mc/bus/mc-bus.c
+++ b/drivers/staging/fsl-mc/bus/mc-bus.c
@@ -39,7 +39,7 @@ static int fsl_mc_bus_match(struct device *dev, struct device_driver *drv)
bool major_version_mismatch = false;
bool minor_version_mismatch = false;
- if (WARN_ON(!fsl_mc_bus_type.dev_root))
+ if (WARN_ON(!fsl_mc_bus_exists()))
goto out;
if (!mc_drv->match_id_table)
@@ -206,6 +206,15 @@ void fsl_mc_driver_unregister(struct fsl_mc_driver *mc_driver)
}
EXPORT_SYMBOL_GPL(fsl_mc_driver_unregister);
+/**
+ * fsl_mc_bus_exists - check if a root dprc exists
+ */
+bool fsl_mc_bus_exists(void)
+{
+ return fsl_mc_bus_type.dev_root;
+}
+EXPORT_SYMBOL_GPL(fsl_mc_bus_exists);
+
static int get_dprc_icid(struct fsl_mc_io *mc_io,
int container_id, u16 *icid)
{
@@ -407,7 +416,7 @@ int fsl_mc_device_add(struct dprc_obj_desc *obj_desc,
mc_io2 = mc_io;
- if (!fsl_mc_bus_type.dev_root)
+ if (!fsl_mc_bus_exists())
fsl_mc_bus_type.dev_root = &mc_dev->dev;
}
diff --git a/drivers/staging/fsl-mc/include/mc.h b/drivers/staging/fsl-mc/include/mc.h
index 860bf26..a933291 100644
--- a/drivers/staging/fsl-mc/include/mc.h
+++ b/drivers/staging/fsl-mc/include/mc.h
@@ -182,6 +182,8 @@ int __must_check __fsl_mc_driver_register(struct fsl_mc_driver *fsl_mc_driver,
void fsl_mc_driver_unregister(struct fsl_mc_driver *driver);
+bool fsl_mc_bus_exists(void);
+
int __must_check fsl_mc_portal_allocate(struct fsl_mc_device *mc_dev,
u16 mc_io_flags,
struct fsl_mc_io **new_mc_io);
--
1.7.9.5
next prev parent reply other threads:[~2015-10-04 7:25 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-04 7:09 [PATCH 0/5] staging: fsl-mc: multiple root DPRCs itai.katz
2015-10-04 7:09 ` itai.katz [this message]
2015-10-04 7:09 ` [PATCH 2/5] staging: fsl-mc: abstract test for whether a dprc is a root dprc itai.katz
2015-10-06 8:47 ` Mike Rapoport
2015-10-06 13:39 ` Katz Itai
2015-10-04 7:09 ` [PATCH 3/5] staging: fsl-mc: add function to return pointer to " itai.katz
2015-10-04 7:09 ` [PATCH 4/5] staging: fsl-mc: add counter to track number of root DPRCs itai.katz
2015-10-04 7:09 ` [PATCH 5/5] staging: fsl-mc: remove references to dev_root itai.katz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1443942594-7189-2-git-send-email-itai.katz@freescale.com \
--to=itai.katz@freescale.com \
--cc=R89243@freescale.com \
--cc=agraf@suse.de \
--cc=arnd@arndb.de \
--cc=bhamciu1@freescale.com \
--cc=bhupesh.sharma@freescale.com \
--cc=dan.carpenter@oracle.com \
--cc=devel@driverdev.osuosl.org \
--cc=german.rivera@freescale.com \
--cc=gregkh@linuxfoundation.org \
--cc=lijun.pan@freescale.com \
--cc=linux-kernel@vger.kernel.org \
--cc=nir.erez@freescale.com \
--cc=richard.schmitt@freescale.com \
--cc=scottwood@freescale.com \
--cc=stuart.yoder@freescale.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®