Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp6554422imm; Mon, 27 Aug 2018 18:57:19 -0700 (PDT) X-Google-Smtp-Source: ANB0VdbjcUtjbL0BgcEcLcODRiqqls4DJtc3Seigqg47R12zjEBye/kX9AENZxE9aXfuBydncekx X-Received: by 2002:a17:902:6e0f:: with SMTP id u15-v6mr15570286plk.13.1535421439286; Mon, 27 Aug 2018 18:57:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535421439; cv=none; d=google.com; s=arc-20160816; b=BOav5NYEoBO9nyOwWuSZ1cRX3xQyM3OldgYXkakec8MqzXg2uqfn0VNYJyIrejBZM+ uDb2zZbwtD+GjwN06k8C7E9glxfnHsTTxuyap7h8pWgZMhghce1lEWAi1d4Dl4LNFP/q H22HKuYUgSUf1xgOiiAY+kskXasWzAxZMpV4r0/mhOc5IGHPE0ue2VRaNRJvTcpYSVNG RMtmGxs2cVQihaYpZT4RzZyLk4eAx1/VzHxWG/tnm/dPIyAPMIyittSGe7p8tFQFXfTa rv2WBdEI31pBbvtdPWJIB7ucUo/wAiVcrAr9gKu9feCwBOhRcs4aaT+PwQ9Rt04l8LUC YbNQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=gK8MM28vtQVhs5d+zMPNeQcZkR43l0qBaO3NRVTRGUM=; b=j3SlDh0pcuEE4OcLM6/jj23cqEFfbw/ut5oKRwxLXmeVJEcH0IzkGQjsBCbMxND2tE idAOeVuzc6rLx6026uHy2Qf9SiIezUsT3PQWNu7yDZvWyOoOM3OejvHKd8FY4NzYmwMy pw0ztd2C5OZYMCkgRqUdjTm4xcNWzj/yvmOR9SGdJ/TlSdfbWmZH49sXmCjZReVOjK/q v1yqYz5aL37f8l2GpEEOSHQkgkiGg9vWiN8h++RWub8mP2OxGrjVZXQthi3JXLV3EHyI wJyESKhzvKYUVlR4l4dmWnbrNBDtjrVRkjn/sITVRhQs4usxyKdvQYJyEAiURjbD4/Hw jYYg== 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 p83-v6si907597pfa.180.2018.08.27.18.57.04; Mon, 27 Aug 2018 18:57:19 -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 S1728208AbeH1Fog (ORCPT + 99 others); Tue, 28 Aug 2018 01:44:36 -0400 Received: from mail-oi0-f66.google.com ([209.85.218.66]:42944 "EHLO mail-oi0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727477AbeH1Fof (ORCPT ); Tue, 28 Aug 2018 01:44:35 -0400 Received: by mail-oi0-f66.google.com with SMTP id q204-v6so1732153oig.9 for ; Mon, 27 Aug 2018 18:55:19 -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=dlFADSRdo1loNoVPcMbEPW3ZtwnAKnxL7StNo+IPivAQOoIxo1hHF6ELnab1A5sLdE Yyd0JVahKNBOXKBczPBM5QsD7i4bXXN9pa/XTHNKh6f1fZI0hciW73Ai+GzvZMWGB1NN kgPI0PfKfB01uoklqqOF3hZGbg5IQOF1yk0RrC4t8PfwWTDPV4S4J8xQ88RdRZU28D7c FUCeLpCsV2wHYd68sVW1dUKecnq75W9T0cSwg1AzxyspPnLcF2tvjxAg31Nse8JSDL6f QzH5aQ1EpY789TDSbTvWbLM6q+YfI35qgq+S6vormB21pNsNcRfxN79GRkaLL2y+8BTR eRFg== X-Gm-Message-State: APzg51A4yAR8PfJ7+aqZyVB5nN/qeS6r8l/1G2xS3vzkELiNtG63QST4 Qj6E2wRRD9YfG2WHEqvR8A3o9WM= 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 Cc: Johannes Berg , Jaroslav Kysela , Takashi Iwai , linuxppc-dev@lists.ozlabs.org, alsa-devel@alsa-project.org Subject: [PATCH] sound: Convert to using %pOFn instead of device_node.name 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> 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 --- 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); -- 2.17.1