spi: Make SPI core to take care of fwnode assignment
Subsystems (57)
Andy Shevchenko
reviewercover spi: Make SPI core to take care of fwnode assignment
It seems all of the SPI drivers want to propagate fwnode (or of_node) of the physical device to the SPI device. Make sure we don't duplicate it over and over in each new driver (+2 in this cycle) by making core to take care of that. Note, similar is done already by IIO and I²C subsystems.
There is one noticeable and quite specific case that is taken care in the first patch and would be nice to have a confirmation from Cirrus that everything is okay. The rest is just a mechanical conversion.
Andy Shevchenko (4):
spi: Propagate default fwnode to the SPI controller device
spi: Drop duplicate of_node assignment
spi: Drop duplicate fwnode assignment
spi: Drop duplicate device_set_node() call
drivers/spi/atmel-quadspi.c | 1 - drivers/spi/spi-airoha-snfi.c | 1 - drivers/spi/spi-altera-platform.c | 2 -- drivers/spi/spi-amlogic-spifc-a1.c | 1 - drivers/spi/spi-amlogic-spisg.c | 1 - drivers/spi/spi-apple.c | 1 - drivers/spi/spi-ar934x.c | 1 - drivers/spi/spi-armada-3700.c | 4 +--- drivers/spi/spi-aspeed-smc.c | 1 - drivers/spi/spi-atcspi200.c | 1 - drivers/spi/spi-ath79.c | 1 - drivers/spi/spi-atmel.c | 1 - drivers/spi/spi-axi-spi-engine.c | 1 - drivers/spi/spi-bcm-qspi.c | 1 - drivers/spi/spi-bcm2835.c | 1 - drivers/spi/spi-bcm2835aux.c | 1 - drivers/spi/spi-bcm63xx-hsspi.c | 1 - drivers/spi/spi-bcm63xx.c | 1 - drivers/spi/spi-bcmbca-hsspi.c | 1 - drivers/spi/spi-cadence-quadspi.c | 1 - drivers/spi/spi-cadence-xspi.c | 1 - drivers/spi/spi-cadence.c | 1 - drivers/spi/spi-cavium-octeon.c | 1 - drivers/spi/spi-cavium-thunderx.c | 1 - drivers/spi/spi-clps711x.c | 1 - drivers/spi/spi-cs42l43.c | 8 ++++++++ drivers/spi/spi-davinci.c | 1 - drivers/spi/spi-dln2.c | 2 -- drivers/spi/spi-dw-core.c | 2 -- drivers/spi/spi-ep93xx.c | 1 - drivers/spi/spi-falcon.c | 1 - drivers/spi/spi-fsl-dspi.c | 1 - drivers/spi/spi-fsl-espi.c | 1 - drivers/spi/spi-fsl-lib.c | 1 - drivers/spi/spi-fsl-lpspi.c | 1 - drivers/spi/spi-geni-qcom.c | 1 - drivers/spi/spi-gpio.c | 1 - drivers/spi/spi-gxp.c | 1 - drivers/spi/spi-hisi-kunpeng.c | 1 - drivers/spi/spi-img-spfi.c | 1 - drivers/spi/spi-imx.c | 1 - drivers/spi/spi-ingenic.c | 1 - drivers/spi/spi-lantiq-ssc.c | 1 - drivers/spi/spi-ljca.c | 1 - drivers/spi/spi-loongson-core.c | 1 - drivers/spi/spi-lp8841-rtc.c | 1 - drivers/spi/spi-meson-spicc.c | 1 - drivers/spi/spi-meson-spifc.c | 1 - drivers/spi/spi-microchip-core-spi.c | 1 - drivers/spi/spi-mpc512x-psc.c | 2 -- drivers/spi/spi-mpc52xx-psc.c | 2 -- drivers/spi/spi-mpc52xx.c | 1 - drivers/spi/spi-mpfs.c | 1 - drivers/spi/spi-mt65xx.c | 1 - drivers/spi/spi-mt7621.c | 1 - drivers/spi/spi-mtk-nor.c | 1 - drivers/spi/spi-mtk-snfi.c | 1 - drivers/spi/spi-mux.c | 1 - drivers/spi/spi-mxic.c | 1 - drivers/spi/spi-npcm-fiu.c | 1 - drivers/spi/spi-npcm-pspi.c | 1 - drivers/spi/spi-nxp-fspi.c | 2 -- drivers/spi/spi-nxp-xspi.c | 1 - drivers/spi/spi-oc-tiny.c | 1 - drivers/spi/spi-orion.c | 1 - drivers/spi/spi-pl022.c | 1 - drivers/spi/spi-pxa2xx.c | 2 -- drivers/spi/spi-qcom-qspi.c | 1 - drivers/spi/spi-qpic-snand.c | 1 - drivers/spi/spi-qup.c | 1 - drivers/spi/spi-rb4xx.c | 1 - drivers/spi/spi-realtek-rtl-snand.c | 1 - drivers/spi/spi-realtek-rtl.c | 1 - drivers/spi/spi-rockchip-sfc.c | 1 - drivers/spi/spi-rockchip.c | 1 - drivers/spi/spi-rspi.c | 1 - drivers/spi/spi-rzv2h-rspi.c | 2 -- drivers/spi/spi-rzv2m-csi.c | 2 -- drivers/spi/spi-s3c64xx.c | 1 - drivers/spi/spi-sc18is602.c | 2 -- drivers/spi/spi-sg2044-nor.c | 1 - drivers/spi/spi-sh-hspi.c | 1 - drivers/spi/spi-sh-msiof.c | 1 - drivers/spi/spi-sifive.c | 1 - drivers/spi/spi-slave-mt27xx.c | 1 - drivers/spi/spi-sn-f-ospi.c | 1 - drivers/spi/spi-sprd-adi.c | 1 - drivers/spi/spi-sprd.c | 1 - drivers/spi/spi-stm32-ospi.c | 1 - drivers/spi/spi-stm32-qspi.c | 1 - drivers/spi/spi-stm32.c | 1 - drivers/spi/spi-sun4i.c | 1 - drivers/spi/spi-sun6i.c | 1 - drivers/spi/spi-sunplus-sp7021.c | 1 - drivers/spi/spi-synquacer.c | 3 --- drivers/spi/spi-tegra114.c | 1 - drivers/spi/spi-tegra20-sflash.c | 1 - drivers/spi/spi-tegra20-slink.c | 1 - drivers/spi/spi-tegra210-quad.c | 1 - drivers/spi/spi-ti-qspi.c | 1 - drivers/spi/spi-uniphier.c | 1 - drivers/spi/spi-virtio.c | 2 -- drivers/spi/spi-wpcm-fiu.c | 1 - drivers/spi/spi-xcomm.c | 1 - drivers/spi/spi-xilinx.c | 1 - drivers/spi/spi-xlp.c | 1 - drivers/spi/spi-xtensa-xtfpga.c | 1 - drivers/spi/spi.c | 3 +++ 108 files changed, 12 insertions(+), 121 deletions(-)
Signature · 1 line
2.50.1
Andy Shevchenko
reviewerPATCH 1/4 spi: Propagate default fwnode to the SPI controller device
Most of the SPI controller drivers share the parent's fwnode by explicit assignment. Propagate the default by SPI core, so they may drop that in the code. Only corner cases may require a special treatment and we simply (re)assign the controller's fwnode explicitly (as it's done right now, no changes required for that).
--- drivers/spi/spi-cs42l43.c | 8 ++++++++ drivers/spi/spi.c | 3 +++ 2 files changed, 11 insertions(+)
drivers/spi/spi-cs42l43.c +8 -0
@@ -371,6 +371,14 @@ static int cs42l43_spi_probe(struct platform_device *pdev)fwnode_property_read_u32 (xu_fwnode,"01fa-sidecar-instances" , &nsidecars); +/* +* Depending on the value of nsidecars we either create a software node +* or assign an fwnode. We don't want software node to be attached to +* the default one. That's why we need to clear the SPI controller fwnode +* first. +*/ +device_set_node (&priv->ctlr->dev,NULL ); +if (nsidecars) {struct software_node_ref_args args[] = {SOFTWARE_NODE_REFERENCE (fwnode,0 ,GPIO_ACTIVE_LOW ),
drivers/spi/spi.c +3 -0
@@ -3072,6 +3072,9 @@ struct spi_controller *__spi_alloc_controller(struct device *dev,else ctlr->dev.class = &spi_controller_class; ctlr->dev.parent = dev; + +device_set_node (&ctlr->dev,dev_fwnode (dev)); +pm_suspend_ignore_children (&ctlr->dev, true);spi_controller_set_devdata (ctlr, (void *)ctlr + ctlr_size);
Signature · 1 line
2.50.1
Andy Shevchenko
reviewerPATCH 2/4 spi: Drop duplicate of_node assignment
In reply to Andy ShevchenkoThe SPI core provides the default of_node for the controller, inherited from the actual (parent) device. No need to repeat it in the driver.
--- drivers/spi/atmel-quadspi.c | 1 - drivers/spi/spi-altera-platform.c | 2 -- drivers/spi/spi-amlogic-spifc-a1.c | 1 - drivers/spi/spi-amlogic-spisg.c | 1 - drivers/spi/spi-apple.c | 1 - drivers/spi/spi-ar934x.c | 1 - drivers/spi/spi-armada-3700.c | 4 +--- drivers/spi/spi-aspeed-smc.c | 1 - drivers/spi/spi-atcspi200.c | 1 - drivers/spi/spi-ath79.c | 1 - drivers/spi/spi-atmel.c | 1 - drivers/spi/spi-axi-spi-engine.c | 1 - drivers/spi/spi-bcm-qspi.c | 1 - drivers/spi/spi-bcm2835.c | 1 - drivers/spi/spi-bcm2835aux.c | 1 - drivers/spi/spi-bcm63xx-hsspi.c | 1 - drivers/spi/spi-bcm63xx.c | 1 - drivers/spi/spi-bcmbca-hsspi.c | 1 - drivers/spi/spi-cadence-quadspi.c | 1 - drivers/spi/spi-cadence-xspi.c | 1 - drivers/spi/spi-cadence.c | 1 - drivers/spi/spi-cavium-octeon.c | 1 - drivers/spi/spi-cavium-thunderx.c | 1 - drivers/spi/spi-clps711x.c | 1 - drivers/spi/spi-davinci.c | 1 - drivers/spi/spi-falcon.c | 1 - drivers/spi/spi-fsl-dspi.c | 1 - drivers/spi/spi-fsl-espi.c | 1 - drivers/spi/spi-fsl-lib.c | 1 - drivers/spi/spi-fsl-lpspi.c | 1 - drivers/spi/spi-geni-qcom.c | 1 - drivers/spi/spi-gxp.c | 1 - drivers/spi/spi-img-spfi.c | 1 - drivers/spi/spi-imx.c | 1 - drivers/spi/spi-ingenic.c | 1 - drivers/spi/spi-lantiq-ssc.c | 1 - drivers/spi/spi-lp8841-rtc.c | 1 - drivers/spi/spi-meson-spicc.c | 1 - drivers/spi/spi-meson-spifc.c | 1 - drivers/spi/spi-microchip-core-spi.c | 1 - drivers/spi/spi-mpc52xx.c | 1 - drivers/spi/spi-mpfs.c | 1 - drivers/spi/spi-mt65xx.c | 1 - drivers/spi/spi-mt7621.c | 1 - drivers/spi/spi-mtk-nor.c | 1 - drivers/spi/spi-mtk-snfi.c | 1 - drivers/spi/spi-mux.c | 1 - drivers/spi/spi-mxic.c | 1 - drivers/spi/spi-npcm-fiu.c | 1 - drivers/spi/spi-npcm-pspi.c | 1 - drivers/spi/spi-nxp-xspi.c | 1 - drivers/spi/spi-oc-tiny.c | 1 - drivers/spi/spi-orion.c | 1 - drivers/spi/spi-pl022.c | 1 - drivers/spi/spi-qcom-qspi.c | 1 - drivers/spi/spi-qpic-snand.c | 1 - drivers/spi/spi-qup.c | 1 - drivers/spi/spi-rb4xx.c | 1 - drivers/spi/spi-realtek-rtl.c | 1 - drivers/spi/spi-rockchip-sfc.c | 1 - drivers/spi/spi-rockchip.c | 1 - drivers/spi/spi-rspi.c | 1 - drivers/spi/spi-s3c64xx.c | 1 - drivers/spi/spi-sg2044-nor.c | 1 - drivers/spi/spi-sh-hspi.c | 1 - drivers/spi/spi-sh-msiof.c | 1 - drivers/spi/spi-sifive.c | 1 - drivers/spi/spi-slave-mt27xx.c | 1 - drivers/spi/spi-sn-f-ospi.c | 1 - drivers/spi/spi-sprd-adi.c | 1 - drivers/spi/spi-sprd.c | 1 - drivers/spi/spi-stm32-ospi.c | 1 - drivers/spi/spi-stm32-qspi.c | 1 - drivers/spi/spi-stm32.c | 1 - drivers/spi/spi-sun4i.c | 1 - drivers/spi/spi-sun6i.c | 1 - drivers/spi/spi-tegra114.c | 1 - drivers/spi/spi-tegra20-sflash.c | 1 - drivers/spi/spi-tegra20-slink.c | 1 - drivers/spi/spi-tegra210-quad.c | 1 - drivers/spi/spi-ti-qspi.c | 1 - drivers/spi/spi-uniphier.c | 1 - drivers/spi/spi-wpcm-fiu.c | 1 - drivers/spi/spi-xcomm.c | 1 - drivers/spi/spi-xilinx.c | 1 - drivers/spi/spi-xlp.c | 1 - drivers/spi/spi-xtensa-xtfpga.c | 1 - 87 files changed, 1 insertion(+), 90 deletions(-)
drivers/spi/atmel-quadspi.c +0 -1
@@ -1382,7 +1382,6 @@ static int atmel_qspi_probe(struct platform_device *pdev) ctrl->bus_num =-1 ; ctrl->mem_ops = &atmel_qspi_mem_ops; ctrl->num_chipselect =1 ; - ctrl->dev.of_node = pdev->dev.of_node;platform_set_drvdata (pdev, ctrl);/* Map the registers */
drivers/spi/spi-altera-platform.c +0 -2
@@ -67,8 +67,6 @@ static int altera_spi_probe(struct platform_device *pdev) host->bits_per_word_mask =SPI_BPW_RANGE_MASK (1 ,16 ); } - host->dev.of_node = pdev->dev.of_node; - hw =spi_controller_get_devdata (host); hw->dev = &pdev->dev;
drivers/spi/spi-amlogic-spifc-a1.c +0 -1
@@ -358,7 +358,6 @@ static int amlogic_spifc_a1_probe(struct platform_device *pdev)return ret; ctrl->num_chipselect =1 ; - ctrl->dev.of_node = pdev->dev.of_node; ctrl->bits_per_word_mask =SPI_BPW_MASK (8 ); ctrl->auto_runtime_pm = true; ctrl->mem_ops = &amlogic_spifc_a1_mem_ops;
drivers/spi/spi-amlogic-spisg.c +0 -1
@@ -781,7 +781,6 @@ static int aml_spisg_probe(struct platform_device *pdev)pm_runtime_resume_and_get (&spisg->pdev->dev); ctlr->num_chipselect =4 ; - ctlr->dev.of_node = pdev->dev.of_node; ctlr->mode_bits =SPI_CPHA |SPI_CPOL |SPI_LSB_FIRST |SPI_3WIRE |SPI_TX_QUAD |SPI_RX_QUAD ; ctlr->max_speed_hz =1000 *1000 *100 ;
drivers/spi/spi-apple.c +0 -1
@@ -485,7 +485,6 @@ static int apple_spi_probe(struct platform_device *pdev)if (ret)return dev_err_probe (&pdev->dev, ret,"Unable to bind to interrupt\n" ); - ctlr->dev.of_node = pdev->dev.of_node; ctlr->bus_num = pdev->id; ctlr->num_chipselect =1 ; ctlr->mode_bits =SPI_CPHA |SPI_CPOL |SPI_LSB_FIRST ;
drivers/spi/spi-ar934x.c +0 -1
@@ -195,7 +195,6 @@ static int ar934x_spi_probe(struct platform_device *pdev) ctlr->transfer_one_message = ar934x_spi_transfer_one_message; ctlr->bits_per_word_mask =SPI_BPW_MASK (32 ) |SPI_BPW_MASK (24 ) |SPI_BPW_MASK (16 ) |SPI_BPW_MASK (8 ); - ctlr->dev.of_node = pdev->dev.of_node; ctlr->num_chipselect =3 ;dev_set_drvdata (&pdev->dev, ctlr);
drivers/spi/spi-armada-3700.c +1 -3
@@ -813,7 +813,6 @@ MODULE_DEVICE_TABLE(of, a3700_spi_dt_ids);static int a3700_spi_probe (struct platform_device *pdev) {struct device *dev = &pdev->dev; -struct device_node *of_node = dev->of_node;struct spi_controller *host;struct a3700_spi *spi;u32 num_cs =0 ;
@@ -826,14 +825,13 @@ static int a3700_spi_probe(struct platform_device *pdev) goto out; } -if (of_property_read_u32 (of_node,"num-cs" , &num_cs)) { +if (of_property_read_u32 (dev->of_node,"num-cs" , &num_cs)) {dev_err (dev,"could not find num-cs\n" ); ret = -ENXIO ; goto error; } host->bus_num = pdev->id; - host->dev.of_node = of_node; host->mode_bits =SPI_MODE_3 ; host->num_chipselect = num_cs; host->bits_per_word_mask =SPI_BPW_MASK (8 ) |SPI_BPW_MASK (32 );
drivers/spi/spi-aspeed-smc.c +0 -1
@@ -898,7 +898,6 @@ static int aspeed_spi_probe(struct platform_device *pdev) ctlr->setup = aspeed_spi_setup; ctlr->cleanup = aspeed_spi_cleanup; ctlr->num_chipselect =of_get_available_child_count (dev->of_node); - ctlr->dev.of_node = dev->of_node; aspi->num_cs = ctlr->num_chipselect;
drivers/spi/spi-atcspi200.c +0 -1
@@ -552,7 +552,6 @@ static void atcspi_init_controller(struct platform_device *pdev,/* Initialize controller properties */ host->bus_num = pdev->id; host->mode_bits =SPI_CPOL |SPI_CPHA |SPI_RX_QUAD |SPI_TX_QUAD ; - host->dev.of_node = pdev->dev.of_node; host->num_chipselect =ATCSPI_MAX_CS_NUM ; host->mem_ops = &atcspi_mem_ops; host->max_speed_hz = spi->sclk_rate;
drivers/spi/spi-ath79.c +0 -1
@@ -180,7 +180,6 @@ static int ath79_spi_probe(struct platform_device *pdev) } sp =spi_controller_get_devdata (host); - host->dev.of_node = pdev->dev.of_node;platform_set_drvdata (pdev, sp); host->use_gpio_descriptors = true;
drivers/spi/spi-atmel.c +0 -1
@@ -1536,7 +1536,6 @@ static int atmel_spi_probe(struct platform_device *pdev) host->use_gpio_descriptors = true; host->mode_bits =SPI_CPOL |SPI_CPHA |SPI_CS_HIGH ; host->bits_per_word_mask =SPI_BPW_RANGE_MASK (8 ,16 ); - host->dev.of_node = pdev->dev.of_node; host->bus_num = pdev->id; host->num_chipselect =4 ; host->setup = atmel_spi_setup;
drivers/spi/spi-axi-spi-engine.c +0 -1
@@ -1080,7 +1080,6 @@ static int spi_engine_probe(struct platform_device *pdev)if (ret)return ret; - host->dev.of_node = pdev->dev.of_node; host->mode_bits =SPI_CPOL |SPI_CPHA |SPI_3WIRE ; host->bits_per_word_mask =SPI_BPW_RANGE_MASK (1 ,32 ); host->max_speed_hz =clk_get_rate (spi_engine->ref_clk) /2 ;
drivers/spi/spi-bcm-qspi.c +0 -1
@@ -1529,7 +1529,6 @@ int bcm_qspi_probe(struct platform_device *pdev, host->transfer_one = bcm_qspi_transfer_one; host->mem_ops = &bcm_qspi_mem_ops; host->cleanup = bcm_qspi_cleanup; - host->dev.of_node = dev->of_node; host->num_chipselect =NUM_CHIPSELECT ; host->use_gpio_descriptors = true;
drivers/spi/spi-bcm2835.c +0 -1
@@ -1368,7 +1368,6 @@ static int bcm2835_spi_probe(struct platform_device *pdev) ctlr->transfer_one = bcm2835_spi_transfer_one; ctlr->handle_err = bcm2835_spi_handle_err; ctlr->prepare_message = bcm2835_spi_prepare_message; - ctlr->dev.of_node = pdev->dev.of_node; bs =spi_controller_get_devdata (ctlr); bs->ctlr = ctlr;
drivers/spi/spi-bcm2835aux.c +0 -1
@@ -502,7 +502,6 @@ static int bcm2835aux_spi_probe(struct platform_device *pdev) host->handle_err = bcm2835aux_spi_handle_err; host->prepare_message = bcm2835aux_spi_prepare_message; host->unprepare_message = bcm2835aux_spi_unprepare_message; - host->dev.of_node = pdev->dev.of_node; host->use_gpio_descriptors = true; bs =spi_controller_get_devdata (host);
drivers/spi/spi-bcm63xx-hsspi.c +0 -1
@@ -822,7 +822,6 @@ static int bcm63xx_hsspi_probe(struct platform_device *pdev)init_completion (&bs->done); host->mem_ops = &bcm63xx_hsspi_mem_ops; - host->dev.of_node = dev->of_node;if (!dev->of_node) host->bus_num =HSSPI_BUS_NUM ;
drivers/spi/spi-bcm63xx.c +0 -1
@@ -571,7 +571,6 @@ static int bcm63xx_spi_probe(struct platform_device *pdev) goto out_err; } - host->dev.of_node = dev->of_node; host->bus_num = bus_num; host->num_chipselect = num_cs; host->transfer_one_message = bcm63xx_spi_transfer_one;
drivers/spi/spi-bcmbca-hsspi.c +0 -1
@@ -500,7 +500,6 @@ static int bcmbca_hsspi_probe(struct platform_device *pdev)mutex_init (&bs->msg_mutex);init_completion (&bs->done); - host->dev.of_node = dev->of_node;if (!dev->of_node) host->bus_num =HSSPI_BUS_NUM ;
drivers/spi/spi-cadence-quadspi.c +0 -1
@@ -1827,7 +1827,6 @@ static int cqspi_probe(struct platform_device *pdev) host->mode_bits =SPI_RX_QUAD |SPI_RX_DUAL ; host->mem_ops = &cqspi_mem_ops; host->mem_caps = &cqspi_mem_caps; - host->dev.of_node = pdev->dev.of_node; cqspi =spi_controller_get_devdata (host);
drivers/spi/spi-cadence-xspi.c +0 -1
@@ -1157,7 +1157,6 @@ static int cdns_xspi_probe(struct platform_device *pdev) cdns_xspi->sdma_handler = &cdns_xspi_sdma_handle; cdns_xspi->set_interrupts_handler = &cdns_xspi_set_interrupts; } - host->dev.of_node = pdev->dev.of_node; host->bus_num =-1 ;platform_set_drvdata (pdev, host);
drivers/spi/spi-cadence.c +0 -1
@@ -651,7 +651,6 @@ static int cdns_spi_probe(struct platform_device *pdev)return -ENOMEM ; xspi =spi_controller_get_devdata (ctlr); - ctlr->dev.of_node = pdev->dev.of_node;platform_set_drvdata (pdev, ctlr); xspi->regs =devm_platform_ioremap_resource (pdev,0 );
drivers/spi/spi-cavium-octeon.c +0 -1
@@ -54,7 +54,6 @@ static int octeon_spi_probe(struct platform_device *pdev) host->bits_per_word_mask =SPI_BPW_MASK (8 ); host->max_speed_hz =OCTEON_SPI_MAX_CLOCK_HZ ; - host->dev.of_node = pdev->dev.of_node; err =devm_spi_register_controller (&pdev->dev, host);if (err) {dev_err (&pdev->dev,"register host failed: %d\n" , err);
drivers/spi/spi-cavium-thunderx.c +0 -1
@@ -67,7 +67,6 @@ static int thunderx_spi_probe(struct pci_dev *pdev, host->transfer_one_message = octeon_spi_transfer_one_message; host->bits_per_word_mask =SPI_BPW_MASK (8 ); host->max_speed_hz =OCTEON_SPI_MAX_CLOCK_HZ ; - host->dev.of_node = pdev->dev.of_node;pci_set_drvdata (pdev, host);
drivers/spi/spi-clps711x.c +0 -1
@@ -107,7 +107,6 @@ static int spi_clps711x_probe(struct platform_device *pdev) host->bus_num =-1 ; host->mode_bits =SPI_CPHA |SPI_CS_HIGH ; host->bits_per_word_mask =SPI_BPW_RANGE_MASK (1 ,8 ); - host->dev.of_node = pdev->dev.of_node; host->prepare_message = spi_clps711x_prepare_message; host->transfer_one = spi_clps711x_transfer_one;
drivers/spi/spi-davinci.c +0 -1
@@ -988,7 +988,6 @@ static int davinci_spi_probe(struct platform_device *pdev) } host->use_gpio_descriptors = true; - host->dev.of_node = pdev->dev.of_node; host->bus_num = pdev->id; host->num_chipselect = pdata->num_chipselect; host->bits_per_word_mask =SPI_BPW_RANGE_MASK (2 ,16 );
drivers/spi/spi-falcon.c +0 -1
@@ -405,7 +405,6 @@ static int falcon_sflash_probe(struct platform_device *pdev) host->flags =SPI_CONTROLLER_HALF_DUPLEX ; host->setup = falcon_sflash_setup; host->transfer_one_message = falcon_sflash_xfer_one; - host->dev.of_node = pdev->dev.of_node; ret =devm_spi_register_controller (&pdev->dev, host);if (ret)
drivers/spi/spi-fsl-dspi.c +0 -1
@@ -1555,7 +1555,6 @@ static int dspi_probe(struct platform_device *pdev) ctlr->setup = dspi_setup; ctlr->transfer_one_message = dspi_transfer_one_message; - ctlr->dev.of_node = pdev->dev.of_node; ctlr->cleanup = dspi_cleanup; ctlr->target_abort = dspi_target_abort;
drivers/spi/spi-fsl-espi.c +0 -1
@@ -675,7 +675,6 @@ static int fsl_espi_probe(struct device *dev, struct resource *mem, host->mode_bits =SPI_RX_DUAL |SPI_CPOL |SPI_CPHA |SPI_CS_HIGH |SPI_LSB_FIRST |SPI_LOOP ; - host->dev.of_node = dev->of_node; host->bits_per_word_mask =SPI_BPW_RANGE_MASK (4 ,16 ); host->setup = fsl_espi_setup; host->cleanup = fsl_espi_cleanup;
drivers/spi/spi-fsl-lib.c +0 -1
@@ -91,7 +91,6 @@ void mpc8xxx_spi_probe(struct device *dev, struct resource *mem, ctlr->mode_bits =SPI_CPOL |SPI_CPHA |SPI_CS_HIGH |SPI_LSB_FIRST |SPI_LOOP ; - ctlr->dev.of_node = dev->of_node; mpc8xxx_spi =spi_controller_get_devdata (ctlr); mpc8xxx_spi->dev = dev;
drivers/spi/spi-fsl-lpspi.c +0 -1
@@ -949,7 +949,6 @@ static int fsl_lpspi_probe(struct platform_device *pdev) controller->unprepare_transfer_hardware = lpspi_unprepare_xfer_hardware; controller->mode_bits =SPI_CPOL |SPI_CPHA |SPI_CS_HIGH ; controller->flags =SPI_CONTROLLER_MUST_RX |SPI_CONTROLLER_MUST_TX ; - controller->dev.of_node = pdev->dev.of_node; controller->bus_num = pdev->id; controller->num_chipselect = num_cs; controller->target_abort = fsl_lpspi_target_abort;
drivers/spi/spi-geni-qcom.c +0 -1
@@ -1057,7 +1057,6 @@ static int spi_geni_probe(struct platform_device *pdev) } spi->bus_num =-1 ; - spi->dev.of_node = dev->of_node; spi->mode_bits =SPI_CPOL |SPI_CPHA |SPI_LOOP |SPI_CS_HIGH ; spi->bits_per_word_mask =SPI_BPW_RANGE_MASK (4 ,32 ); spi->num_chipselect =4 ;
drivers/spi/spi-gxp.c +0 -1
@@ -284,7 +284,6 @@ static int gxp_spifi_probe(struct platform_device *pdev) ctlr->mem_ops = &gxp_spi_mem_ops; ctlr->setup = gxp_spi_setup; ctlr->num_chipselect = data->max_cs; - ctlr->dev.of_node = dev->of_node; ret =devm_spi_register_controller (dev, ctlr);if (ret) {
drivers/spi/spi-img-spfi.c +0 -1
@@ -587,7 +587,6 @@ static int img_spfi_probe(struct platform_device *pdev) host->mode_bits =SPI_CPOL |SPI_CPHA |SPI_TX_DUAL |SPI_RX_DUAL ;if (of_property_read_bool (spfi->dev->of_node,"img,supports-quad-mode" )) host->mode_bits |=SPI_TX_QUAD |SPI_RX_QUAD ; - host->dev.of_node = pdev->dev.of_node; host->bits_per_word_mask =SPI_BPW_MASK (32 ) |SPI_BPW_MASK (8 ); host->max_speed_hz =clk_get_rate (spfi->spfi_clk) /4 ; host->min_speed_hz =clk_get_rate (spfi->spfi_clk) /512 ;
drivers/spi/spi-imx.c +0 -1
@@ -2368,7 +2368,6 @@ static int spi_imx_probe(struct platform_device *pdev) spi_imx->devtype_data->intctrl (spi_imx,0 ); - controller->dev.of_node = pdev->dev.of_node; ret =spi_register_controller (controller);if (ret) {dev_err_probe (&pdev->dev, ret,"register controller failed\n" );
drivers/spi/spi-ingenic.c +0 -1
@@ -442,7 +442,6 @@ static int spi_ingenic_probe(struct platform_device *pdev) ctlr->use_gpio_descriptors = true; ctlr->max_native_cs = pdata->max_native_cs; ctlr->num_chipselect = num_cs; - ctlr->dev.of_node = pdev->dev.of_node;if (spi_ingenic_request_dma (ctlr, dev))dev_warn (dev,"DMA not available.\n" );
drivers/spi/spi-lantiq-ssc.c +0 -1
@@ -962,7 +962,6 @@ static int lantiq_ssc_probe(struct platform_device *pdev) spi->bits_per_word =8 ; spi->speed_hz =0 ; - host->dev.of_node = pdev->dev.of_node; host->num_chipselect = num_cs; host->use_gpio_descriptors = true; host->setup = lantiq_ssc_setup;
drivers/spi/spi-lp8841-rtc.c +0 -1
@@ -200,7 +200,6 @@ spi_lp8841_rtc_probe(struct platform_device *pdev) host->transfer_one = spi_lp8841_rtc_transfer_one; host->bits_per_word_mask =SPI_BPW_MASK (8 );#ifdef CONFIG_OF - host->dev.of_node = pdev->dev.of_node;#endif data =spi_controller_get_devdata (host);
drivers/spi/spi-meson-spicc.c +0 -1
@@ -1054,7 +1054,6 @@ static int meson_spicc_probe(struct platform_device *pdev)device_reset_optional (&pdev->dev); host->num_chipselect =4 ; - host->dev.of_node = pdev->dev.of_node; host->mode_bits =SPI_CPHA |SPI_CPOL |SPI_CS_HIGH |SPI_LOOP ; host->flags = (SPI_CONTROLLER_MUST_RX |SPI_CONTROLLER_MUST_TX ); host->min_speed_hz = spicc->data->min_speed_hz;
drivers/spi/spi-meson-spifc.c +0 -1
@@ -322,7 +322,6 @@ static int meson_spifc_probe(struct platform_device *pdev) rate =clk_get_rate (spifc->clk); host->num_chipselect =1 ; - host->dev.of_node = pdev->dev.of_node; host->bits_per_word_mask =SPI_BPW_MASK (8 ); host->auto_runtime_pm = true; host->transfer_one = meson_spifc_transfer_one;
drivers/spi/spi-microchip-core-spi.c +0 -1
@@ -360,7 +360,6 @@ static int mchp_corespi_probe(struct platform_device *pdev) host->bits_per_word_mask =SPI_BPW_RANGE_MASK (4 ,32 ); host->transfer_one = mchp_corespi_transfer_one; host->set_cs = mchp_corespi_set_cs; - host->dev.of_node = dev->of_node; ret =of_property_read_u32 (dev->of_node,"fifo-depth" , &spi->fifo_depth);if (ret)
drivers/spi/spi-mpc52xx.c +0 -1
@@ -430,7 +430,6 @@ static int mpc52xx_spi_probe(struct platform_device *op) host->transfer = mpc52xx_spi_transfer; host->mode_bits =SPI_CPOL |SPI_CPHA |SPI_LSB_FIRST ; host->bits_per_word_mask =SPI_BPW_MASK (8 ); - host->dev.of_node = op->dev.of_node;platform_set_drvdata (op, host);
drivers/spi/spi-mpfs.c +0 -1
@@ -550,7 +550,6 @@ static int mpfs_spi_probe(struct platform_device *pdev) host->transfer_one = mpfs_spi_transfer_one; host->prepare_message = mpfs_spi_prepare_message; host->set_cs = mpfs_spi_set_cs; - host->dev.of_node = pdev->dev.of_node; spi =spi_controller_get_devdata (host);
drivers/spi/spi-mt65xx.c +0 -1
@@ -1184,7 +1184,6 @@ static int mtk_spi_probe(struct platform_device *pdev)return -ENOMEM ; host->auto_runtime_pm = true; - host->dev.of_node = dev->of_node; host->mode_bits =SPI_CPOL |SPI_CPHA |SPI_LSB_FIRST ; host->set_cs = mtk_spi_set_cs;
drivers/spi/spi-mt7621.c +0 -1
@@ -348,7 +348,6 @@ static int mt7621_spi_probe(struct platform_device *pdev) host->set_cs = mt7621_spi_set_native_cs; host->transfer_one = mt7621_spi_transfer_one; host->bits_per_word_mask =SPI_BPW_MASK (8 ); - host->dev.of_node = pdev->dev.of_node; host->max_native_cs =MT7621_NATIVE_CS_COUNT ; host->num_chipselect =MT7621_NATIVE_CS_COUNT ; host->use_gpio_descriptors = true;
drivers/spi/spi-mtk-nor.c +0 -1
@@ -851,7 +851,6 @@ static int mtk_nor_probe(struct platform_device *pdev) } ctlr->bits_per_word_mask =SPI_BPW_MASK (8 ); - ctlr->dev.of_node = pdev->dev.of_node; ctlr->max_message_size = mtk_max_msg_size; ctlr->mem_ops = &mtk_nor_mem_ops; ctlr->mode_bits =SPI_RX_DUAL |SPI_RX_QUAD |SPI_TX_DUAL |SPI_TX_QUAD ;
drivers/spi/spi-mtk-snfi.c +0 -1
@@ -1448,7 +1448,6 @@ static int mtk_snand_probe(struct platform_device *pdev) ctlr->mem_caps = &mtk_snand_mem_caps; ctlr->bits_per_word_mask =SPI_BPW_MASK (8 ); ctlr->mode_bits =SPI_RX_DUAL |SPI_RX_QUAD |SPI_TX_DUAL |SPI_TX_QUAD ; - ctlr->dev.of_node = pdev->dev.of_node; ret =spi_register_controller (ctlr);if (ret) {dev_err (&pdev->dev,"spi_register_controller failed.\n" );
drivers/spi/spi-mux.c +0 -1
@@ -161,7 +161,6 @@ static int spi_mux_probe(struct spi_device *spi) ctlr->setup = spi_mux_setup; ctlr->num_chipselect =mux_control_states (priv->mux); ctlr->bus_num =-1 ; - ctlr->dev.of_node = spi->dev.of_node; ctlr->must_async = true; ctlr->defer_optimize_message = true;
drivers/spi/spi-mxic.c +0 -1
@@ -768,7 +768,6 @@ static int mxic_spi_probe(struct platform_device *pdev) mxic =spi_controller_get_devdata (host); mxic->dev = &pdev->dev; - host->dev.of_node = pdev->dev.of_node; mxic->ps_clk =devm_clk_get (&pdev->dev,"ps_clk" );if (IS_ERR (mxic->ps_clk))
drivers/spi/spi-npcm-fiu.c +0 -1
@@ -746,7 +746,6 @@ static int npcm_fiu_probe(struct platform_device *pdev) ctrl->bus_num =-1 ; ctrl->mem_ops = &npcm_fiu_mem_ops; ctrl->num_chipselect = fiu->info->max_cs; - ctrl->dev.of_node = dev->of_node;return devm_spi_register_controller (dev, ctrl); }
drivers/spi/spi-npcm-pspi.c +0 -1
@@ -401,7 +401,6 @@ static int npcm_pspi_probe(struct platform_device *pdev) host->max_speed_hz =DIV_ROUND_UP (clk_hz,NPCM_PSPI_MIN_CLK_DIVIDER ); host->min_speed_hz =DIV_ROUND_UP (clk_hz,NPCM_PSPI_MAX_CLK_DIVIDER ); host->mode_bits =SPI_CPHA |SPI_CPOL ; - host->dev.of_node = pdev->dev.of_node; host->bus_num =-1 ; host->bits_per_word_mask =SPI_BPW_MASK (8 ) |SPI_BPW_MASK (16 ); host->transfer_one = npcm_pspi_transfer_one;
drivers/spi/spi-nxp-xspi.c +0 -1
@@ -1290,7 +1290,6 @@ static int nxp_xspi_probe(struct platform_device *pdev) ctlr->num_chipselect =NXP_XSPI_MAX_CHIPSELECT ; ctlr->mem_ops = &nxp_xspi_mem_ops; ctlr->mem_caps = &nxp_xspi_mem_caps; - ctlr->dev.of_node = dev->of_node;return devm_spi_register_controller (dev, ctlr); }
drivers/spi/spi-oc-tiny.c +0 -1
@@ -192,7 +192,6 @@ static int tiny_spi_of_probe(struct platform_device *pdev)if (!np)return 0 ; - hw->bitbang.ctlr->dev.of_node = pdev->dev.of_node;if (!of_property_read_u32 (np,"clock-frequency" , &val)) hw->freq = val;if (!of_property_read_u32 (np,"baud-width" , &val))
drivers/spi/spi-orion.c +0 -1
@@ -780,7 +780,6 @@ static int orion_spi_probe(struct platform_device *pdev)if (status <0 ) goto out_rel_pm; - host->dev.of_node = pdev->dev.of_node; status =spi_register_controller (host);if (status <0 ) goto out_rel_pm;
drivers/spi/spi-pl022.c +0 -1
@@ -1893,7 +1893,6 @@ static int pl022_probe(struct amba_device *adev, const struct amba_id *id) host->handle_err = pl022_handle_err; host->unprepare_transfer_hardware = pl022_unprepare_transfer_hardware; host->rt = platform_info->rt; - host->dev.of_node = dev->of_node; host->use_gpio_descriptors = true;/*
drivers/spi/spi-qcom-qspi.c +0 -1
@@ -763,7 +763,6 @@ static int qcom_qspi_probe(struct platform_device *pdev) host->dma_alignment =QSPI_ALIGN_REQ ; host->num_chipselect =QSPI_NUM_CS ; host->bus_num =-1 ; - host->dev.of_node = pdev->dev.of_node; host->mode_bits =SPI_MODE_0 |SPI_TX_DUAL |SPI_RX_DUAL |SPI_TX_QUAD |SPI_RX_QUAD ;
drivers/spi/spi-qpic-snand.c +0 -1
@@ -1583,7 +1583,6 @@ static int qcom_spi_probe(struct platform_device *pdev) ctlr->num_chipselect =QPIC_QSPI_NUM_CS ; ctlr->mem_ops = &qcom_spi_mem_ops; ctlr->mem_caps = &qcom_spi_mem_caps; - ctlr->dev.of_node = pdev->dev.of_node; ctlr->mode_bits =SPI_TX_DUAL |SPI_RX_DUAL |SPI_TX_QUAD |SPI_RX_QUAD ;
drivers/spi/spi-qup.c +0 -1
@@ -1091,7 +1091,6 @@ static int spi_qup_probe(struct platform_device *pdev) host->bits_per_word_mask =SPI_BPW_RANGE_MASK (4 ,32 ); host->max_speed_hz = max_freq; host->transfer_one = spi_qup_transfer_one; - host->dev.of_node = pdev->dev.of_node; host->auto_runtime_pm = true; host->dma_alignment =dma_get_cache_alignment (); host->max_dma_len =SPI_MAX_XFER ;
drivers/spi/spi-rb4xx.c +0 -1
@@ -160,7 +160,6 @@ static int rb4xx_spi_probe(struct platform_device *pdev)if (IS_ERR (ahb_clk))return PTR_ERR (ahb_clk); - host->dev.of_node = pdev->dev.of_node; host->bus_num =0 ; host->num_chipselect =3 ; host->mode_bits =SPI_TX_DUAL ;
drivers/spi/spi-realtek-rtl.c +0 -1
@@ -169,7 +169,6 @@ static int realtek_rtl_spi_probe(struct platform_device *pdev)init_hw (rtspi); - ctrl->dev.of_node = pdev->dev.of_node; ctrl->flags =SPI_CONTROLLER_HALF_DUPLEX ; ctrl->set_cs = rt_set_cs; ctrl->transfer_one = transfer_one;
drivers/spi/spi-rockchip-sfc.c +0 -1
@@ -622,7 +622,6 @@ static int rockchip_sfc_probe(struct platform_device *pdev) host->flags =SPI_CONTROLLER_HALF_DUPLEX ; host->mem_ops = &rockchip_sfc_mem_ops; host->mem_caps = &rockchip_sfc_mem_caps; - host->dev.of_node = pdev->dev.of_node; host->mode_bits =SPI_TX_QUAD |SPI_TX_DUAL |SPI_RX_QUAD |SPI_RX_DUAL ; host->max_speed_hz =SFC_MAX_SPEED ; host->num_chipselect =SFC_MAX_CHIPSELECT_NUM ;
drivers/spi/spi-rockchip.c +0 -1
@@ -858,7 +858,6 @@ static int rockchip_spi_probe(struct platform_device *pdev) ctlr->num_chipselect = num_cs; ctlr->use_gpio_descriptors = true; } - ctlr->dev.of_node = pdev->dev.of_node; ctlr->bits_per_word_mask =SPI_BPW_MASK (16 ) |SPI_BPW_MASK (8 ) |SPI_BPW_MASK (4 ); ctlr->min_speed_hz = rs->freq /BAUDR_SCKDV_MAX ; ctlr->max_speed_hz =min (rs->freq /BAUDR_SCKDV_MIN ,MAX_SCLK_OUT );
drivers/spi/spi-rspi.c +0 -1
@@ -1338,7 +1338,6 @@ static int rspi_probe(struct platform_device *pdev) ctlr->min_speed_hz =DIV_ROUND_UP (clksrc, ops->max_div); ctlr->max_speed_hz =DIV_ROUND_UP (clksrc, ops->min_div); ctlr->flags = ops->flags; - ctlr->dev.of_node = pdev->dev.of_node; ctlr->use_gpio_descriptors = true; ctlr->max_native_cs = rspi->ops->num_hw_ss;
drivers/spi/spi-s3c64xx.c +0 -1
@@ -1295,7 +1295,6 @@ static int s3c64xx_spi_probe(struct platform_device *pdev) sdd->tx_dma.direction =DMA_MEM_TO_DEV ; sdd->rx_dma.direction =DMA_DEV_TO_MEM ; - host->dev.of_node = pdev->dev.of_node; host->bus_num =-1 ; host->setup = s3c64xx_spi_setup; host->cleanup = s3c64xx_spi_cleanup;
drivers/spi/spi-sg2044-nor.c +0 -1
@@ -455,7 +455,6 @@ static int sg2044_spifmc_probe(struct platform_device *pdev)return PTR_ERR (spifmc->io_base); ctrl->num_chipselect =1 ; - ctrl->dev.of_node = pdev->dev.of_node; ctrl->bits_per_word_mask =SPI_BPW_MASK (8 ); ctrl->auto_runtime_pm = false; ctrl->mem_ops = &sg2044_spifmc_mem_ops;
drivers/spi/spi-sh-hspi.c +0 -1
@@ -253,7 +253,6 @@ static int hspi_probe(struct platform_device *pdev) ctlr->bus_num = pdev->id; ctlr->mode_bits =SPI_CPOL |SPI_CPHA ; - ctlr->dev.of_node = pdev->dev.of_node; ctlr->auto_runtime_pm = true; ctlr->transfer_one_message = hspi_transfer_one_message; ctlr->bits_per_word_mask =SPI_BPW_MASK (8 );
drivers/spi/spi-sh-msiof.c +0 -1
@@ -1276,7 +1276,6 @@ static int sh_msiof_spi_probe(struct platform_device *pdev) ctlr->flags = chipdata->ctlr_flags; ctlr->bus_num = pdev->id; ctlr->num_chipselect = p->info->num_chipselect; - ctlr->dev.of_node = dev->of_node; ctlr->setup = sh_msiof_spi_setup; ctlr->prepare_message = sh_msiof_prepare_message; ctlr->target_abort = sh_msiof_target_abort;
drivers/spi/spi-sifive.c +0 -1
@@ -368,7 +368,6 @@ static int sifive_spi_probe(struct platform_device *pdev) }/* Define our host */ - host->dev.of_node = pdev->dev.of_node; host->bus_num = pdev->id; host->num_chipselect = num_cs; host->mode_bits =SPI_CPHA |SPI_CPOL
drivers/spi/spi-slave-mt27xx.c +0 -1
@@ -395,7 +395,6 @@ static int mtk_spi_slave_probe(struct platform_device *pdev) } ctlr->auto_runtime_pm = true; - ctlr->dev.of_node = pdev->dev.of_node; ctlr->mode_bits =SPI_CPOL |SPI_CPHA ; ctlr->mode_bits |=SPI_LSB_FIRST ;
drivers/spi/spi-sn-f-ospi.c +0 -1
@@ -628,7 +628,6 @@ static int f_ospi_probe(struct platform_device *pdev)return -ENOMEM ; } ctlr->num_chipselect = num_cs; - ctlr->dev.of_node = dev->of_node; ospi =spi_controller_get_devdata (ctlr); ospi->dev = dev;
drivers/spi/spi-sprd-adi.c +0 -1
@@ -571,7 +571,6 @@ static int sprd_adi_probe(struct platform_device *pdev)if (sadi->data->wdg_rst) sadi->data->wdg_rst (sadi); - ctlr->dev.of_node = pdev->dev.of_node; ctlr->bus_num = pdev->id; ctlr->num_chipselect = num_chipselect; ctlr->flags =SPI_CONTROLLER_HALF_DUPLEX ;
drivers/spi/spi-sprd.c +0 -1
@@ -936,7 +936,6 @@ static int sprd_spi_probe(struct platform_device *pdev) ss->phy_base = res->start; ss->dev = &pdev->dev; - sctlr->dev.of_node = pdev->dev.of_node; sctlr->mode_bits =SPI_CPOL |SPI_CPHA |SPI_3WIRE |SPI_TX_DUAL ; sctlr->bus_num = pdev->id; sctlr->set_cs = sprd_spi_chipselect;
drivers/spi/spi-stm32-ospi.c +0 -1
@@ -942,7 +942,6 @@ static int stm32_ospi_probe(struct platform_device *pdev) ctrl->use_gpio_descriptors = true; ctrl->transfer_one_message = stm32_ospi_transfer_one_message; ctrl->num_chipselect =STM32_OSPI_MAX_NORCHIP ; - ctrl->dev.of_node = dev->of_node;pm_runtime_enable (ospi->dev);pm_runtime_set_autosuspend_delay (ospi->dev,STM32_AUTOSUSPEND_DELAY );
drivers/spi/spi-stm32-qspi.c +0 -1
@@ -860,7 +860,6 @@ static int stm32_qspi_probe(struct platform_device *pdev) ctrl->use_gpio_descriptors = true; ctrl->transfer_one_message = stm32_qspi_transfer_one_message; ctrl->num_chipselect =STM32_QSPI_MAX_NORCHIP ; - ctrl->dev.of_node = dev->of_node;pm_runtime_set_autosuspend_delay (dev,STM32_AUTOSUSPEND_DELAY );pm_runtime_use_autosuspend (dev);
drivers/spi/spi-stm32.c +0 -1
@@ -2464,7 +2464,6 @@ static int stm32_spi_probe(struct platform_device *pdev) goto err_clk_disable; } - ctrl->dev.of_node = pdev->dev.of_node; ctrl->auto_runtime_pm = true; ctrl->bus_num = pdev->id; ctrl->mode_bits = SPI_CPHA | SPI_CPOL | SPI_CS_HIGH | SPI_LSB_FIRST |
drivers/spi/spi-sun4i.c +0 -1
@@ -471,7 +471,6 @@ static int sun4i_spi_probe(struct platform_device *pdev) host->num_chipselect =4 ; host->mode_bits =SPI_CPOL |SPI_CPHA |SPI_CS_HIGH |SPI_LSB_FIRST ; host->bits_per_word_mask =SPI_BPW_MASK (8 ); - host->dev.of_node = pdev->dev.of_node; host->auto_runtime_pm = true; host->max_transfer_size = sun4i_spi_max_transfer_size;
drivers/spi/spi-sun6i.c +0 -1
@@ -673,7 +673,6 @@ static int sun6i_spi_probe(struct platform_device *pdev) host->mode_bits =SPI_CPOL |SPI_CPHA |SPI_CS_HIGH |SPI_LSB_FIRST | sspi->cfg->mode_bits; host->bits_per_word_mask =SPI_BPW_MASK (8 ); - host->dev.of_node = pdev->dev.of_node; host->auto_runtime_pm = true; host->max_transfer_size = sun6i_spi_max_transfer_size;
drivers/spi/spi-tegra114.c +0 -1
@@ -1412,7 +1412,6 @@ static int tegra_spi_probe(struct platform_device *pdev) goto exit_pm_disable; } - host->dev.of_node = pdev->dev.of_node; ret =devm_spi_register_controller (&pdev->dev, host);if (ret <0 ) {dev_err (&pdev->dev,"can not register to host err %d\n" , ret);
drivers/spi/spi-tegra20-sflash.c +0 -1
@@ -505,7 +505,6 @@ static int tegra_sflash_probe(struct platform_device *pdev)tegra_sflash_writel (tsd, tsd->def_command_reg,SPI_COMMAND );pm_runtime_put (&pdev->dev); - host->dev.of_node = pdev->dev.of_node; ret =devm_spi_register_controller (&pdev->dev, host);if (ret <0 ) {dev_err (&pdev->dev,"can not register to host err %d\n" , ret);
drivers/spi/spi-tegra20-slink.c +0 -1
@@ -1103,7 +1103,6 @@ static int tegra_slink_probe(struct platform_device *pdev)tegra_slink_writel (tspi, tspi->def_command_reg,SLINK_COMMAND );tegra_slink_writel (tspi, tspi->def_command2_reg,SLINK_COMMAND2 ); - host->dev.of_node = pdev->dev.of_node; ret =spi_register_controller (host);if (ret <0 ) {dev_err (&pdev->dev,"can not register to host err %d\n" , ret);
drivers/spi/spi-tegra210-quad.c +0 -1
@@ -1743,7 +1743,6 @@ static int tegra_qspi_probe(struct platform_device *pdev) goto exit_pm_disable; } - host->dev.of_node = pdev->dev.of_node; ret =spi_register_controller (host);if (ret <0 ) {dev_err (&pdev->dev,"failed to register host: %d\n" , ret);
drivers/spi/spi-ti-qspi.c +0 -1
@@ -775,7 +775,6 @@ static int ti_qspi_probe(struct platform_device *pdev) host->setup = ti_qspi_setup; host->auto_runtime_pm = true; host->transfer_one_message = ti_qspi_start_transfer_one; - host->dev.of_node = pdev->dev.of_node; host->bits_per_word_mask =SPI_BPW_MASK (32 ) |SPI_BPW_MASK (16 ) |SPI_BPW_MASK (8 ); host->mem_ops = &ti_qspi_mem_ops;
drivers/spi/spi-uniphier.c +0 -1
@@ -697,7 +697,6 @@ static int uniphier_spi_probe(struct platform_device *pdev) host->max_speed_hz =DIV_ROUND_UP (clk_rate,SSI_MIN_CLK_DIVIDER ); host->min_speed_hz =DIV_ROUND_UP (clk_rate,SSI_MAX_CLK_DIVIDER ); host->mode_bits =SPI_CPOL |SPI_CPHA |SPI_CS_HIGH |SPI_LSB_FIRST ; - host->dev.of_node = pdev->dev.of_node; host->bus_num = pdev->id; host->bits_per_word_mask =SPI_BPW_RANGE_MASK (1 ,32 );
drivers/spi/spi-wpcm-fiu.c +0 -1
@@ -471,7 +471,6 @@ static int wpcm_fiu_probe(struct platform_device *pdev) ctrl->bus_num =-1 ; ctrl->mem_ops = &wpcm_fiu_mem_ops; ctrl->num_chipselect =4 ; - ctrl->dev.of_node = dev->of_node;/* * The FIU doesn't include a clock divider, the clock is entirely
drivers/spi/spi-xcomm.c +0 -1
@@ -260,7 +260,6 @@ static int spi_xcomm_probe(struct i2c_client *i2c) host->bits_per_word_mask =SPI_BPW_MASK (8 ); host->flags =SPI_CONTROLLER_HALF_DUPLEX ; host->transfer_one_message = spi_xcomm_transfer_one; - host->dev.of_node = i2c->dev.of_node; ret =devm_spi_register_controller (&i2c->dev, host);if (ret <0 )
drivers/spi/spi-xilinx.c +0 -1
@@ -447,7 +447,6 @@ static int xilinx_spi_probe(struct platform_device *pdev) host->bus_num = pdev->id; host->num_chipselect = num_cs; - host->dev.of_node = pdev->dev.of_node;/* * Detect endianess on the IP via loop bit in CR. Detection
drivers/spi/spi-xlp.c +0 -1
@@ -409,7 +409,6 @@ static int xlp_spi_probe(struct platform_device *pdev) host->mode_bits =SPI_CPOL |SPI_CPHA |SPI_CS_HIGH ; host->setup = xlp_spi_setup; host->transfer_one = xlp_spi_transfer_one; - host->dev.of_node = pdev->dev.of_node;init_completion (&xspi->done);spi_controller_set_devdata (host, xspi);
drivers/spi/spi-xtensa-xtfpga.c +0 -1
@@ -90,7 +90,6 @@ static int xtfpga_spi_probe(struct platform_device *pdev) host->flags =SPI_CONTROLLER_NO_RX ; host->bits_per_word_mask =SPI_BPW_RANGE_MASK (1 ,16 ); host->bus_num = pdev->dev.id; - host->dev.of_node = pdev->dev.of_node; xspi =spi_controller_get_devdata (host); xspi->bitbang.ctlr = host;
Signature · 1 line
2.50.1
Andy Shevchenko
reviewerPATCH 3/4 spi: Drop duplicate fwnode assignment
In reply to Andy ShevchenkoThe SPI core provides the default fwnode for the controller, inherited from the actual (parent) device. No need to repeat it in the driver.
--- drivers/spi/spi-hisi-kunpeng.c | 1 - drivers/spi/spi-synquacer.c | 3 --- 2 files changed, 4 deletions(-)
drivers/spi/spi-hisi-kunpeng.c +0 -1
@@ -497,7 +497,6 @@ static int hisi_spi_probe(struct platform_device *pdev) host->cleanup = hisi_spi_cleanup; host->transfer_one = hisi_spi_transfer_one; host->handle_err = hisi_spi_handle_err; - host->dev.fwnode = dev->fwnode; host->min_speed_hz =DIV_ROUND_UP (host->max_speed_hz,CLK_DIV_MAX );hisi_spi_hw_init (hs);
drivers/spi/spi-synquacer.c +0 -3
@@ -600,7 +600,6 @@ static irqreturn_t sq_spi_tx_handler(int irq, void *priv)static int synquacer_spi_probe (struct platform_device *pdev) { -struct device_node *np = pdev->dev.of_node;struct spi_controller *host;struct synquacer_spi *sspi;int ret;
@@ -699,8 +698,6 @@ static int synquacer_spi_probe(struct platform_device *pdev) goto disable_clk; } - host->dev.of_node = np; - host->dev.fwnode = pdev->dev.fwnode; host->auto_runtime_pm = true; host->bus_num = pdev->id;
Signature · 1 line
2.50.1
Andy Shevchenko
reviewerPATCH 4/4 spi: Drop duplicate device_set_node() call
In reply to Andy ShevchenkoThe SPI core provides the default fwnode for the controller, assigned by device_set_node(). No need to repeat it in the driver.
--- drivers/spi/spi-airoha-snfi.c | 1 - drivers/spi/spi-dln2.c | 2 -- drivers/spi/spi-dw-core.c | 2 -- drivers/spi/spi-ep93xx.c | 1 - drivers/spi/spi-gpio.c | 1 - drivers/spi/spi-ljca.c | 1 - drivers/spi/spi-loongson-core.c | 1 - drivers/spi/spi-mpc512x-psc.c | 2 -- drivers/spi/spi-mpc52xx-psc.c | 2 -- drivers/spi/spi-nxp-fspi.c | 2 -- drivers/spi/spi-pxa2xx.c | 2 -- drivers/spi/spi-realtek-rtl-snand.c | 1 - drivers/spi/spi-rzv2h-rspi.c | 2 -- drivers/spi/spi-rzv2m-csi.c | 2 -- drivers/spi/spi-sc18is602.c | 2 -- drivers/spi/spi-sunplus-sp7021.c | 1 - drivers/spi/spi-virtio.c | 2 -- 17 files changed, 27 deletions(-)
drivers/spi/spi-airoha-snfi.c +0 -1
@@ -1124,7 +1124,6 @@ static int airoha_snand_probe(struct platform_device *pdev) ctrl->bits_per_word_mask =SPI_BPW_MASK (8 ); ctrl->mode_bits =SPI_RX_DUAL ; ctrl->setup = airoha_snand_setup; -device_set_node (&ctrl->dev,dev_fwnode (dev)); err =airoha_snand_nfi_init (as_ctrl);if (err)
drivers/spi/spi-dln2.c +0 -2
@@ -689,8 +689,6 @@ static int dln2_spi_probe(struct platform_device *pdev)if (!host)return -ENOMEM ; -device_set_node (&host->dev,dev_fwnode (dev)); -platform_set_drvdata (pdev, host); dln2 =spi_controller_get_devdata (host);
drivers/spi/spi-dw-core.c +0 -2
@@ -936,8 +936,6 @@ int dw_spi_add_controller(struct device *dev, struct dw_spi *dws)if (!ctlr)return -ENOMEM ; -device_set_node (&ctlr->dev,dev_fwnode (dev)); - dws->ctlr = ctlr; dws->dma_addr = (dma_addr_t)(dws->paddr +DW_SPI_DR );
drivers/spi/spi-ep93xx.c +0 -1
@@ -689,7 +689,6 @@ static int ep93xx_spi_probe(struct platform_device *pdev)/* make sure that the hardware is disabled */ writel (0 , espi->mmio +SSPCR1 ); -device_set_node (&host->dev,dev_fwnode (&pdev->dev)); error =devm_spi_register_controller (&pdev->dev, host);if (error) {dev_err (&pdev->dev,"failed to register SPI host\n" );
drivers/spi/spi-gpio.c +0 -1
@@ -351,7 +351,6 @@ static int spi_gpio_probe(struct platform_device *pdev)return -ENOMEM ;if (fwnode) { -device_set_node (&host->dev, fwnode); host->use_gpio_descriptors = true; }else { status =spi_gpio_probe_pdata (pdev, host);
drivers/spi/spi-ljca.c +0 -1
@@ -238,7 +238,6 @@ static int ljca_spi_probe(struct auxiliary_device *auxdev, controller->auto_runtime_pm = false; controller->max_speed_hz =LJCA_SPI_BUS_MAX_HZ ; -device_set_node (&ljca_spi->controller->dev,dev_fwnode (&auxdev->dev));auxiliary_set_drvdata (auxdev, controller); ret =spi_register_controller (controller);
drivers/spi/spi-loongson-core.c +0 -1
@@ -210,7 +210,6 @@ int loongson_spi_init_controller(struct device *dev, void __iomem *regs) controller->unprepare_message = loongson_spi_unprepare_message; controller->set_cs = loongson_spi_set_cs; controller->num_chipselect =4 ; -device_set_node (&controller->dev,dev_fwnode (dev));dev_set_drvdata (dev, controller); spi =spi_controller_get_devdata (controller);
drivers/spi/spi-mpc512x-psc.c +0 -2
@@ -480,8 +480,6 @@ static int mpc512x_psc_spi_of_probe(struct platform_device *pdev) host->use_gpio_descriptors = true; host->cleanup = mpc512x_psc_spi_cleanup; -device_set_node (&host->dev,dev_fwnode (dev)); - tempp =devm_platform_get_and_ioremap_resource (pdev,0 ,NULL );if (IS_ERR (tempp))return dev_err_probe (dev,PTR_ERR (tempp),"could not ioremap I/O port range\n" );
drivers/spi/spi-mpc52xx-psc.c +0 -2
@@ -319,8 +319,6 @@ static int mpc52xx_psc_spi_of_probe(struct platform_device *pdev) host->transfer_one_message = mpc52xx_psc_spi_transfer_one_message; host->cleanup = mpc52xx_psc_spi_cleanup; -device_set_node (&host->dev,dev_fwnode (dev)); - mps->psc =devm_platform_get_and_ioremap_resource (pdev,0 ,NULL );if (IS_ERR (mps->psc))return dev_err_probe (dev,PTR_ERR (mps->psc),"could not ioremap I/O port range\n" );
drivers/spi/spi-nxp-fspi.c +0 -2
@@ -1383,8 +1383,6 @@ static int nxp_fspi_probe(struct platform_device *pdev)else ctlr->mem_caps = &nxp_fspi_mem_caps; -device_set_node (&ctlr->dev, fwnode); - ret =devm_add_action_or_reset (dev, nxp_fspi_cleanup, f);if (ret)return ret;
drivers/spi/spi-pxa2xx.c +0 -2
@@ -1290,8 +1290,6 @@ int pxa2xx_spi_probe(struct device *dev, struct ssp_device *ssp, drv_data->controller_info = platform_info; drv_data->ssp = ssp; -device_set_node (&controller->dev,dev_fwnode (dev)); -/* The spi->mode bits understood by this driver: */ controller->mode_bits =SPI_CPOL |SPI_CPHA |SPI_CS_HIGH |SPI_LOOP ;
drivers/spi/spi-realtek-rtl-snand.c +0 -1
@@ -400,7 +400,6 @@ static int rtl_snand_probe(struct platform_device *pdev) ctrl->mem_ops = &rtl_snand_mem_ops; ctrl->bits_per_word_mask =SPI_BPW_MASK (8 ); ctrl->mode_bits =SPI_RX_DUAL |SPI_RX_QUAD |SPI_TX_DUAL |SPI_TX_QUAD ; -device_set_node (&ctrl->dev,dev_fwnode (dev));return devm_spi_register_controller (dev, ctrl); }
drivers/spi/spi-rzv2h-rspi.c +0 -2
@@ -797,8 +797,6 @@ static int rzv2h_rspi_probe(struct platform_device *pdev) controller->dma_rx =NULL ; } -device_set_node (&controller->dev,dev_fwnode (dev)); - ret =devm_spi_register_controller (dev, controller);if (ret)dev_err (dev,"register controller failed\n" );
drivers/spi/spi-rzv2m-csi.c +0 -2
@@ -634,8 +634,6 @@ static int rzv2m_csi_probe(struct platform_device *pdev) controller->use_gpio_descriptors = true; controller->target_abort = rzv2m_csi_target_abort; -device_set_node (&controller->dev,dev_fwnode (dev)); - ret =devm_request_irq (dev, irq, rzv2m_csi_irq_handler,0 ,dev_name (dev), csi);if (ret)
drivers/spi/spi-sc18is602.c +0 -2
@@ -251,8 +251,6 @@ static int sc18is602_probe(struct i2c_client *client)if (!host)return -ENOMEM ; -device_set_node (&host->dev,dev_fwnode (dev)); - hw =spi_controller_get_devdata (host);/* assert reset and then release */
drivers/spi/spi-sunplus-sp7021.c +0 -1
@@ -419,7 +419,6 @@ static int sp7021_spi_controller_probe(struct platform_device *pdev) ctlr =devm_spi_alloc_host (dev,sizeof (*pspim));if (!ctlr)return -ENOMEM ; -device_set_node (&ctlr->dev,dev_fwnode (dev)); ctlr->bus_num = pdev->id; ctlr->mode_bits =SPI_CPOL |SPI_CPHA |SPI_CS_HIGH |SPI_LSB_FIRST ; ctlr->auto_runtime_pm = true;
drivers/spi/spi-virtio.c +0 -2
@@ -344,8 +344,6 @@ static int virtio_spi_probe(struct virtio_device *vdev) priv->vdev = vdev; vdev->priv = priv; -device_set_node (&ctrl->dev,dev_fwnode (&vdev->dev)); -dev_set_drvdata (&vdev->dev, ctrl);virtio_spi_read_config (vdev);
Signature · 1 line
2.50.1
Re: [PATCH v1 2/4] spi: Drop duplicate of_node assignment
In reply to Andy ShevchenkoQuoted 9 lines · Andy Shevchenko
The SPI core provides the default
of_nodefor the controller, inherited from the actual (parent) device. No need to repeat it in the driver.Signed-off-by Andy Shevchenko <[email protected]>drivers/spi/spi-rspi.c | 1 - drivers/spi/spi-sh-hspi.c | 1 - drivers/spi/spi-sh-msiof.c | 1 -
LGTM, so
Gr{oetje,eeting}s,
Geert
Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected] In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds
Re: [PATCH v1 4/4] spi: Drop duplicate device_set_node() call
In reply to Andy ShevchenkoQuoted 7 lines · Andy Shevchenko
The SPI core provides the default fwnode for the controller, assigned by
device_set_node(). No need to repeat it in the driver.Signed-off-by Andy Shevchenko <[email protected]>drivers/spi/spi-rzv2h-rspi.c | 2 -- drivers/spi/spi-rzv2m-csi.c | 2 --
LGTM, so
Gr{oetje,eeting}s,
Geert
Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected] In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds
Re: [PATCH v1 2/4] spi: Drop duplicate of_node assignment
In reply to Andy ShevchenkoQuoted 10 lines · Andy Shevchenko
The SPI core provides the default
of_nodefor the controller, inherited from the actual (parent) device. No need to repeat it in the driver.Signed-off-by Andy Shevchenko <[email protected]>--- drivers/spi/spi-bcm63xx-hsspi.c | 1 - drivers/spi/spi-bcm63xx.c | 1 - drivers/spi/spi-bcmbca-hsspi.c | 1 -
Re: [PATCH v1 2/4] spi: Drop duplicate of_node assignment
In reply to Andy ShevchenkoQuoted 6 lines · Andy Shevchenko
The SPI core provides the default
of_nodefor the controller, inherited from the actual (parent) device. No need to repeat it in the driver.Signed-off-by Andy Shevchenko <[email protected]>
[...]
Quoted 2 lines
drivers/spi/spi-amlogic-spifc-a1.c | 1 - drivers/spi/spi-amlogic-spisg.c | 1 -
[...]
Quoted 2 lines
drivers/spi/spi-meson-spicc.c | 1 - drivers/spi/spi-meson-spifc.c | 1 -
For the Amlogic and Amlogic Meson drivers:
Re: [PATCH v1 2/4] spi: Drop duplicate of_node assignment
In reply to Andy ShevchenkoQuoted 5 lines · Andy Shevchenko
The SPI core provides the default
of_nodefor the controller, inherited from the actual (parent) device. No need to repeat it in the driver.Signed-off-by Andy Shevchenko <[email protected]>
Quoted 9 lines
--- drivers/spi/atmel-quadspi.c | 1 - drivers/spi/spi-altera-platform.c | 2 -- drivers/spi/spi-amlogic-spifc-a1.c | 1 - drivers/spi/spi-amlogic-spisg.c | 1 - drivers/spi/spi-apple.c | 1 - drivers/spi/spi-ar934x.c | 1 - drivers/spi/spi-armada-3700.c | 4 +--- drivers/spi/spi-aspeed-smc.c | 1 -
For aspeed,
Thanks,
C.
Re: [PATCH v1 2/4] spi: Drop duplicate of_node assignment
In reply to Andy ShevchenkoQuoted 7 lines · Andy Shevchenko
The SPI core provides the default
of_nodefor the controller, inherited from the actual (parent) device. No need to repeat it in the driver.Signed-off-by Andy Shevchenko <[email protected]>---
[...]
Quoted 2 lines
drivers/spi/spi-sun4i.c | 1 - drivers/spi/spi-sun6i.c | 1 -
[...]
Re: [PATCH v1 2/4] spi: Drop duplicate of_node assignment
In reply to Andy ShevchenkoAm Donnerstag, 8. Januar 2026, 21:23:39 Mitteleuropäische Normalzeit schrieb Andy Shevchenko:
Quoted 9 lines
The SPI core provides the default
of_nodefor the controller, inherited from the actual (parent) device. No need to repeat it in the driver.Signed-off-by Andy Shevchenko <[email protected]>---
drivers/spi/spi-rockchip-sfc.c | 1 - drivers/spi/spi-rockchip.c | 1 -
Re: [PATCH v1 2/4] spi: Drop duplicate of_node assignment
In reply to Andy ShevchenkoQuoted 10 lines · Andy Shevchenko
The SPI core provides the default
of_nodefor the controller, inherited from the actual (parent) device. No need to repeat it in the driver.Signed-off-by Andy Shevchenko <[email protected]>---
drivers/spi/spi-stm32-ospi.c | 1 - drivers/spi/spi-stm32-qspi.c | 1 -
Thanks
Re: [Linux-stm32] [PATCH v1 2/4] spi: Drop duplicate of_node assignment
In reply to Andy ShevchenkoQuoted 6 lines · Andy Shevchenko
The SPI core provides the default
of_nodefor the controller, inherited from the actual (parent) device. No need to repeat it in the driver.Signed-off-by Andy Shevchenko<[email protected]>---
drivers/spi/spi-stm32.c| 1 -
Thanks for your patch,
Re: [PATCH v1 1/4] spi: Propagate default fwnode to the SPI controller device
In reply to Andy ShevchenkoQuoted 9 lines · Andy Shevchenko
Most of the SPI controller drivers share the parent's fwnode by explicit assignment. Propagate the default by SPI core, so they may drop that in the code. Only corner cases may require a special treatment and we simply (re)assign the controller's fwnode explicitly (as it's done right now, no changes required for that).
Signed-off-by Andy Shevchenko <[email protected]>---
Thanks,
Charles
Andy Shevchenko
reviewerRe: [PATCH v1 1/4] spi: Propagate default fwnode to the SPI controller device
Quoted 10 lines · Charles Keepax
Quoted 6 lines · Andy Shevchenko
Most of the SPI controller drivers share the parent's fwnode by explicit assignment. Propagate the default by SPI core, so they may drop that in the code. Only corner cases may require a special treatment and we simply (re)assign the controller's fwnode explicitly (as it's done right now, no changes required for that).
Reviewed-by Charles Keepax <[email protected]>Tested-by Charles Keepax <[email protected]>
Thank you very much! I'm now pretty much confident about the change.
Signature · 2 lines
With Best Regards, Andy Shevchenko
Re: [PATCH v1 4/4] spi: Drop duplicate device_set_node() call
In reply to Andy ShevchenkoQuoted 7 lines · Andy Shevchenko
The SPI core provides the default fwnode for the controller, assigned by
device_set_node(). No need to repeat it in the driver.Signed-off-by Andy Shevchenko <[email protected]>drivers/spi/spi-dw-core.c | 2 --
Works fine on Mobileye EyeQ6Lplus SoC in both host and target mode.
Thanks,
Signature · 3 lines
Benoît Monin, Bootlin Embedded Linux and Kernel engineering https://bootlin.com
kernel test robot
build botRe: [PATCH v1 4/4] spi: Drop duplicate device_set_node() call
In reply to Andy Shevchenkokernel test robot noticed the following build warnings:
Hi Andy,
kernel test robot noticed the following build warnings:
[auto build test WARNING on broonie-spi/for-next]
[also build test WARNING on next-20260109]
[cannot apply to atorgue-stm32/stm32-next rockchip/for-next sunxi/sunxi/for-next linus/master v6.19-rc5] [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#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Andy-Shevchenko/spi-Propagate-default-fwnode-to-the-SPI-controller-device/20260109-043406 base: https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next patch link: https://lore.kernel.org/r/20260108203004.3538449-5-andriy.shevchenko%40linux.intel.com patch subject: [PATCH v1 4/4] spi: Drop duplicate device_set_node() call config: m68k-allmodconfig (https://download.01.org/0day-ci/archive/20260113/[email protected]/config) compiler: m68k-linux-gcc (GCC) 15.2.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260113/[email protected]/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
All warnings (new ones prefixed by >>):
drivers/spi/spi-dln2.c: In function 'dln2_spi_probe':
>> drivers/spi/spi-dln2.c:685:24: warning: unused variable 'dev' [-Wunused-variable]
685 | struct device *dev = &pdev->dev;
| ^~~vim +/dev +685 drivers/spi/spi-dln2.c
3d8c0d749da326 Laurentiu Palcu 2014-12-08 679
3d8c0d749da326 Laurentiu Palcu 2014-12-08 680 static int dln2_spi_probe(struct platform_device *pdev)
3d8c0d749da326 Laurentiu Palcu 2014-12-08 681 {
5ab7a7e37d2fe7 Yang Yingliang 2023-07-28 682 struct spi_controller *host;
3d8c0d749da326 Laurentiu Palcu 2014-12-08 683 struct dln2_spi *dln2;
3d8c0d749da326 Laurentiu Palcu 2014-12-08 684 struct dln2_platform_data *pdata = dev_get_platdata(&pdev->dev);
83835fb07836ea Leonard Crestez 2016-04-15 @685 struct device *dev = &pdev->dev;
3d8c0d749da326 Laurentiu Palcu 2014-12-08 686 int ret;
3d8c0d749da326 Laurentiu Palcu 2014-12-08 687
5ab7a7e37d2fe7 Yang Yingliang 2023-07-28 688 host = spi_alloc_host(&pdev->dev, sizeof(*dln2));
5ab7a7e37d2fe7 Yang Yingliang 2023-07-28 689 if (!host)
3d8c0d749da326 Laurentiu Palcu 2014-12-08 690 return -ENOMEM;
3d8c0d749da326 Laurentiu Palcu 2014-12-08 691
5ab7a7e37d2fe7 Yang Yingliang 2023-07-28 692 platform_set_drvdata(pdev, host);
3d8c0d749da326 Laurentiu Palcu 2014-12-08 693
5ab7a7e37d2fe7 Yang Yingliang 2023-07-28 694 dln2 = spi_controller_get_devdata(host);
3d8c0d749da326 Laurentiu Palcu 2014-12-08 695
3d8c0d749da326 Laurentiu Palcu 2014-12-08 696 dln2->buf = devm_kmalloc(&pdev->dev, DLN2_SPI_BUF_SIZE, GFP_KERNEL);
3d8c0d749da326 Laurentiu Palcu 2014-12-08 697 if (!dln2->buf) {
3d8c0d749da326 Laurentiu Palcu 2014-12-08 698 ret = -ENOMEM;
5ab7a7e37d2fe7 Yang Yingliang 2023-07-28 699 goto exit_free_host;
3d8c0d749da326 Laurentiu Palcu 2014-12-08 700 }
3d8c0d749da326 Laurentiu Palcu 2014-12-08 701
5ab7a7e37d2fe7 Yang Yingliang 2023-07-28 702 dln2->host = host;
3d8c0d749da326 Laurentiu Palcu 2014-12-08 703 dln2->pdev = pdev;
3d8c0d749da326 Laurentiu Palcu 2014-12-08 704 dln2->port = pdata->port;
3d8c0d749da326 Laurentiu Palcu 2014-12-08 705 /* cs/mode can never be 0xff, so the first transfer will set them */
3d8c0d749da326 Laurentiu Palcu 2014-12-08 706 dln2->cs = 0xff;
3d8c0d749da326 Laurentiu Palcu 2014-12-08 707 dln2->mode = 0xff;
3d8c0d749da326 Laurentiu Palcu 2014-12-08 708
3d8c0d749da326 Laurentiu Palcu 2014-12-08 709 /* disable SPI module before continuing with the setup */
3d8c0d749da326 Laurentiu Palcu 2014-12-08 710 ret = dln2_spi_enable(dln2, false);
3d8c0d749da326 Laurentiu Palcu 2014-12-08 711 if (ret < 0) {
3d8c0d749da326 Laurentiu Palcu 2014-12-08 712 dev_err(&pdev->dev, "Failed to disable SPI module\n");
5ab7a7e37d2fe7 Yang Yingliang 2023-07-28 713 goto exit_free_host;
3d8c0d749da326 Laurentiu Palcu 2014-12-08 714 }
3d8c0d749da326 Laurentiu Palcu 2014-12-08 715
5ab7a7e37d2fe7 Yang Yingliang 2023-07-28 716 ret = dln2_spi_get_cs_num(dln2, &host->num_chipselect);
3d8c0d749da326 Laurentiu Palcu 2014-12-08 717 if (ret < 0) {
3d8c0d749da326 Laurentiu Palcu 2014-12-08 718 dev_err(&pdev->dev, "Failed to get number of CS pins\n");
5ab7a7e37d2fe7 Yang Yingliang 2023-07-28 719 goto exit_free_host;
3d8c0d749da326 Laurentiu Palcu 2014-12-08 720 }
3d8c0d749da326 Laurentiu Palcu 2014-12-08 721
3d8c0d749da326 Laurentiu Palcu 2014-12-08 722 ret = dln2_spi_get_speed_range(dln2,
5ab7a7e37d2fe7 Yang Yingliang 2023-07-28 723 &host->min_speed_hz,
5ab7a7e37d2fe7 Yang Yingliang 2023-07-28 724 &host->max_speed_hz);
3d8c0d749da326 Laurentiu Palcu 2014-12-08 725 if (ret < 0) {
3d8c0d749da326 Laurentiu Palcu 2014-12-08 726 dev_err(&pdev->dev, "Failed to read bus min/max freqs\n");
5ab7a7e37d2fe7 Yang Yingliang 2023-07-28 727 goto exit_free_host;
3d8c0d749da326 Laurentiu Palcu 2014-12-08 728 }
3d8c0d749da326 Laurentiu Palcu 2014-12-08 729
3d8c0d749da326 Laurentiu Palcu 2014-12-08 730 ret = dln2_spi_get_supported_frame_sizes(dln2,
5ab7a7e37d2fe7 Yang Yingliang 2023-07-28 731 &host->bits_per_word_mask);
3d8c0d749da326 Laurentiu Palcu 2014-12-08 732 if (ret < 0) {
3d8c0d749da326 Laurentiu Palcu 2014-12-08 733 dev_err(&pdev->dev, "Failed to read supported frame sizes\n");
5ab7a7e37d2fe7 Yang Yingliang 2023-07-28 734 goto exit_free_host;
3d8c0d749da326 Laurentiu Palcu 2014-12-08 735 }
3d8c0d749da326 Laurentiu Palcu 2014-12-08 736
3d8c0d749da326 Laurentiu Palcu 2014-12-08 737 ret = dln2_spi_cs_enable_all(dln2, true);
3d8c0d749da326 Laurentiu Palcu 2014-12-08 738 if (ret < 0) {
3d8c0d749da326 Laurentiu Palcu 2014-12-08 739 dev_err(&pdev->dev, "Failed to enable CS pins\n");
5ab7a7e37d2fe7 Yang Yingliang 2023-07-28 740 goto exit_free_host;
3d8c0d749da326 Laurentiu Palcu 2014-12-08 741 }
3d8c0d749da326 Laurentiu Palcu 2014-12-08 742
5ab7a7e37d2fe7 Yang Yingliang 2023-07-28 743 host->bus_num = -1;
5ab7a7e37d2fe7 Yang Yingliang 2023-07-28 744 host->mode_bits = SPI_CPOL | SPI_CPHA;
5ab7a7e37d2fe7 Yang Yingliang 2023-07-28 745 host->prepare_message = dln2_spi_prepare_message;
5ab7a7e37d2fe7 Yang Yingliang 2023-07-28 746 host->transfer_one = dln2_spi_transfer_one;
5ab7a7e37d2fe7 Yang Yingliang 2023-07-28 747 host->auto_runtime_pm = true;
3d8c0d749da326 Laurentiu Palcu 2014-12-08 748
3d8c0d749da326 Laurentiu Palcu 2014-12-08 749 /* enable SPI module, we're good to go */
3d8c0d749da326 Laurentiu Palcu 2014-12-08 750 ret = dln2_spi_enable(dln2, true);
3d8c0d749da326 Laurentiu Palcu 2014-12-08 751 if (ret < 0) {
3d8c0d749da326 Laurentiu Palcu 2014-12-08 752 dev_err(&pdev->dev, "Failed to enable SPI module\n");
5ab7a7e37d2fe7 Yang Yingliang 2023-07-28 753 goto exit_free_host;
3d8c0d749da326 Laurentiu Palcu 2014-12-08 754 }
3d8c0d749da326 Laurentiu Palcu 2014-12-08 755
3d8c0d749da326 Laurentiu Palcu 2014-12-08 756 pm_runtime_set_autosuspend_delay(&pdev->dev,
3d8c0d749da326 Laurentiu Palcu 2014-12-08 757 DLN2_RPM_AUTOSUSPEND_TIMEOUT);
3d8c0d749da326 Laurentiu Palcu 2014-12-08 758 pm_runtime_use_autosuspend(&pdev->dev);
3d8c0d749da326 Laurentiu Palcu 2014-12-08 759 pm_runtime_set_active(&pdev->dev);
3d8c0d749da326 Laurentiu Palcu 2014-12-08 760 pm_runtime_enable(&pdev->dev);
3d8c0d749da326 Laurentiu Palcu 2014-12-08 761
5ab7a7e37d2fe7 Yang Yingliang 2023-07-28 762 ret = devm_spi_register_controller(&pdev->dev, host);
3d8c0d749da326 Laurentiu Palcu 2014-12-08 763 if (ret < 0) {
5ab7a7e37d2fe7 Yang Yingliang 2023-07-28 764 dev_err(&pdev->dev, "Failed to register host\n");
3d8c0d749da326 Laurentiu Palcu 2014-12-08 765 goto exit_register;
3d8c0d749da326 Laurentiu Palcu 2014-12-08 766 }
3d8c0d749da326 Laurentiu Palcu 2014-12-08 767
3d8c0d749da326 Laurentiu Palcu 2014-12-08 768 return ret;
3d8c0d749da326 Laurentiu Palcu 2014-12-08 769
3d8c0d749da326 Laurentiu Palcu 2014-12-08 770 exit_register:
3d8c0d749da326 Laurentiu Palcu 2014-12-08 771 pm_runtime_disable(&pdev->dev);
3d8c0d749da326 Laurentiu Palcu 2014-12-08 772 pm_runtime_set_suspended(&pdev->dev);
3d8c0d749da326 Laurentiu Palcu 2014-12-08 773
3d8c0d749da326 Laurentiu Palcu 2014-12-08 774 if (dln2_spi_enable(dln2, false) < 0)
3d8c0d749da326 Laurentiu Palcu 2014-12-08 775 dev_err(&pdev->dev, "Failed to disable SPI module\n");
5ab7a7e37d2fe7 Yang Yingliang 2023-07-28 776 exit_free_host:
5ab7a7e37d2fe7 Yang Yingliang 2023-07-28 777 spi_controller_put(host);
3d8c0d749da326 Laurentiu Palcu 2014-12-08 778
3d8c0d749da326 Laurentiu Palcu 2014-12-08 779 return ret;
3d8c0d749da326 Laurentiu Palcu 2014-12-08 780 }
3d8c0d749da326 Laurentiu Palcu 2014-12-08 781 Signature · 2 lines
0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki
Mark Brown
maintainerQuoted 11 lines · Andy Shevchenko
It seems all of the SPI drivers want to propagate fwnode (or
of_node) of the physical device to the SPI device. Make sure we don't duplicate it over and over in each new driver (+2 in this cycle) by making core to take care of that. Note, similar is done already by IIO and I²C subsystems.There is one noticeable and quite specific case that is taken care in the first patch and would be nice to have a confirmation from Cirrus that everything is okay. The rest is just a mechanical conversion.
[...]
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next
Thanks!
[1/4] spi: Propagate default fwnode to the SPI controller device
commit: f2d1a3318eb1ec860999db48cb8d13b43261624d
[2/4] spi: Drop duplicate of_node assignment
commit: 3974a585be78a1dc90a19d5cf1846a99954e3842
[3/4] spi: Drop duplicate fwnode assignment
commit: 103c510e1c6832720059756d155dd13a42baa7ab
[4/4] spi: Drop duplicate device_set_node() call
commit: 37fbc1ab0f225d23f0839260a11375b4f1f7cf8cAll being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks,
Mark