Commit 22779149 authored by Sudeep Holla's avatar Sudeep Holla

firmware: arm_ffa: Emit modalias for FF-A devices

In order to enable libkmod lookups for FF-A device objects to their
corresponding module, add 'modalias' to the base attribute of FF-A
devices.
Tested-by: default avatarAbdellatif El Khlifi <abdellatif.elkhlifi@arm.com>
Link: https://lore.kernel.org/r/20231005175640.379631-1-sudeep.holla@arm.comSigned-off-by: default avatarSudeep Holla <sudeep.holla@arm.com>
parent 2d698e8b
...@@ -15,6 +15,8 @@ ...@@ -15,6 +15,8 @@
#include "common.h" #include "common.h"
#define SCMI_UEVENT_MODALIAS_FMT "arm_ffa:%04x:%pUb"
static DEFINE_IDA(ffa_bus_id); static DEFINE_IDA(ffa_bus_id);
static int ffa_device_match(struct device *dev, struct device_driver *drv) static int ffa_device_match(struct device *dev, struct device_driver *drv)
...@@ -63,10 +65,20 @@ static int ffa_device_uevent(const struct device *dev, struct kobj_uevent_env *e ...@@ -63,10 +65,20 @@ static int ffa_device_uevent(const struct device *dev, struct kobj_uevent_env *e
{ {
const struct ffa_device *ffa_dev = to_ffa_dev(dev); const struct ffa_device *ffa_dev = to_ffa_dev(dev);
return add_uevent_var(env, "MODALIAS=arm_ffa:%04x:%pUb", return add_uevent_var(env, "MODALIAS=" SCMI_UEVENT_MODALIAS_FMT,
ffa_dev->vm_id, &ffa_dev->uuid); ffa_dev->vm_id, &ffa_dev->uuid);
} }
static ssize_t modalias_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
struct ffa_device *ffa_dev = to_ffa_dev(dev);
return sysfs_emit(buf, SCMI_UEVENT_MODALIAS_FMT, ffa_dev->vm_id,
&ffa_dev->uuid);
}
static DEVICE_ATTR_RO(modalias);
static ssize_t partition_id_show(struct device *dev, static ssize_t partition_id_show(struct device *dev,
struct device_attribute *attr, char *buf) struct device_attribute *attr, char *buf)
{ {
...@@ -88,6 +100,7 @@ static DEVICE_ATTR_RO(uuid); ...@@ -88,6 +100,7 @@ static DEVICE_ATTR_RO(uuid);
static struct attribute *ffa_device_attributes_attrs[] = { static struct attribute *ffa_device_attributes_attrs[] = {
&dev_attr_partition_id.attr, &dev_attr_partition_id.attr,
&dev_attr_uuid.attr, &dev_attr_uuid.attr,
&dev_attr_modalias.attr,
NULL, NULL,
}; };
ATTRIBUTE_GROUPS(ffa_device_attributes); ATTRIBUTE_GROUPS(ffa_device_attributes);
......
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