linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andy Shevchenko <andy.shevchenko@gmail.com>
To: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Alexandru Ardelean <alexandru.ardelean@analog.com>,
	linux-iio <linux-iio@vger.kernel.org>,
	devicetree <devicetree@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Jonathan Cameron <jic23@kernel.org>,
	Rob Herring <robh+dt@kernel.org>,
	Vaishnav M A <vaishnav@beagleboard.org>
Subject: Re: [PATCH 2/3] iio: adc: ad7887: convert driver to full DT probing
Date: Tue, 17 Nov 2020 13:05:04 +0200	[thread overview]
Message-ID: <CAHp75VcXNGb5Poo8iKBJen52=FhNHUHqYc6Vz0mV7gwcETOHgw@mail.gmail.com> (raw)
In-Reply-To: <20201117110111.0000468a@Huawei.com>

On Tue, Nov 17, 2020 at 1:01 PM Jonathan Cameron
<Jonathan.Cameron@huawei.com> wrote:
>
> On Tue, 17 Nov 2020 09:52:53 +0200
> Alexandru Ardelean <alexandru.ardelean@analog.com> wrote:
>
> > This change removes the SPI device table, adds an OF device table instead.
> > This should also be usable for ACPI via PRP0001.
> >
> > This device is usually probed via device-tree, so it makes more sense to
> > use the OF device table.
> >
> > Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
> So, we've had a few cases of having to put the device_id table
> back again recently.
> https://lore.kernel.org/linux-iio/20201101152613.2c37581a@archlinux/
>
> They tend to be due to greybus doing it's probing in yet another fashion.
> So far they've been all i2c devices, but I kind of assume it does the same for spi.
> https://elixir.bootlin.com/linux/latest/source/drivers/staging/greybus/spilib.c#L437
>
> How device_get_match_data() plays with that I'm not sure. It probably
> doesn't right now given swnode doesn't have a device_get_match_data() callback.
>
> https://elixir.bootlin.com/linux/latest/source/drivers/base/swnode.c#L539
>
> So after all that I think I've argued myself around to thinking what you have
> here is fine.  If someone wants to support this via a swnode then they can
> figure out how to make that work.
>
> +CC Vaishnav and Andy for their input.

device_get_match_data() doesn't know about bus type specifics. One may
introduce a helper like

const void *spi_device_get_match_data(dev)
{
  const void *match = device_get_match_data(dev);
  if (match)
    return match;
  return spi_dev_id....;
}

And use it with the SPI ID table.

-- 
With Best Regards,
Andy Shevchenko

  parent reply	other threads:[~2020-11-17 11:05 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-17  7:52 [PATCH 1/3] iio: adc: ad7887: convert dual-channel mode to DT/ACPI Alexandru Ardelean
2020-11-17  7:52 ` [PATCH 2/3] iio: adc: ad7887: convert driver to full DT probing Alexandru Ardelean
2020-11-17 11:01   ` Jonathan Cameron
2020-11-17 11:04     ` Jonathan Cameron
2020-11-17 15:03       ` Alexandru Ardelean
2020-11-17 16:02         ` Jonathan Cameron
2020-11-18 12:59           ` Alexandru Ardelean
2020-11-18 16:06             ` Jonathan Cameron
2020-11-17 11:05     ` Andy Shevchenko [this message]
2020-11-17  7:52 ` [PATCH 3/3] dt-bindings: adc: ad7887: add binding doc for AD7887 Alexandru Ardelean
2020-11-17 11:03   ` Jonathan Cameron
2020-11-17 10:41 ` [PATCH 1/3] iio: adc: ad7887: convert dual-channel mode to DT/ACPI Jonathan Cameron
2020-11-17 11:08   ` Andy Shevchenko
2020-11-18 12:52     ` Alexandru Ardelean

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='CAHp75VcXNGb5Poo8iKBJen52=FhNHUHqYc6Vz0mV7gwcETOHgw@mail.gmail.com' \
    --to=andy.shevchenko@gmail.com \
    --cc=Jonathan.Cameron@huawei.com \
    --cc=alexandru.ardelean@analog.com \
    --cc=devicetree@vger.kernel.org \
    --cc=jic23@kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robh+dt@kernel.org \
    --cc=vaishnav@beagleboard.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).