From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8640922634; Fri, 12 Jan 2024 17:39:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=Huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.18.186.31]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4TBTJ53gg0z6K5kq; Sat, 13 Jan 2024 01:37:25 +0800 (CST) Received: from lhrpeml500005.china.huawei.com (unknown [7.191.163.240]) by mail.maildlp.com (Postfix) with ESMTPS id E0D0B140A36; Sat, 13 Jan 2024 01:39:21 +0800 (CST) Received: from localhost (10.202.227.76) by lhrpeml500005.china.huawei.com (7.191.163.240) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Fri, 12 Jan 2024 17:39:21 +0000 Date: Fri, 12 Jan 2024 17:39:20 +0000 From: Jonathan Cameron To: Nuno Sa via B4 Relay CC: , , , Lars-Peter Clausen , "Michael Hennerich" , Jonathan Cameron , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Greg Kroah-Hartman , "Rafael J. Wysocki" , Frank Rowand , Olivier Moysan Subject: Re: [PATCH v5 8/8] iio: adc: adi-axi-adc: move to backend framework Message-ID: <20240112173920.000014c6@Huawei.com> In-Reply-To: <20240112-iio-backend-v5-8-bdecad041ab4@analog.com> References: <20240112-iio-backend-v5-0-bdecad041ab4@analog.com> <20240112-iio-backend-v5-8-bdecad041ab4@analog.com> Organization: Huawei Technologies Research and Development (UK) Ltd. X-Mailer: Claws Mail 4.1.0 (GTK 3.24.33; x86_64-w64-mingw32) Precedence: bulk X-Mailing-List: linux-iio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-ClientProxiedBy: lhrpeml500004.china.huawei.com (7.191.163.9) To lhrpeml500005.china.huawei.com (7.191.163.240) On Fri, 12 Jan 2024 17:40:22 +0100 Nuno Sa via B4 Relay wrote: > From: Nuno Sa > > Move to the IIO backend framework. Devices supported by adi-axi-adc now > register themselves as backend devices. > > Signed-off-by: Nuno Sa A few quick drive by comments whist I wait for a build to finish... > diff --git a/drivers/iio/adc/adi-axi-adc.c b/drivers/iio/adc/adi-axi-adc.c > index 0f21d1d98b9f..741b53c25bb1 100644 > --- a/drivers/iio/adc/adi-axi-adc.c > +++ b/drivers/iio/adc/adi-axi-adc.c > @@ -8,6 +8,7 @@ >> static int adi_axi_adc_probe(struct platform_device *pdev) > { ... > @@ -390,37 +205,23 @@ static int adi_axi_adc_probe(struct platform_device *pdev) > if (ret) > return ret; > > - if (cl->info->version > ver) { > + if (*expected_ver > ver) { > dev_err(&pdev->dev, > "IP core version is too old. Expected %d.%.2d.%c, Reported %d.%.2d.%c\n", Format doesn't match with later. > - ADI_AXI_PCORE_VER_MAJOR(cl->info->version), > - ADI_AXI_PCORE_VER_MINOR(cl->info->version), > - ADI_AXI_PCORE_VER_PATCH(cl->info->version), > + ADI_AXI_PCORE_VER_MAJOR(*expected_ver), > + ADI_AXI_PCORE_VER_MINOR(*expected_ver), > + ADI_AXI_PCORE_VER_PATCH(*expected_ver), > ADI_AXI_PCORE_VER_MAJOR(ver), > ADI_AXI_PCORE_VER_MINOR(ver), > ADI_AXI_PCORE_VER_PATCH(ver)); > return -ENODEV; > } > > - indio_dev->info = &adi_axi_adc_info; > - indio_dev->name = "adi-axi-adc"; > - indio_dev->modes = INDIO_DIRECT_MODE; > - indio_dev->num_channels = conv->chip_info->num_channels; > - indio_dev->channels = conv->chip_info->channels; > - > - ret = adi_axi_adc_config_dma_buffer(&pdev->dev, indio_dev); > + ret = devm_iio_backend_register(&pdev->dev, &adi_axi_adc_generic, st); > if (ret) > return ret; > > - ret = adi_axi_adc_setup_channels(&pdev->dev, st); > - if (ret) > - return ret; > - > - ret = devm_iio_device_register(&pdev->dev, indio_dev); > - if (ret) > - return ret; > - > - dev_info(&pdev->dev, "AXI ADC IP core (%d.%.2d.%c) probed\n", > + dev_info(&pdev->dev, "AXI ADC IP core (%d.%.2d.%d) probed\n", I'd rip this (I think) unrelated change out to reduce noise in here somewhat. I'm curious though as it's still %c above. > ADI_AXI_PCORE_VER_MAJOR(ver), > ADI_AXI_PCORE_VER_MINOR(ver), > ADI_AXI_PCORE_VER_PATCH(ver)); > @@ -428,6 +229,8 @@ static int adi_axi_adc_probe(struct platform_device *pdev) > return 0; > }