public inbox for linux-spi@vger.kernel.org
 help / color / mirror / Atom feed
From: Gustav Wiklander <gustavwi@axis.com>
To: Mark Brown <broonie@kernel.org>,
	Gustav Wiklander <gustav.wiklander@axis.com>
Cc: <kernel@axis.com>, <linux-spi@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] spi: spidev: Fix so the module is autoloaded when built as external
Date: Tue, 5 Jan 2021 10:44:21 +0100	[thread overview]
Message-ID: <124e3214-37b9-524b-7888-a31e8cb455da@axis.com> (raw)
In-Reply-To: <20210104213437.GM5645@sirena.org.uk>

On 1/4/21 10:34 PM, Mark Brown wrote:
> On Mon, Jan 04, 2021 at 04:34:35PM +0100, Gustav Wiklander wrote:
>> From: Gustav Wiklander <gustavwi@axis.com>
>>
>> The spi framework sets the modalias for the spi device to belong in
>> either the acpi device table or the SPI device table. It can never
>> be in the OF table. Therefore the spidev driver should populate the
>> spi device table rather than the OF table.
>>
>> NOTE: platform drivers and i2c drivers support aliases in the
>>        OF device table.
> 
> Why is this a good solution rather than ensuring the the OF IDs can be
> used directly?
> 

Hi Mark,

You suggestion is of course a solid alternative forward. However, the 
downside with supporting the OF device table for automatic module 
loading is that a lot of spi device drivers must be updated. Also
it is unclear what is the preferred way to do this in the kernel see
this patch:
https://lore.kernel.org/lkml/20190618052644.32446-1-bjorn.andersson@linaro.org/

If adding support of OF device table the spi device drivers must now 
include a MODULE_DEVICE_TABLE(of,...) as the spi device alias will no 
longer match the alias in the module.

This command gives 186 spi device drivers.
git grep "MODULE_DEVICE_TABLE(spi" | wc -l 

186

Best regards
Gustav Wiklander

  reply	other threads:[~2021-01-05  9:45 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-04 15:34 [PATCH] spi: spidev: Fix so the module is autoloaded when built as external Gustav Wiklander
2021-01-04 21:34 ` Mark Brown
2021-01-05  9:44   ` Gustav Wiklander [this message]
2021-01-07 17:40     ` Mark Brown

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=124e3214-37b9-524b-7888-a31e8cb455da@axis.com \
    --to=gustavwi@axis.com \
    --cc=broonie@kernel.org \
    --cc=gustav.wiklander@axis.com \
    --cc=kernel@axis.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-spi@vger.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