spmi: Include OF based modalias in device uevent
Subsystems (2)
PATCH 1/1 spmi: Include OF based modalias in device uevent
Include the OF-based modalias in the uevent sent when registering SPMI devices, so that user space has a chance to autoload the kernel module for the device.
---
Based on the MODULE_ALIAS in the qcom-spmi-pmic it's likely that the original author expected that the spmi-pmic-arb would create devices by the identifier "pmic" and the spmi code would include a MODALIAS="spmi:pmic" in the uevent.
drivers/spmi/spmi.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)
drivers/spmi/spmi.c +12 -0
@@ -365,11 +365,23 @@ static int spmi_drv_remove(struct device *dev)return 0 ; } +static int spmi_drv_uevent (struct device *dev,struct kobj_uevent_env *env) +{ +int ret; + + ret =of_device_uevent_modalias (dev, env); +if (ret != -ENODEV ) +return ret; + +return 0 ; +} +static struct bus_type spmi_bus_type = { .name ="spmi" , .match = spmi_device_match, .probe = spmi_drv_probe, .remove = spmi_drv_remove, + .uevent = spmi_drv_uevent, };/**
Signature · 1 line
2.12.0
Quoted 6 lines · Bjorn Andersson
Include the OF-based modalias in the uevent sent when registering SPMI devices, so that user space has a chance to autoload the kernel module for the device.
Reported-by Rob Clark <[email protected]>Signed-off-by Bjorn Andersson <[email protected]>
Quoted 40 lines
---
Based on the
MODULE_ALIASin the qcom-spmi-pmic it's likely that the original author expected that the spmi-pmic-arb would create devices by the identifier "pmic" and the spmi code would include a MODALIAS="spmi:pmic" in the uevent.drivers/spmi/spmi.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)drivers/spmi/spmi.c +12
-1@@ -365,11 +365,23 @@ static int spmi_drv_remove(struct device *dev)return 0 ; } +static int spmi_drv_uevent (struct device *dev,struct kobj_uevent_env *env) +{ +int ret; + + ret =of_device_uevent_modalias (dev, env); +if (ret != -ENODEV ) +return ret; + +return 0 ; +} +static struct bus_type spmi_bus_type = { .name ="spmi" , .match = spmi_device_match, .probe = spmi_drv_probe, .remove = spmi_drv_remove, + .uevent = spmi_drv_uevent, };/** -- 2.12.0
Quoted 7 lines · Bjorn Andersson
Include the OF-based modalias in the uevent sent when registering SPMI devices, so that user space has a chance to autoload the kernel module for the device.
Reported-by Rob Clark <[email protected]>Signed-off-by Bjorn Andersson <[email protected]>---
I suppose we can delete the MODALIAS in the qcom-spmi-pmic file too? That doesn't look like it could ever work
Signature · 2 lines
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project
Quoted 5 lines · Stephen Boyd
Quoted 4 lines · Bjorn Andersson
Include the OF-based modalias in the uevent sent when registering SPMI devices, so that user space has a chance to autoload the kernel module for the device.
Quoted 9 lines
Quoted 3 lines
Reported-by Rob Clark <[email protected]>Signed-off-by Bjorn Andersson <[email protected]>---
Reviewed-by Stephen Boyd <[email protected]>I suppose we can delete the MODALIAS in the qcom-spmi-pmic file too? That doesn't look like it could ever work
Right, it has never worked. Potentially we would like some SPMI based modalias thing, but I'm not sure we have enough information about the found device to create a meaningful alias.
Regards,
Bjorn