Commit 8a0590bf authored by Mark Brown's avatar Mark Brown Committed by Jiri Slaby

ASoC: imx-audmux: Use uintptr_t for port numbers

commit e5f89768 upstream.

Since we pass the port number through file private data for debugfs we cast
it to and from a pointer so use uintptr_t in order to ensure that the
types are compatible, avoiding warnings on 64 bit platforms where pointers
are 64 bit and unsigned integers 32 bit.
Signed-off-by: default avatarMark Brown <broonie@linaro.org>
Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
parent 12c55b60
...@@ -67,7 +67,7 @@ static ssize_t audmux_read_file(struct file *file, char __user *user_buf, ...@@ -67,7 +67,7 @@ static ssize_t audmux_read_file(struct file *file, char __user *user_buf,
{ {
ssize_t ret; ssize_t ret;
char *buf = kmalloc(PAGE_SIZE, GFP_KERNEL); char *buf = kmalloc(PAGE_SIZE, GFP_KERNEL);
int port = (int)file->private_data; uintptr_t port = (uintptr_t)file->private_data;
u32 pdcr, ptcr; u32 pdcr, ptcr;
if (!buf) if (!buf)
...@@ -146,7 +146,7 @@ static const struct file_operations audmux_debugfs_fops = { ...@@ -146,7 +146,7 @@ static const struct file_operations audmux_debugfs_fops = {
static void __init audmux_debugfs_init(void) static void __init audmux_debugfs_init(void)
{ {
int i; uintptr_t i;
char buf[20]; char buf[20];
audmux_debugfs_root = debugfs_create_dir("audmux", NULL); audmux_debugfs_root = debugfs_create_dir("audmux", NULL);
...@@ -156,10 +156,10 @@ static void __init audmux_debugfs_init(void) ...@@ -156,10 +156,10 @@ static void __init audmux_debugfs_init(void)
} }
for (i = 0; i < MX31_AUDMUX_PORT7_SSI_PINS_7 + 1; i++) { for (i = 0; i < MX31_AUDMUX_PORT7_SSI_PINS_7 + 1; i++) {
snprintf(buf, sizeof(buf), "ssi%d", i); snprintf(buf, sizeof(buf), "ssi%lu", i);
if (!debugfs_create_file(buf, 0444, audmux_debugfs_root, if (!debugfs_create_file(buf, 0444, audmux_debugfs_root,
(void *)i, &audmux_debugfs_fops)) (void *)i, &audmux_debugfs_fops))
pr_warning("Failed to create AUDMUX port %d debugfs file\n", pr_warning("Failed to create AUDMUX port %lu debugfs file\n",
i); i);
} }
} }
......
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