Skip to contentSkip to conversation

nouveau: Set i2c adapter parent device

PATCH In review Matthew Garrett 2 participants 2 messages Nov 17, 2009 1 message not in the archive

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nouveau: Set i2c adapter parent device

The parent device of the i2c adapter should be set to the appropriate PCI device in order for it to show up properly in sysfs.

---
 drivers/gpu/drm/nouveau/nouveau_i2c.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
drivers/gpu/drm/nouveau/nouveau_i2c.c +1 -0
index 3f219dd..cca2b6c 100644
@@ -176,6 +176,7 @@ nouveau_i2c_init(struct drm_device *dev, struct dcb_i2c_entry *entry, int index)
 		 "nouveau-%s-%d", pci_name(dev->pdev), index);
 	i2c->adapter.owner = THIS_MODULE;
 	i2c->adapter.algo_data = &i2c->algo;
+	i2c->adapter.dev.parent = &dev->pdev->dev;
 	i2c->dev = dev;
 
 	switch (entry->port_type) {
Signature · 1 line
1.6.5.2

A message that is not in the archive (sent off-list or not yet received): 1258498601-2474-1-git-send-email-mjg-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org

#2 lore raw
Quoted 4 lines · Matthew Garrett

The parent device of the i2c adapter should be set to the appropriate PCI device in order for it to show up properly in sysfs.

Applied :)

Quoted 16 lines
---
 drivers/gpu/drm/nouveau/nouveau_i2c.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
drivers/gpu/drm/nouveau/nouveau_i2c.c +1 -0
index 3f219dd..cca2b6c 100644
@@ -176,6 +176,7 @@ nouveau_i2c_init(struct drm_device *dev, struct dcb_i2c_entry *entry, int index)
 		 "nouveau-%s-%d", pci_name(dev->pdev), index);
 	i2c->adapter.owner = THIS_MODULE;
 	i2c->adapter.algo_data = &i2c->algo;
+	i2c->adapter.dev.parent = &dev->pdev->dev;
 	i2c->dev = dev;
 
 	switch (entry->port_type) {