@@ -19,6 +19,7 @@ struct nvkm_client {
int nvkm_client_new(const char *name, struct nvkm_device *, int (*event)(u64, void *, u32),
const struct nvif_client_impl **, struct nvif_client_priv **);
+int nvkm_client_event(struct nvkm_client *client, u64 token, void *repv, u32 repc);
/* logging for client-facing objects */
#define nvif_printk(o,l,p,f,a...) do { \
@@ -31,6 +31,12 @@
#include <nvif/event.h>
#include <nvif/unpack.h>
+int
+nvkm_client_event(struct nvkm_client *client, u64 token, void *repv, u32 repc)
+{
+ return client->event(token, repv, repc);
+}
+
static int
nvkm_client_new_device(struct nvif_client_priv *client,
const struct nvif_device_impl **pimpl, struct nvif_device_priv **ppriv)
@@ -111,7 +111,7 @@ nvkm_uevent_ntfy(struct nvkm_event_ntfy *ntfy, u32 bits)
if (uevent->func)
return uevent->func(uevent->parent, uevent->object.object, bits);
- return client->event(uevent->object.object, NULL, 0);
+ return nvkm_client_event(client, uevent->object.object, NULL, 0);
}
int
@@ -50,7 +50,7 @@ nvkm_uconn_uevent_gsp(struct nvkm_object *object, u64 token, u32 bits)
if (bits & NVKM_DPYID_IRQ)
args.v0.types |= NVIF_CONN_EVENT_V0_IRQ;
- return object->client->event(token, &args, sizeof(args.v0));
+ return nvkm_client_event(object->client, token, &args, sizeof(args.v0));
}
static int
@@ -67,7 +67,7 @@ nvkm_uconn_uevent_aux(struct nvkm_object *object, u64 token, u32 bits)
if (bits & NVKM_I2C_IRQ)
args.v0.types |= NVIF_CONN_EVENT_V0_IRQ;
- return object->client->event(token, &args, sizeof(args.v0));
+ return nvkm_client_event(object->client, token, &args, sizeof(args.v0));
}
static int
@@ -82,7 +82,7 @@ nvkm_uconn_uevent_gpio(struct nvkm_object *object, u64 token, u32 bits)
if (bits & NVKM_GPIO_LO)
args.v0.types |= NVIF_CONN_EVENT_V0_UNPLUG;
- return object->client->event(token, &args, sizeof(args.v0));
+ return nvkm_client_event(object->client, token, &args, sizeof(args.v0));
}
static bool
A later patch in this series moves the nvif_event callback function, but all the callers directly dereference object->client->event(). Add a helper function so this only has to be changed in one place. Signed-off-by: Ben Skeggs <bskeggs@nvidia.com> --- drivers/gpu/drm/nouveau/include/nvkm/core/client.h | 1 + drivers/gpu/drm/nouveau/nvkm/core/client.c | 6 ++++++ drivers/gpu/drm/nouveau/nvkm/core/uevent.c | 2 +- drivers/gpu/drm/nouveau/nvkm/engine/disp/uconn.c | 6 +++--- 4 files changed, 11 insertions(+), 4 deletions(-)