mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Florian Vaussard <florian.vaussard@heig-vd.ch>
To: Peter Rosin <peda@axentia.se>, <devicetree@vger.kernel.org>,
	Jonathan Cameron <jic23@kernel.org>,
	Hartmut Knaack <knaack.h@gmx.de>,
	Lars-Peter Clausen <lars@metafoo.de>,
	Peter Meerwald-Stadler <pmeerw@pmeerw.net>
Cc: Rob Herring <robh+dt@kernel.org>, Pawel Moll <pawel.moll@arm.com>,
	Mark Rutland <mark.rutland@arm.com>,
	Ian Campbell <ijc+devicetree@hellion.org.uk>,
	Kumar Gala <galak@codeaurora.org>,
	Slawomir Stepien <sst@poczta.fm>,
	Joachim Eastwood <manabian@gmail.com>,
	Matt Ranostay <mranostay@gmail.com>,
	Cristina Moraru <cristina.moraru09@gmail.com>,
	<linux-iio@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	Vaussard Florian <florian.vaussard@heig-vd.ch>
Subject: Re: [PATCH 3/3] iio: potentiometer: mcp4531: Add device tree binding
Date: Wed, 22 Jun 2016 08:22:46 +0200	[thread overview]
Message-ID: <829a4507-39d7-e04a-9672-6309def89ee2@heig-vd.ch> (raw)
In-Reply-To: <bf4dbd64-aac8-aba3-ec5c-4cd4d0e848f6@axentia.se>

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 <florian.vaussard@heig-vd.ch>
>> ---
>>  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 <linux/module.h>
>>  #include <linux/i2c.h>
>>  #include <linux/err.h>
>> +#include <linux/of.h>
>> +#include <linux/of_device.h>
>>  
>>  #include <linux/iio/iio.h>
>>  
>> @@ -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

  reply	other threads:[~2016-06-22  6:23 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-21  6:55 [PATCH 0/3] iio: potentiometer: mcp4531: New parts and device tree Florian Vaussard
2016-06-21  6:55 ` [PATCH 1/3] iio: potentiometer: mcp4531: Add support for MCP454x, MCP456x, MCP464x and MCP466x Florian Vaussard
2016-06-21  7:28   ` Peter Rosin
2016-06-21  6:55 ` [PATCH 2/3] iio: potentiometer: mcp4531: Add device tree binding documentation Florian Vaussard
2016-06-21  7:38   ` Peter Rosin
2016-06-21  7:49     ` Florian Vaussard
2016-06-21 21:37       ` Rob Herring
2016-06-21 21:43   ` Rob Herring
2016-06-22  6:19     ` Florian Vaussard
2016-06-21  6:55 ` [PATCH 3/3] iio: potentiometer: mcp4531: Add device tree binding Florian Vaussard
2016-06-21  7:34   ` kbuild test robot
2016-06-21  7:51   ` Peter Rosin
2016-06-22  6:22     ` Florian Vaussard [this message]
2016-06-22  7:06       ` Peter Rosin
2016-06-23  8:50         ` Florian Vaussard
2016-06-26 14:53           ` Jonathan Cameron
2016-06-26 14:53 ` [PATCH 0/3] iio: potentiometer: mcp4531: New parts and device tree Jonathan Cameron

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=829a4507-39d7-e04a-9672-6309def89ee2@heig-vd.ch \
    --to=florian.vaussard@heig-vd.ch \
    --cc=cristina.moraru09@gmail.com \
    --cc=devicetree@vger.kernel.org \
    --cc=galak@codeaurora.org \
    --cc=ijc+devicetree@hellion.org.uk \
    --cc=jic23@kernel.org \
    --cc=knaack.h@gmx.de \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=manabian@gmail.com \
    --cc=mark.rutland@arm.com \
    --cc=mranostay@gmail.com \
    --cc=pawel.moll@arm.com \
    --cc=peda@axentia.se \
    --cc=pmeerw@pmeerw.net \
    --cc=robh+dt@kernel.org \
    --cc=sst@poczta.fm \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®