Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1334652

Re: [PATCH 3/3] spi: rockchip: add debug interface support

From Mark Brown <broonie@kernel.org>
Newsgroups linux.kernel
Subject Re: [PATCH 3/3] spi: rockchip: add debug interface support
Date 2016-02-15 18:30 +0100
Message-ID <r2v8f-45p-49@gated-at.bofh.it> (permalink)
References <r2mRl-6Rc-25@gated-at.bofh.it> <r2mRm-6Rc-51@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

On Mon, Feb 15, 2016 at 04:28:22PM +0800, Shawn Lin wrote:

> +#ifdef CONFIG_DEBUG_FS
> +#include <linux/debugfs.h>
> +#endif

Just include the header.  Only add ifdefs if they do something.

> +static int rockchip_spi_debugfs_init(struct rockchip_spi *rs)
> +{
> +	rs->debugfs = debugfs_create_dir("rockchip_spi", NULL);
> +	if (!rs->debugfs)
> +		return -ENOMEM;
> +
> +	debugfs_create_file("regs", S_IFREG | S_IRUGO,
> +		rs->debugfs, (void *)rs, &rockchip_spi_dbg_ops);
> +	return 0;
> +}

This is completely separate to the core debugfs support for SPI, if
we're adding new debugfs stuff that's per device we should be extending
the core debugfs stuff so everything is in one place.

Your register dump stuff looks like you might want to consider using
regmap, it's got this and other register access diagnostics already.

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/3] Some rockchip_spi fixes and debug support Shawn Lin <shawn.lin@rock-chips.com> - 2016-02-15 09:40 +0100
  [PATCH 1/3] spi: rockchip: disable runtime pm when in err case Shawn Lin <shawn.lin@rock-chips.com> - 2016-02-15 09:40 +0100
  [PATCH 2/3] spi: rockchip: add missing spi_master_put Shawn Lin <shawn.lin@rock-chips.com> - 2016-02-15 09:40 +0100
  [PATCH 3/3] spi: rockchip: add debug interface support Shawn Lin <shawn.lin@rock-chips.com> - 2016-02-15 09:40 +0100
    Re: [PATCH 3/3] spi: rockchip: add debug interface support Mark Brown <broonie@kernel.org> - 2016-02-15 18:30 +0100
      Re: [PATCH 3/3] spi: rockchip: add debug interface support Shawn Lin <shawn.lin@rock-chips.com> - 2016-02-16 02:40 +0100

csiph-web