diff options
author | Soumya Negi <soumya.negi97@gmail.com> | 2023-10-19 18:55:23 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2023-10-21 12:02:36 +0200 |
commit | 3249888c1b8c9d9fdad9f818e7ac5d7646ff91a1 (patch) | |
tree | c866f678257457aba4044259c9e8864642c6f103 /drivers/staging | |
parent | c6054f43f782abcfc4ac887209c061a512bbab47 (diff) | |
download | linux-stable-3249888c1b8c9d9fdad9f818e7ac5d7646ff91a1.tar.gz linux-stable-3249888c1b8c9d9fdad9f818e7ac5d7646ff91a1.tar.bz2 linux-stable-3249888c1b8c9d9fdad9f818e7ac5d7646ff91a1.zip |
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@gmail.com>
Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Link: https://lore.kernel.org/r/221344ede933b1d9e6c31310b0f4dbb8be809c86.1697763267.git.soumya.negi97@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging')
-rw-r--r-- | drivers/staging/vme_user/vme.c | 10 | ||||
-rw-r--r-- | 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, |