Skip to content

Commit

Permalink
spmi: Use more appropriate name for SPMI devices
Browse files Browse the repository at this point in the history
  • Loading branch information
kholk committed Jan 17, 2015
1 parent 731cc51 commit d956d88
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion drivers/spmi/spmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,10 @@ int spmi_add_device(struct spmi_device *spmidev)
}

/* Set the device name */
dev_set_name(dev, "%s-%p", spmidev->name, spmidev);
if (spmidev->res.resource)
dev_set_name(dev, "%02x-%s-%04x", spmidev->sid, spmidev->dev.of_node->name, spmidev->res.resource[0].start);
else
dev_set_name(dev, "%02x-%s", spmidev->sid, spmidev->dev.of_node->name);

/* Device may be bound to an active driver when this returns */
rc = device_add(dev);
Expand Down

0 comments on commit d956d88

Please sign in to comment.