Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 621a5f7a authored by Viresh Kumar's avatar Viresh Kumar Committed by Greg Kroah-Hartman
Browse files

debugfs: Pass bool pointer to debugfs_create_bool()



Its a bit odd that debugfs_create_bool() takes 'u32 *' as an argument,
when all it needs is a boolean pointer.

It would be better to update this API to make it accept 'bool *'
instead, as that will make it more consistent and often more convenient.
Over that bool takes just a byte.

That required updates to all user sites as well, in the same commit
updating the API. regmap core was also using
debugfs_{read|write}_file_bool(), directly and variable types were
updated for that to be bool as well.

Signed-off-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
Acked-by: default avatarMark Brown <broonie@kernel.org>
Acked-by: default avatarCharles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 6e58f752
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -105,7 +105,7 @@ a variable of type size_t.
Boolean values can be placed in debugfs with:

    struct dentry *debugfs_create_bool(const char *name, umode_t mode,
				       struct dentry *parent, u32 *value);
				       struct dentry *parent, bool *value);

A read on the resulting file will yield either Y (for non-zero values) or
N, followed by a newline.  If written to, it will accept either upper- or
+2 −2
Original line number Diff line number Diff line
@@ -58,7 +58,7 @@ static u32 mdscr_read(void)
 * Allow root to disable self-hosted debug from userspace.
 * This is useful if you want to connect an external JTAG debugger.
 */
static u32 debug_enabled = 1;
static bool debug_enabled = true;

static int create_debug_debugfs_entry(void)
{
@@ -69,7 +69,7 @@ fs_initcall(create_debug_debugfs_entry);

static int __init early_debug_disable(char *buf)
{
	debug_enabled = 0;
	debug_enabled = false;
	return 0;
}

+1 −1
Original line number Diff line number Diff line
@@ -138,7 +138,7 @@ struct acpi_ec {
	unsigned long gpe;
	unsigned long command_addr;
	unsigned long data_addr;
	u32 global_lock;
	bool global_lock;
	unsigned long flags;
	unsigned long reference_count;
	struct mutex mutex;
+3 −3
Original line number Diff line number Diff line
@@ -122,9 +122,9 @@ struct regmap {
	unsigned int num_reg_defaults_raw;

	/* if set, only the cache is modified not the HW */
	u32 cache_only;
	bool cache_only;
	/* if set, only the HW is modified not the cache */
	u32 cache_bypass;
	bool cache_bypass;
	/* if set, remember to free reg_defaults_raw */
	bool cache_free;

@@ -132,7 +132,7 @@ struct regmap {
	const void *reg_defaults_raw;
	void *cache;
	/* if set, the cache contains newer data than the HW */
	u32 cache_dirty;
	bool cache_dirty;
	/* if set, the HW registers are known to match map->reg_defaults */
	bool no_sync_defaults;

+2 −2
Original line number Diff line number Diff line
@@ -355,9 +355,9 @@ static int regcache_lzo_sync(struct regmap *map, unsigned int min,
		if (ret > 0 && val == map->reg_defaults[ret].def)
			continue;

		map->cache_bypass = 1;
		map->cache_bypass = true;
		ret = _regmap_write(map, i, val);
		map->cache_bypass = 0;
		map->cache_bypass = false;
		if (ret)
			return ret;
		dev_dbg(map->dev, "Synced register %#x, value %#x\n",
Loading