lkml.org 
[lkml]   [2021]   [Jun]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v4 11/16] firmware: arm_scmi: Add is_scmi_protocol_device()
Date
From: Peter Hilber <peter.hilber@opensynergy.com>

The scmi-virtio transport driver will need to distinguish SCMI protocol
devices from the SCMI instance device in the chan_setup() and
chan_free() ops. Add this internal helper to be able to distinguish the
two.

Signed-off-by: Peter Hilber <peter.hilber@opensynergy.com>
---
drivers/firmware/arm_scmi/bus.c | 5 +++++
drivers/firmware/arm_scmi/common.h | 2 ++
2 files changed, 7 insertions(+)

diff --git a/drivers/firmware/arm_scmi/bus.c b/drivers/firmware/arm_scmi/bus.c
index 784cf0027da3..06148e972d1a 100644
--- a/drivers/firmware/arm_scmi/bus.c
+++ b/drivers/firmware/arm_scmi/bus.c
@@ -134,6 +134,11 @@ static struct bus_type scmi_bus_type = {
.remove = scmi_dev_remove,
};

+bool is_scmi_protocol_device(struct device *dev)
+{
+ return dev->bus == &scmi_bus_type;
+}
+
int scmi_driver_register(struct scmi_driver *driver, struct module *owner,
const char *mod_name)
{
diff --git a/drivers/firmware/arm_scmi/common.h b/drivers/firmware/arm_scmi/common.h
index 7219970fc5eb..b783ae058c8a 100644
--- a/drivers/firmware/arm_scmi/common.h
+++ b/drivers/firmware/arm_scmi/common.h
@@ -264,6 +264,8 @@ struct scmi_protocol {
const struct scmi_protocol_events *events;
};

+bool is_scmi_protocol_device(struct device *dev);
+
int __init scmi_bus_init(void);
void __exit scmi_bus_exit(void);

--
2.17.1
\
 
 \ /
  Last update: 2021-06-11 19:01    [W:0.237 / U:0.456 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site