Skip to contentSkip to conversation

spi: Remove explictly set bus_num and num_chipselect to default setting

PATCH Applied Axel Lin 4 participants 4 messages Feb 11, 2014 – Feb 16, 2014

Subsystems (5)
lore
Share & tools
lore

Axel Lin

author
#0 lore raw

PATCH 1/1 spi: Remove explictly set bus_num and num_chipselect to default setting

The purpose of commit 1e8a52e18cfb
"spi: By default setup spi_masters with 1 chipselect and dynamics bus number" is to avoid setting default value for bus_num and num_chipselect in spi master drivers. So let's remove the duplicate code.

Cc Chris Boot <[email protected]>
Cc Uwe Kleine-König <[email protected]>
Cc Thomas Langer <[email protected]>
Cc David Daney <david.daney-YGCgFSpz5w/[email protected]>
Cc Kuninori Morimoto <[email protected]>
Cc Laxman Dewangan <[email protected]>
Cc Stephen Warren <[email protected]>
Cc Sourav Poddar <[email protected]>
---
 drivers/spi/spi-bcm2835.c        | 1 -
 drivers/spi/spi-efm32.c          | 4 ----
 drivers/spi/spi-falcon.c         | 2 --
 drivers/spi/spi-octeon.c         | 2 --
 drivers/spi/spi-sh-hspi.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-ti-qspi.c        | 1 -
 9 files changed, 14 deletions(-)
drivers/spi/spi-bcm2835.c +0 -1
index 8a89dd1..6916745 100644
@@ -315,7 +315,6 @@ static int bcm2835_spi_probe(struct platform_device *pdev)
 
 	master->mode_bits = BCM2835_SPI_MODE_BITS;
 	master->bits_per_word_mask = SPI_BPW_MASK(8);
-	master->bus_num = -1;
 	master->num_chipselect = 3;
 	master->transfer_one_message = bcm2835_spi_transfer_one;
 	master->dev.of_node = pdev->dev.of_node;
drivers/spi/spi-efm32.c +0 -4
index 03cbb5e..f53bbea 100644
@@ -308,10 +308,6 @@ static int efm32_spi_probe_dt(struct platform_device *pdev,
 	}
 
 	ddata->pdata.location = location;
-
-	/* spi core takes care about the bus number using an alias */
-	master->bus_num = -1;
-
 	return 0;
 }
 
drivers/spi/spi-falcon.c +0 -2
index 0ae7f45..09965f0 100644
@@ -419,9 +419,7 @@ static int falcon_sflash_probe(struct platform_device *pdev)
 	priv->master = master;
 
 	master->mode_bits = SPI_MODE_3;
-	master->num_chipselect = 1;
 	master->flags = SPI_MASTER_HALF_DUPLEX;
-	master->bus_num = -1;
 	master->setup = falcon_sflash_setup;
 	master->prepare_transfer_hardware = falcon_sflash_prepare_xfer;
 	master->transfer_one_message = falcon_sflash_xfer_one;
drivers/spi/spi-octeon.c +0 -2
index cf88974..a4805f2 100644
@@ -257,8 +257,6 @@ static int octeon_spi_probe(struct platform_device *pdev)
 	p->register_base = (u64)devm_ioremap(&pdev->dev, res_mem->start,
 					     resource_size(res_mem));
 
-	/* Dynamic bus numbering */
-	master->bus_num = -1;
 	master->num_chipselect = 4;
 	master->mode_bits = SPI_CPHA |
 			    SPI_CPOL |
drivers/spi/spi-sh-hspi.c +0 -1
index 82d2f92..755d7cc 100644
@@ -298,7 +298,6 @@ static int hspi_probe(struct platform_device *pdev)
 
 	pm_runtime_enable(&pdev->dev);
 
-	master->num_chipselect	= 1;
 	master->bus_num		= pdev->id;
 	master->setup		= hspi_setup;
 	master->cleanup		= hspi_cleanup;
drivers/spi/spi-tegra114.c +0 -1
index 3d10ece..4006495 100644
@@ -1042,7 +1042,6 @@ static int tegra_spi_probe(struct platform_device *pdev)
 	master->setup = tegra_spi_setup;
 	master->transfer_one_message = tegra_spi_transfer_one_message;
 	master->num_chipselect = MAX_CHIP_SELECT;
-	master->bus_num = -1;
 	master->auto_runtime_pm = true;
 
 	tspi->master = master;
drivers/spi/spi-tegra20-sflash.c +0 -1
index 5db73c0..47869ea 100644
@@ -450,7 +450,6 @@ static int tegra_sflash_probe(struct platform_device *pdev)
 	master->transfer_one_message = tegra_sflash_transfer_one_message;
 	master->auto_runtime_pm = true;
 	master->num_chipselect = MAX_CHIP_SELECT;
