linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Rob Herring <robh@kernel.org>
To: linux-kernel@vger.kernel.org
Cc: Andy Shevchenko <andy.shevchenko@gmail.com>,
	Johannes Berg <johannes@sipsolutions.net>,
	Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
	linuxppc-dev@lists.ozlabs.org, alsa-devel@alsa-project.org
Subject: [PATCH v2] sound: Convert to using %pOFn instead of device_node.name
Date: Tue, 28 Aug 2018 10:44:31 -0500	[thread overview]
Message-ID: <20180828154433.5693-5-robh@kernel.org> (raw)
In-Reply-To: <20180828154433.5693-1-robh@kernel.org>
In-Reply-To: <20180828015252.28511-50-robh@kernel.org>

In preparation to remove the node name pointer from struct device_node,
convert printf users to use the %pOFn format specifier.

Cc: Johannes Berg <johannes@sipsolutions.net>
Cc: Jaroslav Kysela <perex@perex.cz>
Cc: Takashi Iwai <tiwai@suse.com>
Cc: linuxppc-dev@lists.ozlabs.org
Cc: alsa-devel@alsa-project.org
Signed-off-by: Rob Herring <robh@kernel.org>
---
v2:
- Fix error in strncmp

 sound/aoa/soundbus/i2sbus/core.c | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/sound/aoa/soundbus/i2sbus/core.c b/sound/aoa/soundbus/i2sbus/core.c
index 000b58522106..bd7c5029fc59 100644
--- a/sound/aoa/soundbus/i2sbus/core.c
+++ b/sound/aoa/soundbus/i2sbus/core.c
@@ -157,18 +157,19 @@ static int i2sbus_add_dev(struct macio_dev *macio,
 	struct device_node *child = NULL, *sound = NULL;
 	struct resource *r;
 	int i, layout = 0, rlen, ok = force;
-	static const char *rnames[] = { "i2sbus: %s (control)",
-					"i2sbus: %s (tx)",
-					"i2sbus: %s (rx)" };
+	char node_name[6];
+	static const char *rnames[] = { "i2sbus: %pOFn (control)",
+					"i2sbus: %pOFn (tx)",
+					"i2sbus: %pOFn (rx)" };
 	static irq_handler_t ints[] = {
 		i2sbus_bus_intr,
 		i2sbus_tx_intr,
 		i2sbus_rx_intr
 	};

-	if (strlen(np->name) != 5)
+	if (snprintf(node_name, sizeof(node_name), "%pOFn", np) != 5)
 		return 0;
-	if (strncmp(np->name, "i2s-", 4))
+	if (strncmp(node_name, "i2s-", 4))
 		return 0;

 	dev = kzalloc(sizeof(struct i2sbus_dev), GFP_KERNEL);
@@ -228,13 +229,13 @@ static int i2sbus_add_dev(struct macio_dev *macio,
 	dev->sound.pcmid = -1;
 	dev->macio = macio;
 	dev->control = control;
-	dev->bus_number = np->name[4] - 'a';
+	dev->bus_number = node_name[4] - 'a';
 	INIT_LIST_HEAD(&dev->sound.codec_list);

 	for (i = aoa_resource_i2smmio; i <= aoa_resource_rxdbdma; i++) {
 		dev->interrupts[i] = -1;
 		snprintf(dev->rnames[i], sizeof(dev->rnames[i]),
-			 rnames[i], np->name);
+			 rnames[i], np);
 	}
 	for (i = aoa_resource_i2smmio; i <= aoa_resource_rxdbdma; i++) {
 		int irq = irq_of_parse_and_map(np, i);
--
2.17.1

  parent reply	other threads:[~2018-08-28 15:44 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20180828015252.28511-1-robh@kernel.org>
2018-08-28  1:52 ` [PATCH] powerpc: Convert to using %pOFn instead of device_node.name Rob Herring
2018-10-04  6:14   ` Michael Ellerman
2018-08-28  1:52 ` [PATCH] i2c: " Rob Herring
2018-08-28  6:33   ` Peter Rosin
2018-08-29 18:42     ` Rob Herring
2018-08-29 19:52       ` Peter Rosin
2018-08-30  0:49         ` Rob Herring
2018-08-28  1:52 ` [PATCH] macintosh: " Rob Herring
2018-08-28  1:52 ` [PATCH] misc: " Rob Herring
2018-08-28  2:35   ` Andrew Donnellan
2018-08-28  1:52 ` [PATCH] soc: " Rob Herring
2018-08-28 10:44   ` Thierry Reding
2018-08-28 18:48   ` Li Yang
2018-08-28 22:14     ` Tyrel Datwyler
2018-08-28 22:29       ` Li Yang
2018-08-28 22:46         ` Tyrel Datwyler
2018-08-29  8:21   ` Heiko Stübner
2018-08-29  8:57   ` Qiang Zhao
2018-09-30 17:08   ` Andy Gross
2018-08-28  1:52 ` [PATCH] tty: " Rob Herring
2018-09-28 22:09   ` Rob Herring
2018-09-28 22:32     ` Rob Herring
2018-08-28  1:52 ` [PATCH] sound: " Rob Herring
2018-08-28  7:54   ` Andy Shevchenko
2018-08-28 15:44   ` Rob Herring [this message]
2018-09-03 21:45     ` [alsa-devel] [PATCH v2] " Takashi Iwai
2018-08-28  1:52 ` [PATCH] ASoC: " Rob Herring
2018-08-28  7:57   ` Andy Shevchenko
2018-08-28 15:44   ` [PATCH v2] " Rob Herring
2018-08-28 18:03     ` Mark Brown

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=20180828154433.5693-5-robh@kernel.org \
    --to=robh@kernel.org \
    --cc=alsa-devel@alsa-project.org \
    --cc=andy.shevchenko@gmail.com \
    --cc=johannes@sipsolutions.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=perex@perex.cz \
    --cc=tiwai@suse.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;
as well as URLs for NNTP newsgroup(s).