mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
To: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>,
	barebox@lists.infradead.org
Subject: [PATCH v2 06/14] bus: mvebu-mbus: Drop device reference
Date: Mon, 20 Apr 2015 22:11:18 +0200	[thread overview]
Message-ID: <1429560686-11391-7-git-send-email-sebastian.hesselbarth@gmail.com> (raw)
In-Reply-To: <1429560686-11391-1-git-send-email-sebastian.hesselbarth@gmail.com>

Prior converting mbus driver from a platform device back to directly
called SoC driver, drop the device_d reference and covert dev_foo to
pr_foo.

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
---
Cc: barebox@lists.infradead.org
Cc: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 drivers/bus/mvebu-mbus.c | 28 ++++++++++++++--------------
 1 file changed, 14 insertions(+), 14 deletions(-)

diff --git a/drivers/bus/mvebu-mbus.c b/drivers/bus/mvebu-mbus.c
index 75c357a869ef..077d7ccb83ca 100644
--- a/drivers/bus/mvebu-mbus.c
+++ b/drivers/bus/mvebu-mbus.c
@@ -50,6 +50,8 @@
  *   configuration (file 'devices').
  */
 
+#define pr_fmt(fmt)	"mvebu-mbus: " fmt
+
 #include <common.h>
 #include <init.h>
 #include <io.h>