-	master->bus_num = -1;
 
 	platform_set_drvdata(pdev, master);
 	tsd = spi_master_get_devdata(master);
drivers/spi/spi-tegra20-slink.c +0 -1
index 8e21651..e3c1b93 100644
@@ -1038,7 +1038,6 @@ static int tegra_slink_probe(struct platform_device *pdev)
 	master->unprepare_message = tegra_slink_unprepare_message;
 	master->auto_runtime_pm = true;
 	master->num_chipselect = MAX_CHIP_SELECT;
-	master->bus_num = -1;
 
 	platform_set_drvdata(pdev, master);
 	tspi = spi_master_get_devdata(master);
drivers/spi/spi-ti-qspi.c +0 -1
index 7eb2cef..49ddfc7 100644
@@ -429,7 +429,6 @@ static int ti_qspi_probe(struct platform_device *pdev)
 
 	master->mode_bits = SPI_CPOL | SPI_CPHA | SPI_RX_DUAL | SPI_RX_QUAD;
 
-	master->bus_num = -1;
 	master->flags = SPI_MASTER_HALF_DUPLEX;
 	master->setup = ti_qspi_setup;
 	master->auto_runtime_pm = true;
Signature · 8 lines
1.8.1.2



--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Acked-by on v1 1/1
#1 lore raw
Quoted 5 lines · Axel Lin

The purpose of commit 1e8a52e18cfb
"spi: By default setup spi_masters with 1 chipselect and dynamics bus number" is to avoid setting default value for bus_num and num_chipselect in spi master drivers. So let's remove the duplicate code.

Quoted 9 lines
Cc Chris Boot <[email protected]>
Cc Uwe Kleine-König <[email protected]>
Cc Thomas Langer <[email protected]>
Cc David Daney <david.daney-YGCgFSpz5w/[email protected]>
Cc Kuninori Morimoto <[email protected]>
Cc Laxman Dewangan <[email protected]>
Cc Stephen Warren <[email protected]>
Cc Sourav Poddar <[email protected]>
Quoted 132 lines
---
 drivers/spi/spi-bcm2835.c        | 1 -
 drivers/spi/spi-efm32.c          | 4 ----
 drivers/spi/spi-falcon.c         | 2 --
 drivers/spi/spi-octeon.c         | 2 --
 drivers/spi/spi-sh-hspi.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-ti-qspi.c        | 1 -
 9 files changed, 14 deletions(-)
drivers/spi/spi-bcm2835.c +0 -1
index 8a89dd1..6916745 100644
@@ -315,7 +315,6 @@ static int bcm2835_spi_probe(struct platform_device *pdev)
 
 	master->mode_bits = BCM2835_SPI_MODE_BITS;
 	master->bits_per_word_mask = SPI_BPW_MASK(8);
-	master->bus_num = -1;
 	master->num_chipselect = 3;
 	master->transfer_one_message = bcm2835_spi_transfer_one;
 	master->dev.of_node = pdev->dev.of_node;
drivers/spi/spi-efm32.c +0 -4
index 03cbb5e..f53bbea 100644
@@ -308,10 +308,6 @@ static int efm32_spi_probe_dt(struct platform_device *pdev,
 	}
 
 	ddata->pdata.location = location;
-
-	/* spi core takes care about the bus number using an alias */
-	master->bus_num = -1;
-
 	return 0;
 }
 
drivers/spi/spi-falcon.c +0 -2
index 0ae7f45..09965f0 100644
@@ -419,9 +419,7 @@ static int falcon_sflash_probe(struct platform_device *pdev)
 	priv->master = master;
 
 	master->mode_bits = SPI_MODE_3;
-	master->num_chipselect = 1;
 	master->flags = SPI_MASTER_HALF_DUPLEX;
-	master->bus_num = -1;
 	master->setup = falcon_sflash_setup;
 	master->prepare_transfer_hardware = falcon_sflash_prepare_xfer;
 	master->transfer_one_message = falcon_sflash_xfer_one;
drivers/spi/spi-octeon.c +0 -2
index cf88974..a4805f2 100644
@@ -257,8 +257,6 @@ static int octeon_spi_probe(struct platform_device *pdev)
 	p->register_base = (u64)devm_ioremap(&pdev->dev, res_mem->start,
 					     resource_size(res_mem));
 
-	/* Dynamic bus numbering */
-	master->bus_num = -1;
 	master->num_chipselect = 4;
 	master->mode_bits = SPI_CPHA |
 			    SPI_CPOL |
