Re: [PATCH v1] spi: add of_device_uevent_modalias support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 21-06-04 16:45, Mark Brown wrote:
> On Tue, May 25, 2021 at 11:10:03AM +0200, Marco Felsch wrote:
> > Add OF support as already done for ACPI to take driver
> > MODULE_DEVICE_TABLE(of, ..) into account.
> > 
> > For example with this change a spi nor device MODALIAS changes from:
> > 
> > MODALIAS=spi:spi-nor
> > 
> > to
> > 
> > MODALIAS=of:Nspi-flashT(null)Cjedec,spi-nor
> 
> Will this break existing userspace?

No, if I understood the mechanism correctly. 

The MODULE_DEVICE_TABLE(of, ..) and the MODULE_DEVICE_TABLE(spi, ..)
should equal except for the "vendor," prefix used by the
MODULE_DEVICE_TABLE(of, ..). If a driver don't support
MODULE_DEVICE_TABLE(of, ..) we fallback to the
MODULE_DEVICE_TABLE(spi, ..).

I would instead say that it fixes at least the spi-nor usage e.g.

spi-nor@0 {
	compatible = "vendor,product", "jedec,spi-nor";
}

is a common OF usage: the compatible list goes from the exact compatible
to the least common compatible. Here I should fix my commit message
which should include this line:
"MODALIAS=of:Nspi-flashT(null)Cwinbond,w25q16dwCjedec,spi-nor".

Anyway this scenario don't work for spi-nor driver since the spi-core
only take the MODULE_DEVICE_TABLE(spi, ..) into account. So the
compatible must not include the "vendor,product" compatible.

With my change in place we can specify the 'complete' compatible list.

Regards,
  Marco

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



[Index of Archives]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux