Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 293671
b: refs/heads/master
c: b19c19a
h: refs/heads/master
i:
  293669: 92a8a83
  293667: 1963765
  293663: 23b5a6c
v: v3
  • Loading branch information
Rob Clark authored and Dave Airlie committed Mar 7, 2012
1 parent 248b5dc commit eeedd00
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 966e0cdd504657333415f43de6a219197511ebff
refs/heads/master: b19c19afa880105179b3c25e57b169c8fcda334c
12 changes: 10 additions & 2 deletions trunk/drivers/gpu/drm/drm_platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ static const char *drm_platform_get_name(struct drm_device *dev)

static int drm_platform_set_busid(struct drm_device *dev, struct drm_master *master)
{
int len, ret;
int len, ret, id;

master->unique_len = 13 + strlen(dev->platformdev->name);
master->unique_size = master->unique_len;
Expand All @@ -131,8 +131,16 @@ static int drm_platform_set_busid(struct drm_device *dev, struct drm_master *mas
if (master->unique == NULL)
return -ENOMEM;

id = dev->platformdev->id;

/* if only a single instance of the platform device, id will be
* set to -1.. use 0 instead to avoid a funny looking bus-id:
*/
if (id == -1)
id = 0;

len = snprintf(master->unique, master->unique_len,
"platform:%s:%02d", dev->platformdev->name, dev->platformdev->id);
"platform:%s:%02d", dev->platformdev->name, id);

if (len > master->unique_len) {
DRM_ERROR("Unique buffer overflowed\n");
Expand Down

0 comments on commit eeedd00

Please sign in to comment.