From: Jonathan Cameron <jic23@kernel.org>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: "linux-iio@vger.kernel.org" <linux-iio@vger.kernel.org>,
Crestez Dan Leonard <leonard.crestez@intel.com>,
Lars-Peter Clausen <lars@metafoo.de>,
Peter Meerwald <pmeerw@pmeerw.net>,
Daniel Baluta <daniel.baluta@intel.com>
Subject: Re: [PATCH 2/2] iio: light: bh1780: assign a static name
Date: Sun, 19 Jun 2016 20:38:05 +0100 [thread overview]
Message-ID: <9b36d76c-70d8-6f9c-2571-0b56351e28c6@kernel.org> (raw)
In-Reply-To: <CACRpkdYTuJ65aTTyY7427ndYF6edJOVedGHXM_2iMjTQPf5X7g@mail.gmail.com>
On 19/06/16 19:04, Linus Walleij wrote:
> On Sun, Jun 19, 2016 at 1:25 PM, Jonathan Cameron <jic23@kernel.org> wrote:
>
>>>> Using the struct i2c_device->id field for naming the light sensor
>>>> is a bad idea: when booting from the pure device tree this is NULL
>
>> Hmm. Just revisiting this whilst reviewing another driver. What the heck
>> is the 'right' way of getting hold of the registered name in this case?
>> I guess getting it from an of lookup if one has been used?
>> So of_device_match and then the name field?
>
> Good question.
>
> Some code like drivers/iio/magnetometer/ak8975.c uses this:
> dev_name(&client->dev)
>
> Which will give a silly bus name like this (from /proc/interrupts):
>
> 234: 0 0 pm8xxx 224 Edge 0-000c
>
> "0-000c" (device 0x0c on i2c bus 0)
>
> It will be unique but not very human readable.
The name field was always really intended to just be the part number.
There are lots of other ways of finding out 'where' it is.
Jonathan
>
> Yours,
> Linus Walleij
>
next prev parent reply other threads:[~2016-06-19 19:38 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-25 7:40 [PATCH 1/2] iio: bh1780: dereference the client properly Linus Walleij
2016-05-25 7:40 ` [PATCH 2/2] iio: light: bh1780: assign a static name Linus Walleij
2016-05-29 18:53 ` Jonathan Cameron
2016-06-19 11:25 ` Jonathan Cameron
2016-06-19 18:04 ` Linus Walleij
2016-06-19 19:38 ` Jonathan Cameron [this message]
2016-05-29 18:52 ` [PATCH 1/2] iio: bh1780: dereference the client properly 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=9b36d76c-70d8-6f9c-2571-0b56351e28c6@kernel.org \
--to=jic23@kernel.org \
--cc=daniel.baluta@intel.com \
--cc=lars@metafoo.de \
--cc=leonard.crestez@intel.com \
--cc=linus.walleij@linaro.org \
--cc=linux-iio@vger.kernel.org \
--cc=pmeerw@pmeerw.net \
/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).