lkml.org 
[lkml]   [2021]   [Jan]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH] spi: spidev: Fix so the module is autoloaded when built as external
    Date
    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.

    Signed-off-by: Gustav Wiklander <gustavwi@axis.com>
    ---
    drivers/spi/spidev.c | 15 ++++++++++++++-
    1 file changed, 14 insertions(+), 1 deletion(-)

    diff --git a/drivers/spi/spidev.c b/drivers/spi/spidev.c
    index 859910ec8d9f..5cf419a046da 100644
    --- a/drivers/spi/spidev.c
    +++ b/drivers/spi/spidev.c
    @@ -687,6 +687,19 @@ static const struct of_device_id spidev_dt_ids[] = {
    MODULE_DEVICE_TABLE(of, spidev_dt_ids);
    #endif

    +static const struct spi_device_id spidev_ids[] = {
    + { .name = "dh2228fv" },
    + { .name = "ltc2488" },
    + { .name = "achc" },
    + { .name = "sx1301" },
    + { .name = "bk4" },
    + { .name = "dhcom-board" },
    + { .name = "m53cpld" },
    + { .name = "xc7a35t" },
    + {},
    +};
    +MODULE_DEVICE_TABLE(spi, spidev_ids);
    +
    #ifdef CONFIG_ACPI

    /* Dummy SPI devices not to be used in production systems */
    @@ -817,7 +830,7 @@ static struct spi_driver spidev_spi_driver = {
    },
    .probe = spidev_probe,
    .remove = spidev_remove,
    -
    + .id_table = spidev_ids,
    /* NOTE: suspend/resume methods are not necessary here.
    * We don't do anything except pass the requests to/from
    * the underlying controller. The refrigerator handles
    --
    2.11.0
    \
     
     \ /
      Last update: 2021-01-04 16:45    [W:5.313 / U:0.008 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site