1
0
Fork 0

spmi: Include OF based modalias in device uevent

commit d50daa2af2 upstream.

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.

Tested-by: Rob Clark <robdclark@gmail.com>
Reported-by: Rob Clark <robdclark@gmail.com>
Reviewed-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
steinar/wifi_calib_4_9_kernel
Bjorn Andersson 2017-06-29 14:46:44 -07:00 committed by Greg Kroah-Hartman
parent a18935b45e
commit 1c7e5ca092
1 changed files with 12 additions and 0 deletions

View File

@ -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,
};
/**