Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp664532pxb; Wed, 3 Nov 2021 10:16:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyt/Jo4R8z3sQqLJucr/xxuGZd09UurYUlvi4Q0rD9WhHCIJ4xljWWaq4pCodVVmD1omeQV X-Received: by 2002:a05:6638:c49:: with SMTP id g9mr19191815jal.54.1635959791999; Wed, 03 Nov 2021 10:16:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635959791; cv=none; d=google.com; s=arc-20160816; b=XLqLg34QQ6cY995QwrnYOJiOWiBbosv0aCP0bji3SZNwhPWSTJ5sT98UyrfmCr3SDc gvhXKo9f6oiemrfQl201nsOguzpd6rMHG6t7eP6eClpKQiTvMDueY02l8OVbjrQyrw6H F+RS4vQrCwcGLemZWSkx4VgT32vLVFbO6+oryZwFbmOoIBXn5y8qdbIzx7m2CP+FOfV7 cWIHBTgEZeMh9NjDsAnlFt5CXEnQ5aHXn1nHdKsFrjwCNocYZt1l0A2RqcxM8/ic6eI+ K1xHbwdK+MCo+GFGZHLAt3r2X4spJ9l9NUrof0IFXr1MMI8jmri4YYZ6B2BP51Na1lR4 DKvg== 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:subject:cc:to:from:date; bh=Pa0/NFHwfO0Q9c+lpk2HtVy2FuTwQaFkWGbL+JKYQgQ=; b=ahagUoExdMgPD1tMhsLZgkBzINE8lz1TJcxtEUD3kXxGHBr6nTp93Guz1NSpkk5Gqp CoGf0AYqHdBEK0CzRYGf+AiK/jyTk8ISA9Cet6PMUPmXfsfG0PL6kcD/ZQdHj8PV4xmm 7/XtkwwoYkFcnLkw6TfZ4/QZvxr8HXoVseTLwZZjEmL5MZShap9kfCV5raFw9pgAOowL NlP0iTso67Lk5cVco8NwXCgOVf6RUIRsaF1KYOci3rYnjUN4Yf79RCrCLmcrfD1ekwzL vtA2+yKSe2kpy+3lCLyuCADbwESUrfG9wCVCL1Pn4Fv/xJaNVftMn42/vGD3NQtrUA8V pdSg== 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g23si3870186jan.1.2021.11.03.10.16.16; Wed, 03 Nov 2021 10:16:31 -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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229971AbhKCRRf convert rfc822-to-8bit (ORCPT + 99 others); Wed, 3 Nov 2021 13:17:35 -0400 Received: from mail.kernel.org ([198.145.29.99]:42078 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229587AbhKCRRe (ORCPT ); Wed, 3 Nov 2021 13:17:34 -0400 Received: from jic23-huawei (cpc108967-cmbg20-2-0-cust86.5-4.cable.virginm.net [81.101.6.87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 9AC856109F; Wed, 3 Nov 2021 17:14:55 +0000 (UTC) Date: Wed, 3 Nov 2021 17:19:28 +0000 From: Jonathan Cameron To: Anand Ashok Dumbre Cc: Andy Shevchenko , Linux Kernel Mailing List , Lars-Peter Clausen , linux-iio , git , Michal Simek , Peter Meerwald , devicetree , Manish Narani Subject: Re: [PATCH v7 2/4] iio: adc: Add Xilinx AMS driver Message-ID: <20211103171928.23e86227@jic23-huawei> In-Reply-To: References: <20211019152048.28983-1-anand.ashok.dumbre@xilinx.com> <20211019152048.28983-3-anand.ashok.dumbre@xilinx.com> X-Mailer: Claws Mail 4.0.0 (GTK+ 3.24.30; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 2 Nov 2021 21:31:21 +0000 Anand Ashok Dumbre wrote: > Hi Andy, > > Thanks for the review. ... > > > + return IRQ_NONE; > > > > ... > > > > > + for_each_child_of_node(chan_node, child) { > > > + ret = of_property_read_u32(child, "reg", ®); > > > + if (ret || reg > (AMS_PL_MAX_EXT_CHANNEL + 30)) > > > + continue; > > > + > > > + memcpy(&channels[num_channels], &ams_pl_channels[reg + > > > + AMS_PL_MAX_FIXED_CHANNEL - 30], > > > + sizeof(*channels)); > > > + > > > + if (of_property_read_bool(child, "xlnx,bipolar")) > > > + channels[num_channels].scan_type.sign = 's'; > > > + > > > + num_channels++; > > > + } > > > > Use device property API here instead of *of_*() calls. > > > > > > ... > > > > > + /* Initialize buffer for channel specification */ > > > + ams_channels = kzalloc(sizeof(ams_ps_channels) + > > > + sizeof(ams_pl_channels) + > > > + sizeof(ams_ctrl_channels), GFP_KERNEL); > > > > Use the corresponding macro from overflow.h. > > > > > + if (!ams_channels) > > > + return -ENOMEM; > > > > ... > > > > > + if (of_device_is_available(np)) { > > > > fwnode_device_is_available() > > Currently acpi is not supported with this driver. But I will add support in the next series of patches. > I don’t have a full understanding of ACPI and its interfaces. So would it be okay once the first iteration > gets checked in, I will add ACPI support on top. If you use the generic fwnode etc from property.h then dt will just work and it may well be enough to enable the weirdness that is ACPI ID PRP0001 which actually uses dt properties but reads them from an ACPI DSDT. So basically nothing to do except use the generic accessors rather than the of_ variants. Jonathan