Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp7251258imm; Tue, 28 Aug 2018 08:46:44 -0700 (PDT) X-Google-Smtp-Source: ANB0Vda/Z56St3cDGx0rB4ogedKBL8sUXbJm6zBHkDBnu+cPWOqu8EFqaAacpmTHDjLyHMU67N/m X-Received: by 2002:a17:902:8506:: with SMTP id bj6-v6mr2110128plb.210.1535471204175; Tue, 28 Aug 2018 08:46:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535471204; cv=none; d=google.com; s=arc-20160816; b=qE/yz2edUCXCFLAc8pdBziSABnpfubllGSKQBA1GKVrHzZrDYbO58Owq8JKWU9sQB4 Pdlf6jCcLY69bxjtMF1o4gAo16noWjI4QoekAOplIj5XnJUMPc/rF12eREM8e9pwR+HR YdGPq1mnmdDejdSA9c9p0KLRnI+T7D+K1f+sBzXXB4W2p2EqQIUdDMEgM76s7TM2a1/k A9pI0GdaW4zjWoL51Fqjcx8RrukbI4wlntym++Yxr2RCcRtaXJP0H938ZWIDYO71Y6zw 5WOKg/5hh98Pf8t8GZdwYgaABsjtzaPZ/oVfpYjU8F6ih8Yo0Ejd/ZtA5FObrFD1FV+t 49fQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:references:in-reply-to :message-id:date:subject:cc:to:from:arc-authentication-results; bh=8CA8HlRIimWQ1+09/8fTPNe1jB46vL5cbYt6PIkQg0g=; b=TEBnRe7pTvVUzOFimMGhZKSZ0mvz2D9Bt9O7q7tF463miqixg5rRIt93zHD86gJv+0 RBSmhTrVjZS1d4sEiXq+u5oL44+gsJBbTBylqJYAXpEM+1rg3/FdAPz8sF6SLEwzoVPt +DS3ZJ2I7jlHDzOyKYEVi3xhhFkluE8xuyk9Q7Pc+L/sAU5UpCAe6JLPjXySqERP16Ma eMZYnkO34BBLcF+It4+XTZG4vqH2o/NxyZKygnlp4nVXL8dfT6K0yFaOAmU/HZTnyMN0 GyVtlfBPcswiZyJ6B6xA36pTc7k0dO8GqzLIctSN/j8uw5e0j0hO41eAxQyU/LYk6fxj lFUw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w8-v6si1456394pgw.647.2018.08.28.08.46.28; Tue, 28 Aug 2018 08:46:44 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727206AbeH1ThN (ORCPT + 99 others); Tue, 28 Aug 2018 15:37:13 -0400 Received: from mail-oi0-f49.google.com ([209.85.218.49]:44000 "EHLO mail-oi0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727341AbeH1Tgz (ORCPT ); Tue, 28 Aug 2018 15:36:55 -0400 Received: by mail-oi0-f49.google.com with SMTP id b15-v6so3634314oib.10 for ; Tue, 28 Aug 2018 08:44:40 -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=ueBql9CgnUmNrkisgQgZ8D3VAmSEMrfeki4WgjIaemwgIxSKKWUBHqe6V3yxBBwUbp J3+XypFNUIc9/V9lonL7z6b1oOnb9MOpRazP3XvHNTolOsj2gccw67nfobMfjjFe7yMQ raJRud/N9v7NcQEvrMo04aIy5dp2yfgybcvrhTL1XM0CNvOdgi+JJGVD5O56k1oLd3Z0 oz4NCNAnORJCcOeeXinx5+Laj59y4wQ/f2hrjM23TGGa0P7O2oPQttTnSAMRGgJMKRNw 5i0qngHPFr0Kzxd0mcV3Py5d57SMfnnLzYOLoaKYrAiDDaDnotVinaTE7D2BEcljNpok xbGg== X-Gm-Message-State: APzg51CRjY1Xfgbgc+ytFO2PR4AsXIabNRRcRvZTSZedZsjpuJcXjTC2 HngUs4LeEEZEYX/kbWw47G/Dujg= 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 Cc: Andy Shevchenko , Johannes Berg , Jaroslav Kysela , Takashi Iwai , 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 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> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.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 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(-) 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