From: r yang <decatf@gmail.com>
To: Jonathan Cameron <jic23@kernel.org>
Cc: Hartmut Knaack <knaack.h@gmx.de>,
Lars-Peter Clausen <lars@metafoo.de>,
Peter Meerwald-Stadler <pmeerw@pmeerw.net>,
Rob Herring <robh+dt@kernel.org>,
Mark Rutland <mark.rutland@arm.com>,
linux-iio@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 2/2] iio: light: bh1750: Add device tree support
Date: Sat, 22 Sep 2018 16:34:49 -0400 [thread overview]
Message-ID: <20180922203449.GA20818@r> (raw)
In-Reply-To: <20180922195922.24791-2-decatf@gmail.com>
On Sat, Sep 22, 2018 at 03:59:22PM -0400, ryang wrote:
> Add device tree support for ROHM BH1750 series ambient light sensors.
>
> Signed-off-by: ryang <decatf@gmail.com>
> ---
> Changes in v2:
> - Export module device table
>
> drivers/iio/light/bh1750.c | 11 +++++++++++
> 1 file changed, 11 insertions(+)
>
> diff --git a/drivers/iio/light/bh1750.c b/drivers/iio/light/bh1750.c
> index c3a481452b67..ffe2e6d9c2e4 100644
> --- a/drivers/iio/light/bh1750.c
> +++ b/drivers/iio/light/bh1750.c
> @@ -307,9 +307,20 @@ static const struct i2c_device_id bh1750_id[] = {
> };
> MODULE_DEVICE_TABLE(i2c, bh1750_id);
>
> +static const struct of_device_id bh1750_of_match[] = {
> + { .compatible = "rohm,bh1710", },
> + { .compatible = "rohm,bh1715", },
> + { .compatible = "rohm,bh1721", },
> + { .compatible = "rohm,bh1750", },
> + { .compatible = "rohm,bh1751", },
> + { }
> +};
> +MODULE_DEVICE_TABLE(of, bh1750_of_match);
> +
> static struct i2c_driver bh1750_driver = {
> .driver = {
> .name = "bh1750",
> + .of_match_table = of_match_ptr(bh1750_of_match),
Jonathan,
Don't take this patch. I realized that of_match_ptr is NULL when _not_
using CONFIG_OF. So that macro shouldn't be used. Apologies for the bit
of mess. I'll send a V3 shortly.
> .pm = &bh1750_pm_ops,
> },
> .probe = bh1750_probe,
> --
> 2.17.1
>
prev parent reply other threads:[~2018-09-22 20:34 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-22 19:59 [PATCH v2 1/2] dt-bindings: iio: light: bh1750: Add device tree binding documentation ryang
2018-09-22 19:59 ` [PATCH v2 2/2] iio: light: bh1750: Add device tree support ryang
2018-09-22 20:34 ` r yang [this message]
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=20180922203449.GA20818@r \
--to=decatf@gmail.com \
--cc=devicetree@vger.kernel.org \
--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=mark.rutland@arm.com \
--cc=pmeerw@pmeerw.net \
--cc=robh+dt@kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).