Commit e70002c8 authored by Phil Reid's avatar Phil Reid Committed by Mark Brown

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: default avatarPhil Reid <preid@electromag.com.au>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent cf1716e9
...@@ -107,9 +107,9 @@ static const struct file_operations dw_spi_regs_ops = { ...@@ -107,9 +107,9 @@ static const struct file_operations dw_spi_regs_ops = {
static int dw_spi_debugfs_init(struct dw_spi *dws) static int dw_spi_debugfs_init(struct dw_spi *dws)
{ {
char name[128]; char name[32];
snprintf(name, 128, "dw_spi-%s", dev_name(&dws->master->dev)); snprintf(name, 32, "dw_spi%d", dws->master->bus_num);
dws->debugfs = debugfs_create_dir(name, NULL); dws->debugfs = debugfs_create_dir(name, NULL);
if (!dws->debugfs) if (!dws->debugfs)
return -ENOMEM; return -ENOMEM;
...@@ -486,9 +486,9 @@ int dw_spi_add_host(struct device *dev, struct dw_spi *dws) ...@@ -486,9 +486,9 @@ int dw_spi_add_host(struct device *dev, struct dw_spi *dws)
dws->type = SSI_MOTO_SPI; dws->type = SSI_MOTO_SPI;
dws->dma_inited = 0; dws->dma_inited = 0;
dws->dma_addr = (dma_addr_t)(dws->paddr + DW_SPI_DR); dws->dma_addr = (dma_addr_t)(dws->paddr + DW_SPI_DR);
snprintf(dws->name, sizeof(dws->name), "dw_spi%d", dws->bus_num);
ret = request_irq(dws->irq, dw_spi_irq, IRQF_SHARED, dws->name, master); ret = request_irq(dws->irq, dw_spi_irq, IRQF_SHARED, dev_name(dev),
master);
if (ret < 0) { if (ret < 0) {
dev_err(dev, "can not get IRQ\n"); dev_err(dev, "can not get IRQ\n");
goto err_free_master; goto err_free_master;
......
...@@ -101,7 +101,6 @@ struct dw_spi_dma_ops { ...@@ -101,7 +101,6 @@ struct dw_spi_dma_ops {
struct dw_spi { struct dw_spi {
struct spi_master *master; struct spi_master *master;
enum dw_ssi_type type; enum dw_ssi_type type;
char name[16];
void __iomem *regs; void __iomem *regs;
unsigned long paddr; unsigned long paddr;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment