summaryrefslogtreecommitdiffstats
path: root/drivers/firmware/arm_scmi/bus.c
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2022-11-09 18:28:15 +0100
committerPaolo Bonzini <pbonzini@redhat.com>2022-11-09 18:28:15 +0100
commitd72cf8ffe460824fdc97f0a9295a2c4e0231a562 (patch)
tree1cf0d952f5066191eb9700aae882905e8546264c /drivers/firmware/arm_scmi/bus.c
parentKVM: x86/pmu: Limit the maximum number of supported AMD GP counters (diff)
parentKVM: s390: pci: Fix allocation size of aift kzdev elements (diff)
downloadlinux-d72cf8ffe460824fdc97f0a9295a2c4e0231a562.tar.xz
linux-d72cf8ffe460824fdc97f0a9295a2c4e0231a562.zip
Merge tag 'kvm-s390-master-6.1-1' of https://git.kernel.org/pub/scm/linux/kernel/git/kvms390/linux into HEAD
A PCI allocation fix and a PV clock fix.
Diffstat (limited to 'drivers/firmware/arm_scmi/bus.c')
-rw-r--r--drivers/firmware/arm_scmi/bus.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/firmware/arm_scmi/bus.c b/drivers/firmware/arm_scmi/bus.c
index d4e23101448a..35bb70724d44 100644
--- a/drivers/firmware/arm_scmi/bus.c
+++ b/drivers/firmware/arm_scmi/bus.c
@@ -216,9 +216,20 @@ void scmi_device_destroy(struct scmi_device *scmi_dev)
device_unregister(&scmi_dev->dev);
}
+void scmi_device_link_add(struct device *consumer, struct device *supplier)
+{
+ struct device_link *link;
+
+ link = device_link_add(consumer, supplier, DL_FLAG_AUTOREMOVE_CONSUMER);
+
+ WARN_ON(!link);
+}
+
void scmi_set_handle(struct scmi_device *scmi_dev)
{
scmi_dev->handle = scmi_handle_get(&scmi_dev->dev);
+ if (scmi_dev->handle)
+ scmi_device_link_add(&scmi_dev->dev, scmi_dev->handle->dev);
}
int scmi_protocol_register(const struct scmi_protocol *proto)