mirror of
https://github.com/torvalds/linux.git
synced 2024-11-10 22:21:40 +00:00
ASoC: SOF: add mode parameter for snd_sof_debugfs_buf_item
Add mode parameter for snd_sof_debugfs_buf_item() to specify the mode while creating debugfs entries. Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
9d563eb95b
commit
5c9714f637
@ -161,7 +161,7 @@ EXPORT_SYMBOL_GPL(snd_sof_debugfs_io_item);
|
|||||||
/* create FS entry for debug files to expose kernel memory */
|
/* create FS entry for debug files to expose kernel memory */
|
||||||
int snd_sof_debugfs_buf_item(struct snd_sof_dev *sdev,
|
int snd_sof_debugfs_buf_item(struct snd_sof_dev *sdev,
|
||||||
void *base, size_t size,
|
void *base, size_t size,
|
||||||
const char *name)
|
const char *name, mode_t mode)
|
||||||
{
|
{
|
||||||
struct snd_sof_dfsentry *dfse;
|
struct snd_sof_dfsentry *dfse;
|
||||||
|
|
||||||
@ -177,7 +177,7 @@ int snd_sof_debugfs_buf_item(struct snd_sof_dev *sdev,
|
|||||||
dfse->size = size;
|
dfse->size = size;
|
||||||
dfse->sdev = sdev;
|
dfse->sdev = sdev;
|
||||||
|
|
||||||
dfse->dfsentry = debugfs_create_file(name, 0444, sdev->debugfs_root,
|
dfse->dfsentry = debugfs_create_file(name, mode, sdev->debugfs_root,
|
||||||
dfse, &sof_dfs_fops);
|
dfse, &sof_dfs_fops);
|
||||||
if (!dfse->dfsentry) {
|
if (!dfse->dfsentry) {
|
||||||
/* can't rely on debugfs, only log error and keep going */
|
/* can't rely on debugfs, only log error and keep going */
|
||||||
|
@ -335,11 +335,11 @@ int snd_sof_run_firmware(struct snd_sof_dev *sdev)
|
|||||||
init_waitqueue_head(&sdev->boot_wait);
|
init_waitqueue_head(&sdev->boot_wait);
|
||||||
sdev->boot_complete = false;
|
sdev->boot_complete = false;
|
||||||
|
|
||||||
/* create fw_version debugfs to store boot version info */
|
/* create read-only fw_version debugfs to store boot version info */
|
||||||
if (sdev->first_boot) {
|
if (sdev->first_boot) {
|
||||||
ret = snd_sof_debugfs_buf_item(sdev, &sdev->fw_version,
|
ret = snd_sof_debugfs_buf_item(sdev, &sdev->fw_version,
|
||||||
sizeof(sdev->fw_version),
|
sizeof(sdev->fw_version),
|
||||||
"fw_version");
|
"fw_version", 0444);
|
||||||
/* errors are only due to memory allocation, not debugfs */
|
/* errors are only due to memory allocation, not debugfs */
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
dev_err(sdev->dev, "error: snd_sof_debugfs_buf_item failed\n");
|
dev_err(sdev->dev, "error: snd_sof_debugfs_buf_item failed\n");
|
||||||
|
@ -546,7 +546,7 @@ int snd_sof_debugfs_io_item(struct snd_sof_dev *sdev,
|
|||||||
enum sof_debugfs_access_type access_type);
|
enum sof_debugfs_access_type access_type);
|
||||||
int snd_sof_debugfs_buf_item(struct snd_sof_dev *sdev,
|
int snd_sof_debugfs_buf_item(struct snd_sof_dev *sdev,
|
||||||
void *base, size_t size,
|
void *base, size_t size,
|
||||||
const char *name);
|
const char *name, mode_t mode);
|
||||||
int snd_sof_trace_update_pos(struct snd_sof_dev *sdev,
|
int snd_sof_trace_update_pos(struct snd_sof_dev *sdev,
|
||||||
struct sof_ipc_dma_trace_posn *posn);
|
struct sof_ipc_dma_trace_posn *posn);
|
||||||
void snd_sof_trace_notify_for_error(struct snd_sof_dev *sdev);
|
void snd_sof_trace_notify_for_error(struct snd_sof_dev *sdev);
|
||||||
|
Loading…
Reference in New Issue
Block a user