lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHp75VcXNGb5Poo8iKBJen52=FhNHUHqYc6Vz0mV7gwcETOHgw@mail.gmail.com>
Date:   Tue, 17 Nov 2020 13:05:04 +0200
From:   Andy Shevchenko <andy.shevchenko@...il.com>
To:     Jonathan Cameron <Jonathan.Cameron@...wei.com>
Cc:     Alexandru Ardelean <alexandru.ardelean@...log.com>,
        linux-iio <linux-iio@...r.kernel.org>,
        devicetree <devicetree@...r.kernel.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        Jonathan Cameron <jic23@...nel.org>,
        Rob Herring <robh+dt@...nel.org>,
        Vaishnav M A <vaishnav@...gleboard.org>
Subject: Re: [PATCH 2/3] iio: adc: ad7887: convert driver to full DT probing

On Tue, Nov 17, 2020 at 1:01 PM Jonathan Cameron
<Jonathan.Cameron@...wei.com> wrote:
>
> On Tue, 17 Nov 2020 09:52:53 +0200
> Alexandru Ardelean <alexandru.ardelean@...log.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@...log.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