From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751659AbcFVGXA (ORCPT ); Wed, 22 Jun 2016 02:23:00 -0400 Received: from mailcl0.heig-vd.ch ([193.134.216.181]:36039 "EHLO heig-vd.ch" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751198AbcFVGW5 (ORCPT ); Wed, 22 Jun 2016 02:22:57 -0400 Subject: Re: [PATCH 3/3] iio: potentiometer: mcp4531: Add device tree binding To: Peter Rosin , , Jonathan Cameron , Hartmut Knaack , Lars-Peter Clausen , Peter Meerwald-Stadler References: <1466492137-32683-1-git-send-email-florian.vaussard@heig-vd.ch> <1466492137-32683-4-git-send-email-florian.vaussard@heig-vd.ch> CC: Rob Herring , Pawel Moll , Mark Rutland , Ian Campbell , Kumar Gala , Slawomir Stepien , Joachim Eastwood , Matt Ranostay , Cristina Moraru , , , Vaussard Florian From: Florian Vaussard Message-ID: <829a4507-39d7-e04a-9672-6309def89ee2@heig-vd.ch> Date: Wed, 22 Jun 2016 08:22:46 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 8bit X-Originating-IP: [10.192.93.248] X-ClientProxiedBy: EINTFEA.einet.ad.eivd.ch (10.192.41.59) To EINTMBXC.einet.ad.eivd.ch (10.192.41.65) X-MailCleaner-RDNS: invalid reverse DNS for 10.192.41.61 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello Peter, Le 21. 06. 16 à 09:51, Peter Rosin a écrit : > On 2016-06-21 08:55, Florian Vaussard wrote: >> This patch adds the necessary device tree binding to allow DT probing of >> currently supported parts. >> >> Signed-off-by: Florian Vaussard >> --- >> drivers/iio/potentiometer/mcp4531.c | 83 ++++++++++++++++++++++++++++++++++++- >> 1 file changed, 82 insertions(+), 1 deletion(-) >> >> diff --git a/drivers/iio/potentiometer/mcp4531.c b/drivers/iio/potentiometer/mcp4531.c >> index 2251173..41a1e46 100644 >> --- a/drivers/iio/potentiometer/mcp4531.c >> +++ b/drivers/iio/potentiometer/mcp4531.c >> @@ -31,6 +31,8 @@ >> #include >> #include >> #include >> +#include >> +#include >> >> #include >> >> @@ -188,12 +190,84 @@ static const struct iio_info mcp4531_info = { >> .driver_module = THIS_MODULE, >> }; >> >> +#ifdef CONFIG_OF >> +static const struct of_device_id mcp45xx_of_match[] = { > > Should be named mcp4531_of_match, also the casting to void and > then back to an integer type is ugly. Would it work to store a > pointer directly into the mcp4531_cfg array instead? I.e. > > { .compatible = "microchip,mcp4531-502", .data = &mcp4531_cfg[MCP453x_502] }, > etc > > and then adjust accordingly in mcp4531_probe()? > Yes the casting is pretty ugly. And kbuild agrees with you :) I took this from another driver (lame excuse). Your suggestion is sensible, I will give it a try. > That is, if you need this patch at all, see my reply to 2/3... > This seems necessary in order to have the vendor ID in the compatible string. Thanks for your review. Florian