mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-30 14:19:16 +00:00
of: device: Ignore modalias of reused nodes
If of_node is reused, do not use that node's modalias. This will hide the name of the actual device. This is rather prominent in USB glue drivers creating a platform device for the host controller. Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com> Reviewed-by: Rob Herring <robh@kernel.org> Link: https://lore.kernel.org/r/20230207110531.1060252-2-alexander.stein@ew.tq-group.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
8488a831e0
commit
553bd29700
1 changed files with 2 additions and 2 deletions
|
@ -256,7 +256,7 @@ static ssize_t of_device_get_modalias(struct device *dev, char *str, ssize_t len
|
|||
ssize_t csize;
|
||||
ssize_t tsize;
|
||||
|
||||
if ((!dev) || (!dev->of_node))
|
||||
if ((!dev) || (!dev->of_node) || dev->of_node_reused)
|
||||
return -ENODEV;
|
||||
|
||||
/* Name & Type */
|
||||
|
@ -376,7 +376,7 @@ int of_device_uevent_modalias(struct device *dev, struct kobj_uevent_env *env)
|
|||
{
|
||||
int sl;
|
||||
|
||||
if ((!dev) || (!dev->of_node))
|
||||
if ((!dev) || (!dev->of_node) || dev->of_node_reused)
|
||||
return -ENODEV;
|
||||
|
||||
/* Devicetree modalias is tricky, we add it in 2 steps */
|
||||
|
|
Loading…
Reference in a new issue