Commit d8d307e6 authored by Adrien Thierry's avatar Adrien Thierry Committed by Greg Kroah-Hartman

staging: vchiq_arm: add reference to vchiq device in vchiq_state

Add a reference to the vchiq device in the vchiq_state structure. This
allows the device structure to be passed around, which will be useful in
order to get rid of the global g_dev structure. This change will also
make it possible to use standard kernel logging macros instead of the
custom ones.
Tested-by: default avatarStefan Wahren <stefan.wahren@i2se.com>
Signed-off-by: default avatarAdrien Thierry <athierry@redhat.com>
Link: https://lore.kernel.org/r/20220518191126.60396-2-athierry@redhat.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent d2a4bc3d
......@@ -519,7 +519,7 @@ int vchiq_platform_init(struct platform_device *pdev, struct vchiq_state *state)
*(char **)&g_fragments_base[i * g_fragments_size] = NULL;
sema_init(&g_free_fragments_sema, MAX_FRAGMENTS);
err = vchiq_init_state(state, vchiq_slot_zero);
err = vchiq_init_state(state, vchiq_slot_zero, dev);
if (err)
return err;
......
......@@ -2142,7 +2142,7 @@ vchiq_init_slots(void *mem_base, int mem_size)
}
int
vchiq_init_state(struct vchiq_state *state, struct vchiq_slot_zero *slot_zero)
vchiq_init_state(struct vchiq_state *state, struct vchiq_slot_zero *slot_zero, struct device *dev)
{
struct vchiq_shared_state *local;
struct vchiq_shared_state *remote;
......@@ -2169,6 +2169,8 @@ vchiq_init_state(struct vchiq_state *state, struct vchiq_slot_zero *slot_zero)
memset(state, 0, sizeof(struct vchiq_state));
state->dev = dev;
/*
* initialize shared state pointers
*/
......
......@@ -314,6 +314,7 @@ struct vchiq_slot_zero {
};
struct vchiq_state {
struct device *dev;
int id;
int initialised;
enum vchiq_connstate conn_state;
......@@ -457,7 +458,7 @@ extern struct vchiq_slot_zero *
vchiq_init_slots(void *mem_base, int mem_size);
extern int
vchiq_init_state(struct vchiq_state *state, struct vchiq_slot_zero *slot_zero);
vchiq_init_state(struct vchiq_state *state, struct vchiq_slot_zero *slot_zero, struct device *dev);
extern enum vchiq_status
vchiq_connect_internal(struct vchiq_state *state, struct vchiq_instance *instance);
......
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