linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drivers: spi: Allocate bus number from spi framework
@ 2017-08-18  5:43 sunil.m
  2017-08-18 11:15 ` Mark Brown
  2017-08-18 11:49 ` Applied "spi: omap: Allocate bus number from spi framework" to the spi tree Mark Brown
  0 siblings, 2 replies; 3+ messages in thread
From: sunil.m @ 2017-08-18  5:43 UTC (permalink / raw)
  To: broonie; +Cc: linux-spi, linux-kernel, karthik, Suniel Mahesh

From: Suniel Mahesh <sunil.m@techveda.org>

spi framework should allocate bus number dynamically either
via Linux IDR or spi alias for master drivers. This patch deletes
code pertaining to manual allocation of spi bus number in spi omap2
master driver.

Signed-off-by: Suniel Mahesh <sunil.m@techveda.org>
Signed-off-by: Karthik Tummala <karthik@techveda.org>
Tested-by: Karthik Tummala <karthik@techveda.org>
---
Note:
- Patch was compile tested and built(ARCH=arm) on next-20170817.
- Patch was hardware tested on AM335x (McSPI controller) with
  spi flash chips.
- Added spi aliases in aliases node, device tree and tested.
- No build/run-time issues reported.
- The commit:
"spi: Pick spi bus number from Linux idr or spi alias"
(SHA1:9b61e302210eba55768962f2f11e96bb508c2408)
has introduced bus numbering which happens dynamically either
via Linux IDR or spi alias for master drivers.
---
 drivers/spi/spi-omap2-mcspi.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/drivers/spi/spi-omap2-mcspi.c b/drivers/spi/spi-omap2-mcspi.c
index e048268..9bf64e6 100644
--- a/drivers/spi/spi-omap2-mcspi.c
+++ b/drivers/spi/spi-omap2-mcspi.c
@@ -1338,7 +1338,6 @@ static int omap2_mcspi_probe(struct platform_device *pdev)
 	struct resource		*r;
 	int			status = 0, i;
 	u32			regs_offset = 0;
-	static int		bus_num = 1;
 	struct device_node	*node = pdev->dev.of_node;
 	const struct of_device_id *match;
 
@@ -1374,14 +1373,11 @@ static int omap2_mcspi_probe(struct platform_device *pdev)
 
 		of_property_read_u32(node, "ti,spi-num-cs", &num_cs);
 		master->num_chipselect = num_cs;
-		master->bus_num = bus_num++;
 		if (of_get_property(node, "ti,pindir-d0-out-d1-in", NULL))
 			mcspi->pin_dir = MCSPI_PINDIR_D0_OUT_D1_IN;
 	} else {
 		pdata = dev_get_platdata(&pdev->dev);
 		master->num_chipselect = pdata->num_cs;
-		if (pdev->id != -1)
-			master->bus_num = pdev->id;
 		mcspi->pin_dir = pdata->pin_dir;
 	}
 	regs_offset = pdata->regs_offset;
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] drivers: spi: Allocate bus number from spi framework
  2017-08-18  5:43 [PATCH] drivers: spi: Allocate bus number from spi framework sunil.m
@ 2017-08-18 11:15 ` Mark Brown
  2017-08-18 11:49 ` Applied "spi: omap: Allocate bus number from spi framework" to the spi tree Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2017-08-18 11:15 UTC (permalink / raw)
  To: sunil.m; +Cc: linux-spi, linux-kernel, karthik

[-- Attachment #1: Type: text/plain, Size: 472 bytes --]

On Fri, Aug 18, 2017 at 11:13:40AM +0530, sunil.m@techveda.org wrote:
> From: Suniel Mahesh <sunil.m@techveda.org>
> 
> spi framework should allocate bus number dynamically either
> via Linux IDR or spi alias for master drivers. This patch deletes
> code pertaining to manual allocation of spi bus number in spi omap2
> master driver.

Please use subject lines matching the style for the subsystem.  This
makes it easier for people to identify relevant patches.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Applied "spi: omap: Allocate bus number from spi framework" to the spi tree
  2017-08-18  5:43 [PATCH] drivers: spi: Allocate bus number from spi framework sunil.m
  2017-08-18 11:15 ` Mark Brown
@ 2017-08-18 11:49 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2017-08-18 11:49 UTC (permalink / raw)
  To: Suniel Mahesh
  Cc: Karthik Tummala, Karthik Tummala, Mark Brown, broonie, linux-spi,
	linux-kernel, karthik, linux-spi

The patch

   spi: omap: Allocate bus number from spi framework

has been applied to the spi tree at

   git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git 

All 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

>From b590782afe0a99fca84f451252ed7e2d64b2f155 Mon Sep 17 00:00:00 2001
From: Suniel Mahesh <sunil.m@techveda.org>
Date: Fri, 18 Aug 2017 11:13:40 +0530
Subject: [PATCH] spi: omap: Allocate bus number from spi framework

spi framework should allocate bus number dynamically either
via Linux IDR or spi alias for master drivers. This patch deletes
code pertaining to manual allocation of spi bus number in spi omap2
master driver.

Signed-off-by: Suniel Mahesh <sunil.m@techveda.org>
Signed-off-by: Karthik Tummala <karthik@techveda.org>
Tested-by: Karthik Tummala <karthik@techveda.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 drivers/spi/spi-omap2-mcspi.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/drivers/spi/spi-omap2-mcspi.c b/drivers/spi/spi-omap2-mcspi.c
index e048268d8ba2..9bf64e6eca9b 100644
--- a/drivers/spi/spi-omap2-mcspi.c
+++ b/drivers/spi/spi-omap2-mcspi.c
@@ -1338,7 +1338,6 @@ static int omap2_mcspi_probe(struct platform_device *pdev)
 	struct resource		*r;
 	int			status = 0, i;
 	u32			regs_offset = 0;
-	static int		bus_num = 1;
 	struct device_node	*node = pdev->dev.of_node;
 	const struct of_device_id *match;
 
@@ -1374,14 +1373,11 @@ static int omap2_mcspi_probe(struct platform_device *pdev)
 
 		of_property_read_u32(node, "ti,spi-num-cs", &num_cs);
 		master->num_chipselect = num_cs;
-		master->bus_num = bus_num++;
 		if (of_get_property(node, "ti,pindir-d0-out-d1-in", NULL))
 			mcspi->pin_dir = MCSPI_PINDIR_D0_OUT_D1_IN;
 	} else {
 		pdata = dev_get_platdata(&pdev->dev);
 		master->num_chipselect = pdata->num_cs;
-		if (pdev->id != -1)
-			master->bus_num = pdev->id;
 		mcspi->pin_dir = pdata->pin_dir;
 	}
 	regs_offset = pdata->regs_offset;
-- 
2.13.2

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-08-18 11:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-18  5:43 [PATCH] drivers: spi: Allocate bus number from spi framework sunil.m
2017-08-18 11:15 ` Mark Brown
2017-08-18 11:49 ` Applied "spi: omap: Allocate bus number from spi framework" to the spi tree Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).