From patchwork Fri Nov 16 22:11:04 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: 10687065 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 33A3214D6 for ; Fri, 16 Nov 2018 22:11:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 241692CCAB for ; Fri, 16 Nov 2018 22:11:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 158A82CD56; Fri, 16 Nov 2018 22:11:34 +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 263CC2CF56 for ; Fri, 16 Nov 2018 22:11:32 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 15E3F26794E; Fri, 16 Nov 2018 23:11:29 +0100 (CET) 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 BF5302679C0; Fri, 16 Nov 2018 23:11:26 +0100 (CET) Received: from mail-ot1-f68.google.com (mail-ot1-f68.google.com [209.85.210.68]) by alsa0.perex.cz (Postfix) with ESMTP id 5BED8267947 for ; Fri, 16 Nov 2018 23:11:23 +0100 (CET) Received: by mail-ot1-f68.google.com with SMTP id k98so22737279otk.3 for ; Fri, 16 Nov 2018 14:11:22 -0800 (PST) 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:mime-version :content-transfer-encoding; bh=LaouoqkD3ttluPI7bXedx27zbuxr7w/ViN2uhOKU2JI=; b=k44Q7Ygz6fUhu/rX9ZaIIyVf9PYNWmh8rHyR5q3SsKc+8VQM8yWRJsn+BNplewEZrY tvRAV1SlSoDQh7GUQbNDuqelSmvo8zumGHAbHIPma5ki2Y5zCaZEVa4uMTGJX+SMGaFi rHs8H2I2EKGhr6tcwSjpBawI56LZNeG5Fl7e2mN989eT0f+wuxpI9KSDdfkGeMM7XSvu ATKagfeZlDCeygCH8rV/sH9v8pYvUQ37W1eBhGc6mW34xRA7LqaOZTVK73Gu9GxHi57L RBKi9ptaXQkuEvFXEko/ZIkIv+xUEzCTEMLv8MxTgzz/stTqzMJiinjwVaOyd4rB2P1X EgtA== X-Gm-Message-State: AGRZ1gJTVieQwtPsy/e1zFiRarUQNTRSHmQ5h0PwGFkxwvClxHc8PCiN 83xvFG60+97uaD/IWnsZ4A== X-Google-Smtp-Source: AJdET5fPipeCIPit29eBQPrgdNSohEJJIo1/QR3fNnAra6GS7aOMTtVm5gZ08+xFYAVVwLgHU9kJ9A== X-Received: by 2002:a9d:738a:: with SMTP id j10mr7731660otk.188.1542406281963; Fri, 16 Nov 2018 14:11:21 -0800 (PST) Received: from localhost.localdomain (mobile-166-173-57-127.mycingular.net. [166.173.57.127]) by smtp.googlemail.com with ESMTPSA id p204-v6sm12142631oib.25.2018.11.16.14.11.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 16 Nov 2018 14:11:21 -0800 (PST) From: Rob Herring To: Takashi Iwai Date: Fri, 16 Nov 2018 16:11:04 -0600 Message-Id: <20181116221104.23024-8-robh@kernel.org> X-Mailer: git-send-email 2.19.1 MIME-Version: 1.0 Cc: devicetree@vger.kernel.org, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, Johannes Berg , linuxppc-dev@lists.ozlabs.org Subject: [alsa-devel] [PATCH] ALSA: aoa: Use device_type helpers to access the node type 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: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP Remove directly accessing device_node.type pointer and use the accessors instead. This will eventually allow removing the type pointer. Replace the open coded iterating over child nodes with for_each_child_of_node() while we're here. 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/fabrics/layout.c | 4 ++-- sound/aoa/soundbus/core.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sound/aoa/fabrics/layout.c b/sound/aoa/fabrics/layout.c index 1eddf8fa188f..3a23fd032611 100644 --- a/sound/aoa/fabrics/layout.c +++ b/sound/aoa/fabrics/layout.c @@ -1008,8 +1008,8 @@ static int aoa_fabric_layout_probe(struct soundbus_dev *sdev) return -ENODEV; /* by breaking out we keep a reference */ - while ((sound = of_get_next_child(sdev->ofdev.dev.of_node, sound))) { - if (sound->type && strcasecmp(sound->type, "soundchip") == 0) + for_each_child_of_node(sdev->ofdev.dev.of_node, sound) { + if (of_node_is_type(sound, "soundchip")) break; } if (!sound) diff --git a/sound/aoa/soundbus/core.c b/sound/aoa/soundbus/core.c index 70bcaa7f93dd..f3076a3f7f2f 100644 --- a/sound/aoa/soundbus/core.c +++ b/sound/aoa/soundbus/core.c @@ -78,7 +78,7 @@ static int soundbus_uevent(struct device *dev, struct kobj_uevent_env *env) if (retval) return retval; - retval = add_uevent_var(env, "OF_TYPE=%s", of->dev.of_node->type); + retval = add_uevent_var(env, "OF_TYPE=%s", of_node_get_device_type(of->dev.of_node)); if (retval) return retval;