[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <221344ede933b1d9e6c31310b0f4dbb8be809c86.1697763267.git.soumya.negi97@gmail.com>
Date: Thu, 19 Oct 2023 18:55:23 -0700
From: Soumya Negi <soumya.negi97@...il.com>
To: Martyn Welch <martyn@...chs.me.uk>,
Manohar Vanga <manohar.vanga@...il.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
julia.lawall@...ia.fr, Andi Shyti <andi.shyti@...nel.org>
Cc: outreachy@...ts.linux.dev, linux-kernel@...r.kernel.org,
linux-staging@...ts.linux.dev,
Soumya Negi <soumya.negi97@...il.com>
Subject: [PATCH v3 5/5] staging: vme_user: Use dev_err() in vme_check_window()
vme_check_window() uses printk() for logging error message. This
leads to the following checkpatch warning:
WARNING: Prefer [subsystem eg: netdev]_err([subsystem]dev, ... then
dev_err(dev, ... then pr_err(... to printk(KERN_ERR ...
Use dev_err() instead. Pass VME bridge device to vme_check_window() so
that the error message can be logged with the bridge device context.
Signed-off-by: Soumya Negi <soumya.negi97@...il.com>
Suggested-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
---
drivers/staging/vme_user/vme.c | 10 +++++-----
drivers/staging/vme_user/vme.h | 4 ++--
2 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/drivers/staging/vme_user/vme.c b/drivers/staging/vme_user/vme.c
index 661d1edfa26a..5c416c31ec57 100644
--- a/drivers/staging/vme_user/vme.c
+++ b/drivers/staging/vme_user/vme.c
@@ -160,8 +160,8 @@ size_t vme_get_size(struct vme_resource *resource)
}
EXPORT_SYMBOL(vme_get_size);
-int vme_check_window(u32 aspace, unsigned long long vme_base,
- unsigned long long size)
+int vme_check_window(struct vme_bridge *bridge, u32 aspace,
+ unsigned long long vme_base, unsigned long long size)
{
int retval = 0;
@@ -195,7 +195,7 @@ int vme_check_window(u32 aspace, unsigned long long vme_base,
/* User Defined */
break;
default:
- printk(KERN_ERR "Invalid address space\n");
+ dev_err(bridge->parent, "Invalid address space\n");
retval = -EINVAL;
break;
}
@@ -350,7 +350,7 @@ int vme_slave_set(struct vme_resource *resource, int enabled,
return -EINVAL;
}
- retval = vme_check_window(aspace, vme_base, size);
+ retval = vme_check_window(bridge, aspace, vme_base, size);
if (retval)
return retval;
@@ -552,7 +552,7 @@ int vme_master_set(struct vme_resource *resource, int enabled,
return -EINVAL;
}
- retval = vme_check_window(aspace, vme_base, size);
+ retval = vme_check_window(bridge, aspace, vme_base, size);
if (retval)
return retval;
diff --git a/drivers/staging/vme_user/vme.h b/drivers/staging/vme_user/vme.h
index fbcbd0204453..06504dccd5ff 100644
--- a/drivers/staging/vme_user/vme.h
+++ b/drivers/staging/vme_user/vme.h
@@ -133,8 +133,8 @@ void vme_free_consistent(struct vme_resource *, size_t, void *,
dma_addr_t);
size_t vme_get_size(struct vme_resource *);
-int vme_check_window(u32 aspace, unsigned long long vme_base,
- unsigned long long size);
+int vme_check_window(struct vme_bridge *bridge, u32 aspace,
+ unsigned long long vme_base, unsigned long long size);
struct vme_resource *vme_slave_request(struct vme_dev *, u32, u32);
int vme_slave_set(struct vme_resource *, int, unsigned long long,
--
2.42.0
Powered by blists - more mailing lists