drivers/spi/spi-sh-hspi.c +0 -1
index 82d2f92..755d7cc 100644
@@ -298,7 +298,6 @@ static int hspi_probe(struct platform_device *pdev)
 
 	pm_runtime_enable(&pdev->dev);
 
-	master->num_chipselect	= 1;
 	master->bus_num		= pdev->id;
 	master->setup		= hspi_setup;
 	master->cleanup		= hspi_cleanup;
drivers/spi/spi-tegra114.c +0 -1
index 3d10ece..4006495 100644
@@ -1042,7 +1042,6 @@ static int tegra_spi_probe(struct platform_device *pdev)
 	master->setup = tegra_spi_setup;
 	master->transfer_one_message = tegra_spi_transfer_one_message;
 	master->num_chipselect = MAX_CHIP_SELECT;
-	master->bus_num = -1;
 	master->auto_runtime_pm = true;
 
 	tspi->master = master;
drivers/spi/spi-tegra20-sflash.c +0 -1
index 5db73c0..47869ea 100644
@@ -450,7 +450,6 @@ static int tegra_sflash_probe(struct platform_device *pdev)
 	master->transfer_one_message = tegra_sflash_transfer_one_message;
 	master->auto_runtime_pm = true;
 	master->num_chipselect = MAX_CHIP_SELECT;
-	master->bus_num = -1;
 
 	platform_set_drvdata(pdev, master);
 	tsd = spi_master_get_devdata(master);
drivers/spi/spi-tegra20-slink.c +0 -1
index 8e21651..e3c1b93 100644
@@ -1038,7 +1038,6 @@ static int tegra_slink_probe(struct platform_device *pdev)
 	master->unprepare_message = tegra_slink_unprepare_message;
 	master->auto_runtime_pm = true;
 	master->num_chipselect = MAX_CHIP_SELECT;
-	master->bus_num = -1;
 
 	platform_set_drvdata(pdev, master);
 	tspi = spi_master_get_devdata(master);
drivers/spi/spi-ti-qspi.c +0 -1
index 7eb2cef..49ddfc7 100644
@@ -429,7 +429,6 @@ static int ti_qspi_probe(struct platform_device *pdev)
 
 	master->mode_bits = SPI_CPOL | SPI_CPHA | SPI_RX_DUAL | SPI_RX_QUAD;
 
-	master->bus_num = -1;
 	master->flags = SPI_MASTER_HALF_DUPLEX;
 	master->setup = ti_qspi_setup;
 	master->auto_runtime_pm = true;
Signature · 1 line
1.8.1.2
Signature · 6 lines
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Acked-by on v1 1/1
#2 lore raw
In reply to Axel Lin
Quoted 4 lines · Axel Lin

The purpose of commit 1e8a52e18cfb
"spi: By default setup spi_masters with 1 chipselect and dynamics bus number" is to avoid setting default value for bus_num and num_chipselect in spi master drivers. So let's remove the duplicate code.

It seems good to me, so ...

Quoted 22 lines
Cc Chris Boot <[email protected]>
Cc Uwe Kleine-König <[email protected]>
Cc Thomas Langer <[email protected]>
Cc David Daney <david.daney-YGCgFSpz5w/[email protected]>
Cc Kuninori Morimoto <[email protected]>
Cc Laxman Dewangan <[email protected]>
Cc Stephen Warren <[email protected]>
Cc Sourav Poddar <[email protected]>
---
  drivers/spi/spi-bcm2835.c        | 1 -
  drivers/spi/spi-efm32.c          | 4 ----
  drivers/spi/spi-falcon.c         | 2 --
  drivers/spi/spi-octeon.c         | 2 --
  drivers/spi/spi-sh-hspi.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-ti-qspi.c        | 1 -
  9 files changed, 14 deletions(-)

[...]

drivers/spi/spi-octeon.c static int octeon_spi_probe(struct platform_device *pdev) · line 262

Quoted 13 lines
drivers/spi/spi-octeon.c +0 -2
index cf88974..a4805f2 100644
@@ -257,8 +257,6 @@ static int octeon_spi_probe(struct platform_device *pdev)
  	p->register_base = (u64)devm_ioremap(&pdev->dev, res_mem->start,
  					     resource_size(res_mem));
 
-	/* Dynamic bus numbering */
-	master->bus_num = -1;
  	master->num_chipselect = 4;
  	master->mode_bits = SPI_CPHA |
  			    SPI_CPOL |

... this bit:

--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

Applied
#3 lore raw
In reply to Axel Lin
Quoted 4 lines · Axel Lin

The purpose of commit 1e8a52e18cfb
"spi: By default setup spi_masters with 1 chipselect and dynamics bus number" is to avoid setting default value for bus_num and num_chipselect in spi master drivers. So let's remove the duplicate code.

Applied, thanks.