From patchwork Sun Aug 21 16:09:14 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 12950015 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 19594C00140 for ; Sun, 21 Aug 2022 16:44:48 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 9C4CD161E; Sun, 21 Aug 2022 18:43:56 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 9C4CD161E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1661100286; bh=WtlqS8ekb/Mvx6VAbI+TwumMMQt1oc7YbdmyEkIiH44=; h=From:To:Subject:Date:Cc:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From; b=YN9mrSAlcmIx5Cpjnvs9ZLUyaxU6jjvXeAnGsLWt5acon0JDhSfmQ77WPcAqcUgQK 50/yIN8+3/a1F1nOSo9S9emtJz18jdcM6IBqYkMRLi/PnN5rv5aMuZiR9Vh2VhWI/r zvS2iwevkAL0oOC4kd2JaQq0e4kdB7H9GokORzKk= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 19F3FF80236; Sun, 21 Aug 2022 18:43:56 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 74592F80128; Sun, 21 Aug 2022 18:43:54 +0200 (CEST) Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id DD1C3F80128 for ; Sun, 21 Aug 2022 18:43:51 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz DD1C3F80128 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="pJaxtuLE" Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id C1932B80A08; Sun, 21 Aug 2022 16:43:50 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B9DD0C433D6; Sun, 21 Aug 2022 16:43:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1661100229; bh=WtlqS8ekb/Mvx6VAbI+TwumMMQt1oc7YbdmyEkIiH44=; h=From:To:Cc:Subject:Date:From; b=pJaxtuLEWhjv1PRUdfqLKqY7gv2cIWW+6VkwvFXHd+7ToCyzR/435P330iWvE3H+4 jKdCt9m4sGY2kWpQTzqKD5RAND/6ifnvt7H4NynFECs3nLx8xB78GosbkAYSz+yBLW uDUXPPSxHM9eoy4TDkQooYu71JYmbxwBKURJfcEO8SCSOdALW24vmIkmsUNjTjtjN5 q53bxeyYxDgHqAXGZsfvM0RauAb8ZQAJUTH+diMt+R45AVHWdnXxkpBBQt5CePiSWF WiY/kmGpMRFeLMPmG5LYms4/FvZ3uEulBKnC6AkAtNplhHx8u7WoSXEQOAcnHsZvA2 tJTx0lDpKXgTQ== From: Jonathan Cameron To: alsa-devel@alsa-project.org, linux-samsung-soc@vger.kernel.org Subject: [PATCH] ASoC: samsung: Use iio_get_channel_type() accessor. Date: Sun, 21 Aug 2022 17:09:14 +0100 Message-Id: <20220821160914.2207116-1-jic23@kernel.org> X-Mailer: git-send-email 2.37.2 MIME-Version: 1.0 Cc: Krzysztof Kozlowski , Mark Brown , Liam Girdwood , Jonathan Cameron X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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" From: Jonathan Cameron struct iio_chan_spec is meant to be opaque to IIO consumer drivers which should only use the interfaces in linux/iio/consumer.h. Use the provided accessor function to find get the type of the channel instead of directly reading it form the structure. Signed-off-by: Jonathan Cameron Cc: Krzysztof Kozlowski Cc: Sylwester Nawrocki --- sound/soc/samsung/aries_wm8994.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sound/soc/samsung/aries_wm8994.c b/sound/soc/samsung/aries_wm8994.c index e7d52d27132e..0fbbf3b02c09 100644 --- a/sound/soc/samsung/aries_wm8994.c +++ b/sound/soc/samsung/aries_wm8994.c @@ -1,7 +1,6 @@ // SPDX-License-Identifier: GPL-2.0+ #include #include -#include #include #include #include @@ -543,6 +542,7 @@ static int aries_audio_probe(struct platform_device *pdev) struct aries_wm8994_data *priv; struct snd_soc_dai_link *dai_link; const struct of_device_id *match; + enum iio_chan_type channel_type; int ret, i; if (!np) @@ -594,7 +594,11 @@ static int aries_audio_probe(struct platform_device *pdev) return dev_err_probe(dev, PTR_ERR(priv->adc), "Failed to get ADC channel"); - if (priv->adc->channel->type != IIO_VOLTAGE) + ret = iio_get_channel_type(priv->adc, &channel_type); + if (ret) + return dev_err_probe(dev, ret, + "Failed to get ADC channel type"); + if (channel_type != IIO_VOLTAGE) return -EINVAL; priv->gpio_headset_key = devm_gpiod_get(dev, "headset-key",