From patchwork Tue Aug 28 15:44:31 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Herring X-Patchwork-Id: 10578733 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 159EF920 for ; Tue, 28 Aug 2018 15:44:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 028162A5FD for ; Tue, 28 Aug 2018 15:44:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EA78E2A607; Tue, 28 Aug 2018 15:44:56 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4724F2A5FD for ; Tue, 28 Aug 2018 15:44:56 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 212AE2678A7; Tue, 28 Aug 2018 17:44:48 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id B4C822677BB; Tue, 28 Aug 2018 17:44:43 +0200 (CEST) Received: from mail-oi0-f47.google.com (mail-oi0-f47.google.com [209.85.218.47]) by alsa0.perex.cz (Postfix) with ESMTP id 7264526777B for ; Tue, 28 Aug 2018 17:44:41 +0200 (CEST) Received: by mail-oi0-f47.google.com with SMTP id c190-v6so3665596oig.6 for ; Tue, 28 Aug 2018 08:44:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to; bh=8CA8HlRIimWQ1+09/8fTPNe1jB46vL5cbYt6PIkQg0g=; b=BEFsUZVG6j7sVb25WBz0om4hzmlAL339Vvphohm5LcJKsFVVxseSJCwOR+iEs0+I+W RtGA3SpTnHIGAZ2SlQOWZyn6bAANIRLk/3EdGNk95tAHawtMNLxJdLBq3tkEOYQc53mk 8jhtFLO1yI8++Hgs9ev3fq8ukRP8s+aA3a60UY3NQ8vAKA9KOHRAA6vlRj8JI4VqSjcc NupLxZvzQTu3yJfza9Y+uW/IyK0VIwFOl4CGjOh1EFTYv6NlYWY6aPr+cr0UaJP9nqpU oSAYqRKQrBstqAstFPmVEk5orbx0Q/ysIo6GSvJ93sELB+czEnVw0ThGMbbuNNQJFBBE 9pkg== X-Gm-Message-State: APzg51Ct1/qBD4A12Dz4LsxoniUNT6fTBUwM4CCMn3UD63OY5kGF6dW8 dl4k67ogzRJYMsSeh+22Hg== X-Google-Smtp-Source: ANB0Vdbq6MLN4YCur/o80tpZjN9ltkfxH/MkDlmRPFZT8IphhDYz6tZ5LmT+pu1+2ad4/uNKQtEyuA== X-Received: by 2002:aca:acc8:: with SMTP id v191-v6mr1586618oie.354.1535471080332; Tue, 28 Aug 2018 08:44:40 -0700 (PDT) Received: from xps15.herring.priv (24-155-109-49.dyn.grandenetworks.net. [24.155.109.49]) by smtp.googlemail.com with ESMTPSA id f4-v6sm1808331oic.52.2018.08.28.08.44.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 28 Aug 2018 08:44:39 -0700 (PDT) From: Rob Herring To: linux-kernel@vger.kernel.org Date: Tue, 28 Aug 2018 10:44:31 -0500 Message-Id: <20180828154433.5693-5-robh@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180828154433.5693-1-robh@kernel.org> References: <20180828154433.5693-1-robh@kernel.org> In-Reply-To: <20180828015252.28511-50-robh@kernel.org> Cc: alsa-devel@alsa-project.org, Takashi Iwai , Andy Shevchenko , Johannes Berg , linuxppc-dev@lists.ozlabs.org Subject: [alsa-devel] [PATCH v2] sound: Convert to using %pOFn instead of device_node.name X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP In preparation to remove the node name pointer from struct device_node, convert printf users to use the %pOFn format specifier. Cc: Johannes Berg Cc: Jaroslav Kysela Cc: Takashi Iwai Cc: linuxppc-dev@lists.ozlabs.org Cc: alsa-devel@alsa-project.org Signed-off-by: Rob Herring --- v2: - Fix error in strncmp sound/aoa/soundbus/i2sbus/core.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) -- 2.17.1 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);