Received: by 10.213.65.68 with SMTP id h4csp616100imn; Fri, 16 Mar 2018 13:21:17 -0700 (PDT) X-Google-Smtp-Source: AG47ELu50o+evCFH3QrWnOCCNhfv18l/ddN4GbhnRlcvuRvIvf0k1y2CJGqCWSW9x89RxLtTZI6t X-Received: by 2002:a17:902:bc04:: with SMTP id n4-v6mr3430515pls.97.1521231677024; Fri, 16 Mar 2018 13:21:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521231676; cv=none; d=google.com; s=arc-20160816; b=sVnP850yCS3S3hzltePJ5litryfCW2nDSBZ6lysezm6o++NkGkzTSQd+y5CQMwHczv 1/zj0Jq5Msfvom7AdE6rqHTmnYPwynTSK6+nV1JmMCpb94pDKPybrMM+aak8viq4vzmm 0hhZal80d2gbnGjY8NvVqgXpI1VPedbuQNtfyxYsT89hglaELhxtXDRf+dtL8EfC/m0g Sb5Jcq4e58UpZEHqa9Ac495sEE+3Qi5LxOGtEyot8V0dEzoOl4WiFhptfffUjAD65Jgf 7rntv+/DBz0PBv7rWu8xPgutXqzao92MeXdd3KKKnWPnULzSWgbT2ENNg9g4XQ8YTDOT PWcQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=pMCw+mv5lkQ6FhQ7YyfF/qisH9hT2P/o+KRSDhrwbEM=; b=ZI5fBqieR+py/xi4LfvoAcnV1ioF0Ds5V1TPRf847ryMfqFYuEmeEFPW803ASXoQoY Lj7WBgN+pt/A9S8mupWz6xP2tNYbS8138AQNrPuX3Nf4YXlvHkTL7zR2CDCbFOgcXagX lcaiCrW8rkddyvr+XpPTy5bz4Qwf+OcApc4Ex5JqhEN16EuWmse+T0vaCS38gQ9nZnNF ZjLlqfG9lQbveFv4t1rWpgw38Y6pdSiecjyOjcP1qTUnW8LRHZ+MXdezg85AXHGU3CMp BfRGhKkhyXUETzaiwdskbNoI5578W/RqxogjUjOC1FMztak5khEDf1Tib3A49RYOA2mp A4SA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=laEJ6qZF; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 7-v6si7048506plf.552.2018.03.16.13.21.03; Fri, 16 Mar 2018 13:21:16 -0700 (PDT) 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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=laEJ6qZF; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932322AbeCPUTk (ORCPT + 99 others); Fri, 16 Mar 2018 16:19:40 -0400 Received: from mail-pl0-f68.google.com ([209.85.160.68]:43677 "EHLO mail-pl0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932274AbeCPUTh (ORCPT ); Fri, 16 Mar 2018 16:19:37 -0400 Received: by mail-pl0-f68.google.com with SMTP id f23-v6so6547074plr.10; Fri, 16 Mar 2018 13:19:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=pMCw+mv5lkQ6FhQ7YyfF/qisH9hT2P/o+KRSDhrwbEM=; b=laEJ6qZFby5XthvHOACKnT3ZUNhwwVpsq6N/lNdx2axTzuyfJwPI+NeeHDpyuq0bWs 7a11Mr6DGurUspENrpUsuZXoSJOBaB/C696TgO0RHJrkb6+hXUyOUmmw8mHNwslnI7sN UbWd8naCprDI9V1v9exXiOwrB0LzsuRb29ODQx0r2+u5Lh0UW3k8cRJSbYhN4loY/Lnv phELNEUDPBL/jSZzJNODomfjJ5uIt2JVKdiEKpzux66eFXC7YnnzsYOh2r9Js1eeGJZ0 75YbkHk0LKWBgwnrSV2fY6Z++fZANTRvBohkVX+Jrcgp8Y1UwlmMSApb3a7l5xjF9fFo fIMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=pMCw+mv5lkQ6FhQ7YyfF/qisH9hT2P/o+KRSDhrwbEM=; b=ObLsJmdXwn7gLT7CLw6f+uvuN52S+E8LpssBOPfx8hgdkyCwslS7YwSTEyX/GakYK3 ptqQF9PH9KDsFwQYof68hGWGpQBBwYdCcUwrZacbENA9icv4YFdqYW3Woub2B6o141DL PvhXIyuNL4HbMJg8YX/+SnAG2kHar26b9zhMs7KboDqSudq2V2EtMWUeDKVWsbvwlm6+ Alu1ehS3OPpcOr+oFgDVz3/HPGVuE4LElsLNS7b+DVYt8eVJKwj8EGbwoJjzV2hnLyw8 0yF9DTc+hbH2AH/tbXOTvdW6YBX6LZkNxrOsqosGVUbOzjm8ik9PPnM7sSUxEsDNoYwj lUEg== X-Gm-Message-State: AElRT7G/tPKMCI4MRb/JqhHfNOBoi1sJBJyM5E5KKibjq0edoVXWJpSS y6c5f2xIHDAT1F47ztvVtB8= X-Received: by 2002:a17:902:50ec:: with SMTP id c41-v6mr3350590plj.208.1521231577080; Fri, 16 Mar 2018 13:19:37 -0700 (PDT) Received: from himanshu-Vostro-3559 ([103.46.193.14]) by smtp.gmail.com with ESMTPSA id q6sm14860217pga.37.2018.03.16.13.19.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 16 Mar 2018 13:19:36 -0700 (PDT) Date: Sat, 17 Mar 2018 01:49:25 +0530 From: Himanshu Jha To: Manish Narani Cc: jic23@kernel.org, knaack.h@gmx.de, lars@metafoo.de, pmeerw@pmeerw.net, michal.simek@xilinx.com, lee.jones@linaro.org, broonie@kernel.org, arnaud.pouliquen@st.com, quentin.schulz@free-electrons.com, linus.walleij@linaro.org, ksenija.stanojevic@gmail.com, arnd@arndb.de, martenli@axis.com, jan.kiszka@siemens.com, lukas@wunner.de, vilhelm.gray@gmail.com, geert+renesas@glider.be, fabio.estevam@nxp.com, jackoalan@gmail.com, mnarani@xilinx.com, mike.looijmans@topic.nl, alexander.sverdlin@gmail.com, jacopo+renesas@jmondi.org, linux-kernel@vger.kernel.org, linux-iio@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [RFC PATCH] iio: adc: Add Xilinx AMS driver Message-ID: <20180316201925.GA18013@himanshu-Vostro-3559> References: <1521124947-18950-1-git-send-email-mnarani@xilinx.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1521124947-18950-1-git-send-email-mnarani@xilinx.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Mar 15, 2018 at 08:12:27PM +0530, Manish Narani wrote: > The AMS includes an ADC as well as on-chip sensors that can be used to > sample external voltages and monitor on-die operating conditions, such as > temperature and supply voltage levels. The AMS has two SYSMON blocks. > PL-SYSMON block is capable of monitoring off chip voltage and temperature. > PL-SYSMON block has DRP, JTAG and I2C interface to enable monitoring from > external master. Out of these interface currently only DRP is supported. > Other block PS-SYSMON is memory mapped to PS. > > The AMS can use internal channels to monitor voltage and temperature > as well as one primary and up to 16 auxiliary channels for measuring > external voltages. > > The voltage and temperature monitoring channels also have event > capability which allows to generate an interrupt when their value > falls below or raises above a set threshold. > > Signed-off-by: Manish Narani > --- [..] > +static const struct of_device_id ams_of_match_table[] = { > + { .compatible = "xlnx,zynqmp-ams", &ams_pl_apb }, > + { } > +}; > +MODULE_DEVICE_TABLE(of, ams_of_match_table); [..] > +static int ams_probe(struct platform_device *pdev) > +{ > + struct iio_dev *indio_dev; > + struct ams *ams; > + struct resource *res; > + const struct of_device_id *id; > + int ret; > + > + if (!pdev->dev.of_node) > + return -ENODEV; > + > + id = of_match_node(ams_of_match_table, pdev->dev.of_node); > + if (!id) > + return -ENODEV; Is the above check required ? Isn't the probe function called if and only if a match is found in ams_of_match_table[] since it is a pure OF driver ? And therefore the above condition would never happen! > +static struct platform_driver ams_driver = { > + .probe = ams_probe, > + .remove = ams_remove, > + .driver = { > + .name = "ams", > + .pm = &ams_pm_ops, > + .of_match_table = ams_of_match_table, > + }, > +}; > +module_platform_driver(ams_driver); -- Thanks Himanshu Jha