Skip to content
This repository was archived by the owner on Nov 8, 2023. It is now read-only.

Commit 12529aa

Browse files
committed
Merge tag 'staging-6.10-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging
Pull staging driver fixes from Greg KH: "Here are two small staging driver fixes for 6.10-rc6, both for the vc04_services drivers: - build fix if CONFIG_DEBUGFS was not set - initialization check fix that was much reported. Both of these have been in linux-next this week with no reported issues" * tag 'staging-6.10-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: staging: vchiq_debugfs: Fix build if CONFIG_DEBUG_FS is not set staging: vc04_services: vchiq_arm: Fix initialisation check
2 parents 3e33448 + fcdd7b7 commit 12529aa

File tree

4 files changed

+14
-4
lines changed

4 files changed

+14
-4
lines changed

drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -707,7 +707,7 @@ int vchiq_initialise(struct vchiq_state *state, struct vchiq_instance **instance
707707
* block forever.
708708
*/
709709
for (i = 0; i < VCHIQ_INIT_RETRIES; i++) {
710-
if (state)
710+
if (vchiq_remote_initialised(state))
711711
break;
712712
usleep_range(500, 600);
713713
}
@@ -1202,7 +1202,7 @@ void vchiq_dump_platform_instances(struct vchiq_state *state, struct seq_file *f
12021202
{
12031203
int i;
12041204

1205-
if (!state)
1205+
if (!vchiq_remote_initialised(state))
12061206
return;
12071207

12081208
/*

drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -413,6 +413,11 @@ struct vchiq_state {
413413
struct opaque_platform_state *platform_state;
414414
};
415415

416+
static inline bool vchiq_remote_initialised(const struct vchiq_state *state)
417+
{
418+
return state->remote && state->remote->initialised;
419+
}
420+
416421
struct bulk_waiter {
417422
struct vchiq_bulk *bulk;
418423
struct completion event;

drivers/staging/vc04_services/interface/vchiq_arm/vchiq_debugfs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ void vchiq_debugfs_deinit(void)
138138

139139
#else /* CONFIG_DEBUG_FS */
140140

141-
void vchiq_debugfs_init(void)
141+
void vchiq_debugfs_init(struct vchiq_state *state)
142142
{
143143
}
144144

drivers/staging/vc04_services/interface/vchiq_arm/vchiq_dev.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1170,6 +1170,11 @@ static int vchiq_open(struct inode *inode, struct file *file)
11701170

11711171
dev_dbg(state->dev, "arm: vchiq open\n");
11721172

1173+
if (!vchiq_remote_initialised(state)) {
1174+
dev_dbg(state->dev, "arm: vchiq has no connection to VideoCore\n");
1175+
return -ENOTCONN;
1176+
}
1177+
11731178
instance = kzalloc(sizeof(*instance), GFP_KERNEL);
11741179
if (!instance)
11751180
return -ENOMEM;
@@ -1200,7 +1205,7 @@ static int vchiq_release(struct inode *inode, struct file *file)
12001205

12011206
dev_dbg(state->dev, "arm: instance=%p\n", instance);
12021207

1203-
if (!state) {
1208+
if (!vchiq_remote_initialised(state)) {
12041209
ret = -EPERM;
12051210
goto out;
12061211
}

0 commit comments

Comments
 (0)