Skip to content

Commit

Permalink
spmi: Include OF based modalias in device uevent
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
andersson authored and gregkh committed Jul 17, 2017
1 parent 00b40d6 commit d50daa2
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions drivers/spmi/spmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};

/**
Expand Down

0 comments on commit d50daa2

Please sign in to comment.