@@ -100,7 +102,7 @@ struct mvebu_mbus_soc_data {
 };
 
 struct mvebu_mbus_state {
-	struct device_d *dev;
+	struct device_node *np;
 	void __iomem *mbuswins_base;
 	void __iomem *sdramwins_base;
 	struct dentry *debugfs_root;
@@ -496,7 +498,7 @@ int mvebu_mbus_add_window_remap_by_id(unsigned int target,
 	struct mvebu_mbus_state *s = &mbus_state;
 
 	if (!mvebu_mbus_window_conflicts(s, base, size, target, attribute)) {
-		dev_err(s->dev, "cannot add window '%x:%x', conflicts with another window\n",
+		pr_err("cannot add window '%x:%x', conflicts with another window\n",
 		       target, attribute);
 		return -EINVAL;
 	}
@@ -552,14 +554,14 @@ static int mbus_dt_setup_win(struct mvebu_mbus_state *mbus,
 			     u32 base, u32 size, u8 target, u8 attr)
 {
 	if (!mvebu_mbus_window_conflicts(mbus, base, size, target, attr)) {
-		dev_err(mbus->dev, "cannot add window '%04x:%04x', conflicts with another window\n",
+		pr_err("cannot add window '%04x:%04x', conflicts with another window\n",
 		       target, attr);
 		return -EBUSY;
 	}
 
 	if (mvebu_mbus_alloc_window(mbus, base, size, MVEBU_MBUS_NO_REMAP,
 				    target, attr)) {
-		dev_err(mbus->dev, "cannot add window '%04x:%04x', too many windows\n",
+		pr_err("cannot add window '%04x:%04x', too many windows\n",
 		       target, attr);
 		return -ENOMEM;
 	}
@@ -571,7 +573,7 @@ static int mbus_parse_ranges(struct mvebu_mbus_state *mbus, int *addr_cells,
 			     int *cell_count, const __be32 **ranges_start,
 			     const __be32 **ranges_end)
 {
-	struct device_node *node = mbus->dev->device_node;
+	struct device_node *node = mbus->np;
 	const __be32 *prop;
 	int ranges_len, tuple_len;
 
@@ -596,8 +598,7 @@ static int mbus_parse_ranges(struct mvebu_mbus_state *mbus, int *addr_cells,
 	tuple_len = (*cell_count) * sizeof(__be32);
 
 	if (ranges_len % tuple_len) {
-		dev_warn(mbus->dev, "malformed ranges entry '%s'\n",
-			node->name);
+		pr_warn("malformed ranges entry '%s'\n", node->name);
 		return -EINVAL;
 	}
 	return 0;
@@ -679,36 +680,35 @@ static int mvebu_mbus_probe(struct device_d *dev)
 	const __be32 *prop;
 	int win;
 
-	mbus_state.dev = dev;
-
 	np = of_find_matching_node_and_match(NULL, mvebu_mbus_dt_ids, &match);
 	if (!np) {
-		dev_err(dev, "could not find a matching SoC family\n");
+		pr_err("could not find a matching SoC family\n");
 		return -ENODEV;
 	}
+	mbus_state.np = np;
 	mbus_state.soc = (struct mvebu_mbus_soc_data *)match->data;
 
 	prop = of_get_property(np, "controller", NULL);
 	if (!prop) {
-		dev_err(dev, "required 'controller' property missing\n");
+		pr_err("required 'controller' property missing\n");
 		return -EINVAL;
 	}
 
 	controller = of_find_node_by_phandle(be32_to_cpup(prop));
 	if (!controller) {
-		dev_err(dev, "could not find an 'mbus-controller' node\n");
+		pr_err("could not find an 'mbus-controller' node\n");
 		return -ENODEV;
 	}
 
 	mbus_state.mbuswins_base = of_iomap(controller, 0);
 	if (!mbus_state.mbuswins_base) {
-		dev_err(dev, "cannot get MBUS register address\n");
+		pr_err("cannot get MBUS register address\n");
 		return -ENOMEM;
 	}
 
 	mbus_state.sdramwins_base = of_iomap(controller, 1);
 	if (!mbus_state.sdramwins_base) {
-		dev_err(dev, "cannot get SDRAM register address\n");
+		pr_err("cannot get SDRAM register address\n");
 		return -ENOMEM;
 	}
 
-- 
2.1.0


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  parent reply	other threads:[~2015-04-20 20:12 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-20 20:11 [PATCH v2 00/14] Add support for Lenovo ix4-300d NAS Sebastian Hesselbarth
2015-04-20 20:11 ` [PATCH v2 01/14] net: phy: Support Marvell 88E1318S PHY Sebastian Hesselbarth
2015-04-20 20:11 ` [PATCH v2 02/14] gpio: Add driver for 74x164 compatible shift-registers Sebastian Hesselbarth
2015-04-20 20:11 ` [PATCH v2 03/14] spi: ath79: move spidelay from spi-bitbang-txrx Sebastian Hesselbarth
2015-04-20 20:11 ` [PATCH v2 04/14] spi: Add SPI GPIO bitbang driver Sebastian Hesselbarth
2015-04-20 20:11 ` [PATCH v2 05/14] bus: mvebu-mbus: Remove coherency attribute Sebastian Hesselbarth
2015-04-20 20:11 ` Sebastian Hesselbarth [this message]
2015-04-20 20:11 ` [PATCH v2 07/14] bus: mvebu-mbus: Convert mbus platform driver to direct driver Sebastian Hesselbarth
2015-04-20 20:11 ` [PATCH v2 08/14] ARM: mvebu: Move PCIe register defines to socid.h Sebastian Hesselbarth
2015-04-20 20:11 ` [PATCH v2 09/14] ARM: mvebu: armada-xp: Fixup broken MV78230-A0 SoC ID Sebastian Hesselbarth
2015-04-20 20:11 ` [PATCH v2 10/14] ARM: mvebu: armada-xp: Limit PUP access to Armada XP Sebastian Hesselbarth
2015-04-20 20:11 ` [PATCH v2 11/14] ARM: mvebu: armada-xp: Use MBUS_ERR_PROP_EN define Sebastian Hesselbarth
2015-04-20 20:11 ` [PATCH v2 12/14] ARM: mvebu: armada-xp: Sort boards and images alphabetically Sebastian Hesselbarth
2015-04-20 20:11 ` [PATCH v2 13/14] ARM: mvebu: armada-xp: Add Lenovo Iomega ix4-300d Sebastian Hesselbarth
2015-04-20 20:11 ` [PATCH v2 14/14] ARM: Add Lenovo ix4 and related drivers to mvebu_defconfig Sebastian Hesselbarth
2015-04-23  5:57 ` [PATCH v2 00/14] Add support for Lenovo ix4-300d NAS Sascha Hauer

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=1429560686-11391-7-git-send-email-sebastian.hesselbarth@gmail.com \
    --to=sebastian.hesselbarth@gmail.com \
    --cc=barebox@lists.infradead.org \
    --cc=thomas.petazzoni@free-electrons.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