Re: [PATCH 1/1] spi: dw: Make debugfs name unique between instances

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Dec 22, 2016 at 11:18 AM, Phil Reid <preid@xxxxxxxxxxxxxxxxx> wrote:
> Some system have multiple dw devices. Currently the driver uses a
> fixed name for the debugfs dir. Append dev name to the debugfs dir
> name to make it unique.


> --- a/drivers/spi/spi-dw.c
> +++ b/drivers/spi/spi-dw.c
> @@ -107,7 +107,10 @@ static ssize_t dw_spi_show_regs(struct file *file, char __user *user_buf,
>
>  static int dw_spi_debugfs_init(struct dw_spi *dws)
>  {
> -       dws->debugfs = debugfs_create_dir("dw_spi", NULL);
> +       char name[128];
> +
> +       snprintf(name, 128, "dw_spi-%s", dev_name(&dws->master->dev));

128 is too much.
Perhaps something like 32 and use bus number instead of dev_name().

> +       dws->debugfs = debugfs_create_dir(name, NULL);
>         if (!dws->debugfs)
>                 return -ENOMEM;


-- 
With Best Regards,
Andy Shevchenko
--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux