summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhil Reid <preid@electromag.com.au>2017-01-06 04:35:13 -0500
committerMark Brown <broonie@kernel.org>2017-01-09 06:22:14 -0500
commite70002c80d4de20a5c61c16ecd4f40a48be3efcf (patch)
treede3b927ab44c473763634412bc2a9967aefc1a94
parentcf1716e9dae5b21b9bbcfe5eb0106c3b0aee37e8 (diff)
spi: dw: Make debugfs use bus num and make irq name unique
Instead of using device name it was suggested that bus number was more appropriate to differentiate debugfs names. Also reduce buffer size to more realistic 32 bytes instead of 128. When request_irq is called the bus number may not be assigned. Therefore the irq name was not unique when dynamic bus number was being used. As per most of the spi drivers use the device name instead. No other use of dws->name could be found so it was removed. Signed-off-by: Phil Reid <preid@electromag.com.au> Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--drivers/spi/spi-dw.c8
-rw-r--r--drivers/spi/spi-dw.h1
2 files changed, 4 insertions, 5 deletions
diff --git a/drivers/spi/spi-dw.c b/drivers/spi/spi-dw.c
index 054012f87567..b217c22ff72f 100644
--- a/drivers/spi/spi-dw.c
+++ b/drivers/spi/spi-dw.c
@@ -107,9 +107,9 @@ static const struct file_operations dw_spi_regs_ops = {
107 107
108static int dw_spi_debugfs_init(struct dw_spi *dws) 108static int dw_spi_debugfs_init(struct dw_spi *dws)
109{ 109{
110 char name[128]; 110 char name[32];
111 111
112 snprintf(name, 128, "dw_spi-%s", dev_name(&dws->master->dev)); 112 snprintf(name, 32, "dw_spi%d", dws->master->bus_num);
113 dws->debugfs = debugfs_create_dir(name, NULL); 113 dws->debugfs = debugfs_create_dir(name, NULL);
114 if (!dws->debugfs) 114 if (!dws->debugfs)
115 return -ENOMEM; 115 return -ENOMEM;
@@ -486,9 +486,9 @@ int dw_spi_add_host(struct device *dev, struct dw_spi *dws)
486 dws->type = SSI_MOTO_SPI; 486 dws->type = SSI_MOTO_SPI;
487 dws->dma_inited = 0; 487 dws->dma_inited = 0;
488 dws->dma_addr = (dma_addr_t)(dws->paddr + DW_SPI_DR); 488 dws->dma_addr = (dma_addr_t)(dws->paddr + DW_SPI_DR);
489 snprintf(dws->name, sizeof(dws->name), "dw_spi%d", dws->bus_num);
490 489
491 ret = request_irq(dws->irq, dw_spi_irq, IRQF_SHARED, dws->name, master); 490 ret = request_irq(dws->irq, dw_spi_irq, IRQF_SHARED, dev_name(dev),
491 master);
492 if (ret < 0) { 492 if (ret < 0) {
493 dev_err(dev, "can not get IRQ\n"); 493 dev_err(dev, "can not get IRQ\n");
494 goto err_free_master; 494 goto err_free_master;
diff --git a/drivers/spi/spi-dw.h b/drivers/spi/spi-dw.h
index c21ca02f8ec5..da5eab62df34 100644
--- a/drivers/spi/spi-dw.h
+++ b/drivers/spi/spi-dw.h
@@ -101,7 +101,6 @@ struct dw_spi_dma_ops {
101struct dw_spi { 101struct dw_spi {
102 struct spi_master *master; 102 struct spi_master *master;
103 enum dw_ssi_type type; 103 enum dw_ssi_type type;
104 char name[16];
105 104
106 void __iomem *regs; 105 void __iomem *regs;
107 unsigned long paddr; 106 unsigned long paddr;