Skip to contentSkip to conversation

mfd: sprd: Add SPI device ID table

PATCH Applied Mark Brown 3 participants 3 messages Feb 2, 2022 – Feb 14, 2022

Subsystems (2)
lore
Share & tools
lore

Mark Brown

author
#0 lore raw

PATCH 1/1 mfd: sprd: Add SPI device ID table

Currently autoloading for SPI devices does not use the DT ID table, it uses SPI modalises. Supporting OF modalises is going to be difficult if not impractical, an attempt was made but has been reverted, so ensure that module autoloading works for this driver by adding a SPI device ID table.

Fixes 96c8395e2166 ("spi: Revert modalias changes")
Cc Orson Zhai <[email protected]>
Cc Baolin Wang <[email protected]>
Cc Chunyan Zhang <[email protected]>

---

Rebased onto v5.17-rc1.

 drivers/mfd/sprd-sc27xx-spi.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/mfd/sprd-sc27xx-spi.c +6 -0
index 55d2c31bdfb2..864031eccd4c 100644
@@ -239,6 +239,12 @@ static int sprd_pmic_resume(struct device *dev)
 
 static SIMPLE_DEV_PM_OPS(sprd_pmic_pm_ops, sprd_pmic_suspend, sprd_pmic_resume);
 
+static const struct spi_device_id sprd_pmic_spi_ids[] = {
+	{ .name = "sc2731", .driver_data = (unsigned long)&sc2731_data },
+	{},
+};
+MODULE_DEVICE_TABLE(spi, sprd_pmic_spi_ids);
+
 static const struct of_device_id sprd_pmic_match[] = {
 	{ .compatible = "sprd,sc2731", .data = &sc2731_data },
 	{ .compatible = "sprd,sc2730", .data = &sc2730_data },
Signature · 1 line
2.30.2
#1 lore raw
I love your patch! Yet something to improve:

Hi Mark,

I love your patch! Yet something to improve:

[auto build test ERROR on lee-mfd/for-mfd-next]
[also build test ERROR on linux/master linus/master v5.17-rc2 next-20220202] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Mark-Brown/mfd-sprd-Add-SPI-device-ID-table/20220202-225306
base:   https://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git for-mfd-next
config: alpha-allmodconfig (https://download.01.org/0day-ci/archive/20220203/202202030612.SNF98yc5-lkp(a)intel.com/config)
compiler: alpha-linux-gcc (GCC) 11.2.0

reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
# https://github.com/0day-ci/linux/commit/58e9e172a84cdd6af58985e7393703b5c2d23967
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Mark-Brown/mfd-sprd-Add-SPI-device-ID-table/20220202-225306 git checkout 58e9e172a84cdd6af58985e7393703b5c2d23967
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=alpha SHELL=/bin/bash drivers/

If you fix the issue, kindly add following tag as appropriate

All errors (new ones prefixed by >>):

>> drivers/mfd/sprd-sc27xx-spi.c:255:35: error: redefinition of 'sprd_pmic_spi_ids'
     255 | static const struct spi_device_id sprd_pmic_spi_ids[] = {
         |                                   ^~~~~~~~~~~~~~~~~
   drivers/mfd/sprd-sc27xx-spi.c:242:35: note: previous definition of 'sprd_pmic_spi_ids' with type 'const struct spi_device_id[2]'
     242 | static const struct spi_device_id sprd_pmic_spi_ids[] = {
         |                                   ^~~~~~~~~~~~~~~~~

vim +/sprd_pmic_spi_ids +255 drivers/mfd/sprd-sc27xx-spi.c

25ca4ae43466a4 Baolin Wang 2017-11-01 254

c5c7f067710705 Mark Brown  2021-09-24 @255  static const struct spi_device_id sprd_pmic_spi_ids[] = {
c5c7f067710705 Mark Brown  2021-09-24  256  	{ .name = "sc2731", .driver_data = (unsigned long)&sc2731_data },
c5c7f067710705 Mark Brown  2021-09-24  257  	{},
c5c7f067710705 Mark Brown  2021-09-24  258  };
c5c7f067710705 Mark Brown  2021-09-24  259  MODULE_DEVICE_TABLE(spi, sprd_pmic_spi_ids);
c5c7f067710705 Mark Brown  2021-09-24  260  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

Applied
#2 lore raw
In reply to Mark Brown
Quoted 10 lines · Mark Brown

Currently autoloading for SPI devices does not use the DT ID table, it uses SPI modalises. Supporting OF modalises is going to be difficult if not impractical, an attempt was made but has been reverted, so ensure that module autoloading works for this driver by adding a SPI device ID table.

Fixes 96c8395e2166 ("spi: Revert modalias changes")
Cc Orson Zhai <[email protected]>
Cc Baolin Wang <[email protected]>
Cc Chunyan Zhang <[email protected]>
Quoted 6 lines

---

Rebased onto v5.17-rc1.

 drivers/mfd/sprd-sc27xx-spi.c | 6 ++++++
 1 file changed, 6 insertions(+)

Applied, thanks.

Signature · 4 lines
Lee Jones [李琼斯]
Principal Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog