Skip to content

Commit 6dbd8f7

Browse files
anderssongregkh
authored andcommitted
spmi: Include OF based modalias in device uevent
commit d50daa2af2618dab6d21634e65a5fbcf4ae437d6 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>
1 parent 29669d8 commit 6dbd8f7

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

drivers/spmi/spmi.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -364,11 +364,23 @@ static int spmi_drv_remove(struct device *dev)
364364
return 0;
365365
}
366366

367+
static int spmi_drv_uevent(struct device *dev, struct kobj_uevent_env *env)
368+
{
369+
int ret;
370+
371+
ret = of_device_uevent_modalias(dev, env);
372+
if (ret != -ENODEV)
373+
return ret;
374+
375+
return 0;
376+
}
377+
367378
static struct bus_type spmi_bus_type = {
368379
.name = "spmi",
369380
.match = spmi_device_match,
370381
.probe = spmi_drv_probe,
371382
.remove = spmi_drv_remove,
383+
.uevent = spmi_drv_uevent,
372384
};
373385

374386
/**

0 commit comments

Comments
 (0)