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: 151386 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp958330ljp; Fri, 16 Nov 2018 14:11:25 -0800 (PST) X-Google-Smtp-Source: AJdET5cejZsaSTbfdtkGBFGqntvUf05sBTJhhvtu3n8du0KBt8dVi4yKMP2lAiNy8FgRThNghmnk X-Received: by 2002:a63:b218:: with SMTP id x24mr11259790pge.223.1542406285760; Fri, 16 Nov 2018 14:11:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542406285; cv=none; d=google.com; s=arc-20160816; b=dwVXYb2kxIRy7DGlx8vSzFhgs6RQNouk/2hrn1Ov/wUk8j4QqxpThcf5rQ8s0yy0bZ 460cA5aYjZok9ehHu0khwmOmE2nkEjFQgdgP2DgB6l8hUW6IvLX6a1lFdaZmU0Ie9SYJ F/ReT83QYDn4GQrzZR7pRzQBmOrNmxYU1vbIC3bgiSu/DyAG00nx9HrAz9vGA2bZBBOX Nrcb7cvHPXxWgwzhUMCAEK3n/hAyxlxCDOaAFgA43M7QtC79VTkmb9WkrTV97aGBG0aZ nhJ6UE4FDIujuMUObzhmNU++IbXK8n51uzt2gTjpQYl4TktRLD2LwqkzM4auzMS6TKrY DNuw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=LaouoqkD3ttluPI7bXedx27zbuxr7w/ViN2uhOKU2JI=; b=jrI4JyWYJLJyPFvSvLtc9F5QOMklZYWdNCXUCuzuSVdVIUQ1q0Uh8ZjoBVkZ0bFzPI FiVoZS34zHrugUVVInOkdLg+AoXnbU8nttZjTr6tnCrRNW+JPlnyd1due+D3IULHEg81 bUCV47nl1QDAAbcg8t+OZKkp9hJuPPLh9Sg/wI454CsaHx9aZTtkLnKHt7qGiqtoLf1e hLvfPoUIA3BYOq+ToMTgiI5W5UKxzj1M8EnSqN95/FwZWr7EO+qGMJwyX+wrxP5Nx5qK 5NvarXrx7FSJdrMrOsYeGnhBIDvSPGM9y/+mHH7xuZJF6sM+cyczT611sK0Eavqm+cLJ OvgA== 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 f15-v6si27324249pff.131.2018.11.16.14.11.25; Fri, 16 Nov 2018 14:11:25 -0800 (PST) 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 S1730347AbeKQIZd (ORCPT + 32 others); Sat, 17 Nov 2018 03:25:33 -0500 Received: from mail-ot1-f66.google.com ([209.85.210.66]:37278 "EHLO mail-ot1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725995AbeKQIZc (ORCPT ); Sat, 17 Nov 2018 03:25:32 -0500 Received: by mail-ot1-f66.google.com with SMTP id 40so22737419oth.4; 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=ni1kn6iv8c0+pzoDpszOuIt5+wBxTSuwNoOINPjf6W1pavuKiqZ0YiYe3exYY+w0NE L2f6MpVbtakMu8lnT3qZDLLAQOpS+zRK2GcbXlYJPJXaKPsVeH03CrigJvqnJmV9BGNj pYjuoQ4cGLhXq76H2/M7j56tbhXHnOs3HSiD1/MzkZW47+vAdJO5lnxnJc3c83IrQQ25 V2sCZnz0hWGCQhsTx04reLOQeiYzK704vB/8Js+syrRv0fGQZJQgtDHtsKCd43PWnOjB Evv532zuMutsO2kL+pI96zecRgTXn+eOa+gitUormvoEbNqwhIniDjYha+/Rk360eE/D D8HQ== X-Gm-Message-State: AGRZ1gLScCWQmjj7r7Sqs+4GzvXiPO1Ul8zQwPtAY/VNxPZaIOBVulu2 quzxF62XJTGFBfpsK6w7weTX2mh9vQ== 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 Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Johannes Berg , Jaroslav Kysela , linuxppc-dev@lists.ozlabs.org, alsa-devel@alsa-project.org Subject: [PATCH] ALSA: aoa: Use device_type helpers to access the node type 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 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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(-) -- 2.19.1 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;