Re: [PATCH] drivers: spi: Allocate bus number from spi framework

2017-08-18 Thread Mark Brown
On Fri, Aug 18, 2017 at 11:13:40AM +0530, suni...@techveda.org wrote:
> From: Suniel Mahesh 
> 
> 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.


signature.asc
Description: PGP signature


Re: [PATCH] drivers: spi: Allocate bus number from spi framework

2017-08-18 Thread Mark Brown
On Fri, Aug 18, 2017 at 11:13:40AM +0530, suni...@techveda.org wrote:
> From: Suniel Mahesh 
> 
> 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.


signature.asc
Description: PGP signature


[PATCH] drivers: spi: Allocate bus number from spi framework

2017-08-17 Thread sunil . m
From: Suniel Mahesh 

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 
Signed-off-by: Karthik Tummala 
Tested-by: Karthik Tummala 
---
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", _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(>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



[PATCH] drivers: spi: Allocate bus number from spi framework

2017-08-17 Thread sunil . m
From: Suniel Mahesh 

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 
Signed-off-by: Karthik Tummala 
Tested-by: Karthik Tummala 
---
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", _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(>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