Skip to content

Commit d50daa2

Browse files
anderssongregkh
authored andcommitted
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. Tested-by: Rob Clark <[email protected]> Reported-by: Rob Clark <[email protected]> Reviewed-by: Stephen Boyd <[email protected]> Signed-off-by: Bjorn Andersson <[email protected]> Cc: stable <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 00b40d6 commit d50daa2

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
@@ -365,11 +365,23 @@ static int spmi_drv_remove(struct device *dev)
365365
return 0;
366366
}
367367

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

375387
/**

0 commit comments

Comments
 (0)