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: 145343 Delivered-To: patch@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp1339267ljw; Tue, 28 Aug 2018 08:44:55 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZvEQy5fiYe43a0scFA/dVf9+9vC71FAfuoxZQbQzgQtBum7sruXp/tSchfpMt/A6soHTn9 X-Received: by 2002:adf:f30b:: with SMTP id i11-v6mr1537617wro.161.1535471095151; Tue, 28 Aug 2018 08:44:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535471095; cv=none; d=google.com; s=arc-20160816; b=UbClmc5NTdHTtrHPepDUE0UObivHm+gmT2J/pMeOkqhXBI6V8DkU5b1hokyNVRqMiH rn2p/a+PDwb7Spqwxgk4akmuUeTo/sMHs7Nm0ocgtzRzAvlmhVnRmPQOfjtN+wEoGkPJ desITBG1D9cFfpIGlAqZyMABeKc8+ZNq7O6O4NPbObNzNf06VENrTVbN1Qd++tqhnNs5 peGhfsz3Y7CkjsRdGEvWGC3ucybIxUX8dQ0VzOHAV2s/4bqGQNSuN+Tpw4eHG2lFxY+7 gvHgAhMY7bvN4Tkia6tR993WjLsP2b8A3DL1jRge1WjttJJ1GIiuy6d8vcs0/Njpld9z vs0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:cc:in-reply-to:references:in-reply-to :message-id:date:to:from:delivered-to:arc-authentication-results; bh=znlRQoLfleMOHNsKNjOiOdzURvE/ZRhJs6wWaBGZzBw=; b=KyYqO4jH2JxXS5XROv4AJkJmfer0CRB8Hcp4h37XBxxRezimdMcG0zItllih+ZApxL g0CrpC9J4d8dijddwlAAo+F8mU77ZaaILh4vWJyF7pcF6wWFgdnncObPtXT4bbUMPj/N Gk3cBvXtrb4swaln+gRme+3WeuoJHydOI/iFgiQkOxJbuvct1USNHFCmirceJZB55afR 1Qgt8KXpQAexVIrxh1Oif9EGNCONefeVK2y0z8Am2gXyc5fDJHId4tNVzE5NOze6KkCK HJo5iByLmdm+iOqXe0NMhCktJhPQ8P0QyKHGDj9c3UdRZcjNWAPhmOjE3Bq/Jtm+UClT 4GNg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) smtp.mailfrom=alsa-devel-bounces@alsa-project.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from alsa0.perex.cz (alsa0.perex.cz. [77.48.224.243]) by mx.google.com with ESMTP id 66-v6si1168582wra.32.2018.08.28.08.44.54; Tue, 28 Aug 2018 08:44:55 -0700 (PDT) Received-SPF: pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) client-ip=77.48.224.243; Authentication-Results: mx.google.com; spf=pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) smtp.mailfrom=alsa-devel-bounces@alsa-project.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.4 required=5.0 tests=FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_PASS autolearn=disabled version=3.4.0 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-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 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 _______________________________________________ Alsa-devel mailing list Alsa-devel@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/alsa-devel 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);