From patchwork Tue Aug 28 01:52:51 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Rob Herring (Arm)" X-Patchwork-Id: 10577791 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 50F7C139B for ; Tue, 28 Aug 2018 01:55:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3D75629A74 for ; Tue, 28 Aug 2018 01:55:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2D21C29A7C; Tue, 28 Aug 2018 01:55:30 +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 4D16529A74 for ; Tue, 28 Aug 2018 01:55:28 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 319C7267898; Tue, 28 Aug 2018 03:55:27 +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 930EB26787A; Tue, 28 Aug 2018 03:55:23 +0200 (CEST) Received: from mail-oi0-f65.google.com (mail-oi0-f65.google.com [209.85.218.65]) by alsa0.perex.cz (Postfix) with ESMTP id C374F26787A for ; Tue, 28 Aug 2018 03:55:20 +0200 (CEST) Received: by mail-oi0-f65.google.com with SMTP id c190-v6so16161oig.6 for ; Mon, 27 Aug 2018 18:55:20 -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; bh=gK8MM28vtQVhs5d+zMPNeQcZkR43l0qBaO3NRVTRGUM=; b=KY6LhAfXMLFH7ujDEXYoo3PtBaizg2ry9cq3tCYUTxEjT8pQVjwBh7kYj0L40yMD5E NQCwdd0d23A1ijVRQt6ApNMiPkqBY98gmV6T+w6gZtLZX/TB/WqCKw9rtnvAVfbwEoSo 3uNETiRxgK9Dt96L1p0XQJv7chR8zHDzWuVO8smrZ8Ik4c0z8MV9Xl+8Ba121hRaU5LO BCqNX8qTYSf9M0rozV71VcqlydR5WvnxwX1priEzQr/bwDuf0+duwZbFN1199IyRShCF uellpMy6c7T9ahfx6koYwmJUc51LBYWbFX3lK+f47qwcHup5MOPjsUvXiNyK9oacApEp 5bCg== X-Gm-Message-State: APzg51BVHUeeIOYl6o5lCtRupKfIwDdJ2PqSEt0++vvlgbiRbAENQZlS bpxGXmuEOo8fRE7YlffkGg== X-Google-Smtp-Source: ANB0VdaEUhcIlZLgO6rkWzzs1mWXpZIAsP/+RweQF4WLLPEGhnhINbMfsnFObROaBKmB9XcCnODKEw== X-Received: by 2002:aca:d846:: with SMTP id p67-v6mr1181523oig.42.1535421319187; Mon, 27 Aug 2018 18:55:19 -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 n71-v6sm1652696oig.48.2018.08.27.18.55.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 27 Aug 2018 18:55:18 -0700 (PDT) From: Rob Herring To: linux-kernel@vger.kernel.org Date: Mon, 27 Aug 2018 20:52:51 -0500 Message-Id: <20180828015252.28511-50-robh@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180828015252.28511-1-robh@kernel.org> References: <20180828015252.28511-1-robh@kernel.org> Cc: Johannes Berg , linuxppc-dev@lists.ozlabs.org, Takashi Iwai , alsa-devel@alsa-project.org Subject: [alsa-devel] [PATCH] 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 --- 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..bf32e1c74748 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(np, "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);