Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp4260363pxb; Tue, 31 Aug 2021 00:17:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJweLTXAWHBC+yjCusyIBPNSHVfgjgfkUYkXhOKR+R+MBKrfPFEY363D+8gMs099n1ZA/4uS X-Received: by 2002:a92:4a10:: with SMTP id m16mr19036809ilf.233.1630394227753; Tue, 31 Aug 2021 00:17:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630394227; cv=none; d=google.com; s=arc-20160816; b=EiRoQAYgrFhy2PCXRHlVver3yWgCGEX1Rb4EUCbyf9S6Vi7yLr0o4VGA6nT6H+avBO 7zg741quNizhrQkF367D3sob353PkdcxdX3WbhInX/Lb8R9N0+cfyht4PleBPmWj3RiL DzxazjZdB/EGMPObC7YdG4WgvMHP+9jqlp/T3OwZgx75Oy6u6QFH0i8k16KfW1USaijb /EeQNimZC41ViO86Ol2ykWYbbObE1TW4dmtR10T1PgcW3vgs3e/E5hKfiOMaylswQopC Fvd1P66lgjfP9dgsHspzGjWPrLqJkUFOBR2hRcYpGK74eIhP+n9PEoutCQG7QqeceIMj 2xfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=85xTz2o/rrQnUGU0uhPJpi4PkLlSB9y7LknfqYa80I8=; b=TfZLZlG/9VXl53L44dQJupqvTMbHWTNRmnsQhUcMR2S/37eIMLGnr4zOZ2neIaJw47 uqDxSPJ5XmS3XvBVnXV87vtcucgP/zGzdL+Zq01G9oX8FuVITWPQAKDQxFebG8KfBaHM cEsuER/eQZG7MWyrl9WUmEvjhSJzlyHONDHuBvlfRo8kIbKl4svgezfHN/BG09QRI355 1R63MQ370kYOHz+3K+a+/QEF19VAQWjEtayUWXIYqV8Pbp5l2A09kXJn6M6iEZGqE4hB r/A7tYePhNbqXdrVF+XSvvcqWZ72Pck1XdZ8emZiQSu1Dk9prbHgoVrqIv3mqgXOLgpQ EQ4A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q9si4005452ile.120.2021.08.31.00.16.50; Tue, 31 Aug 2021 00:17:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239769AbhHaHQy (ORCPT + 99 others); Tue, 31 Aug 2021 03:16:54 -0400 Received: from twspam01.aspeedtech.com ([211.20.114.71]:42204 "EHLO twspam01.aspeedtech.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239203AbhHaHQb (ORCPT ); Tue, 31 Aug 2021 03:16:31 -0400 Received: from mail.aspeedtech.com ([192.168.0.24]) by twspam01.aspeedtech.com with ESMTP id 17V6scJB028267; Tue, 31 Aug 2021 14:54:38 +0800 (GMT-8) (envelope-from billy_tsai@aspeedtech.com) Received: from BillyTsai-pc.aspeed.com (192.168.2.149) by TWMBX02.aspeed.com (192.168.0.24) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 31 Aug 2021 15:13:35 +0800 From: Billy Tsai To: , , , , , , , , , , , , , CC: Subject: [v5 07/15] iio: adc: aspeed: Set num_channels with model data Date: Tue, 31 Aug 2021 15:14:50 +0800 Message-ID: <20210831071458.2334-8-billy_tsai@aspeedtech.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210831071458.2334-1-billy_tsai@aspeedtech.com> References: <20210831071458.2334-1-billy_tsai@aspeedtech.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [192.168.2.149] X-ClientProxiedBy: TWMBX02.aspeed.com (192.168.0.24) To TWMBX02.aspeed.com (192.168.0.24) X-DNSRBL: X-MAIL: twspam01.aspeedtech.com 17V6scJB028267 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use the model_data member num_channels to set the num_channels of iio device. Signed-off-by: Billy Tsai --- drivers/iio/adc/aspeed_adc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iio/adc/aspeed_adc.c b/drivers/iio/adc/aspeed_adc.c index 01df24f6d3f1..aec335956310 100644 --- a/drivers/iio/adc/aspeed_adc.c +++ b/drivers/iio/adc/aspeed_adc.c @@ -299,7 +299,7 @@ static int aspeed_adc_probe(struct platform_device *pdev) indio_dev->info = &aspeed_adc_iio_info; indio_dev->modes = INDIO_DIRECT_MODE; indio_dev->channels = aspeed_adc_iio_channels; - indio_dev->num_channels = ARRAY_SIZE(aspeed_adc_iio_channels); + indio_dev->num_channels = data->model_data->num_channels; ret = iio_device_register(indio_dev); if (ret) -- 2.25.1