Skip to contentSkip to conversation

driver core patches for 2.6.31-rc4-git

PATCH New Greg KH 1 participant 6 messages Jul 28, 2009

Subsystems (4)
lore
Share & tools
lore

Greg KH

author
#0 lore raw

PATCH 1/1 driver core patches for 2.6.31-rc4-git

Here are some driver core patches for your tree.

Just some tiny bugfixes and a documentation fix.

Please pull from:
master.kernel.org:/pub/scm/linux/kernel/git/gregkh/driver-core-2.6.git/

All of these patches have been in the linux-next and mm trees for a while.

The patches will be sent as a follow-on to this message to lkml for people to see.

thanks,

greg k-h

------------

 Documentation/filesystems/sysfs.txt |    3 ++-
 drivers/base/firmware_class.c       |    1 -
 drivers/base/sys.c                  |    2 +-
 fs/sysfs/dir.c                      |    2 ++
 lib/dynamic_debug.c                 |    2 +-
 5 files changed, 6 insertions(+), 4 deletions(-)

---------------

Lucian Adrian Grijincu (1):
driver core: documentation: make it clear that sysfs is optional

Ming Lei (1):
driver core: firmware_class:fix memory leak of page pointers array

Peter Oberparleiter (1):
sysfs: fix hardlink count on device_move

Roel Kluin (1):

      Dynamic debug: fix typo: -/->

Xiaotian Feng (1):
driver core: sysdev: do not send KOBJ_ADD uevent if kobject_init_and_add fails

#1 lore raw

PATCH 1/5 sysfs: fix hardlink count on device_move

From: Peter Oberparleiter <[email protected]>

Update directory hardlink count when moving kobjects to a new parent. Fixes the following problem which occurs when several devices are moved to the same parent and then unregistered:

Quoted 6 lines

ls -laF /sys/devices/css0/defunct/
total 0

drwxr-xr-x 4294967295 root root    0 2009-07-14 17:02 ./
drwxr-xr-x        114 root root    0 2009-07-14 17:02 ../
drwxr-xr-x          2 root root    0 2009-07-14 17:01 power/

-rw-r--r-- 1 root root 4096 2009-07-14 17:01 uevent

---
 fs/sysfs/dir.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
fs/sysfs/dir.c +2 -0
index d88d0fa..14f2d71 100644
@@ -939,8 +939,10 @@ again:
 	/* Remove from old parent's list and insert into new parent's list. */
 	sysfs_unlink_sibling(sd);
 	sysfs_get(new_parent_sd);
+	drop_nlink(old_parent->d_inode);
 	sysfs_put(sd->s_parent);
 	sd->s_parent = new_parent_sd;
+	inc_nlink(new_parent->d_inode);
 	sysfs_link_sibling(sd);
 
  out_unlock:
Signature · 1 line
1.6.3.2
#2 lore raw

PATCH 2/5 driver core: firmware_class:fix memory leak of page pointers array

In reply to Greg KH

From: Ming Lei <[email protected]>

The page pointers array is allocated in fw_realloc_buffer() called by firmware_data_write(), and should be freed in release function of firmware device.

---
 drivers/base/firmware_class.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)
drivers/base/firmware_class.c +0 -1
index f285f44..7376367 100644
@@ -180,7 +180,6 @@ static ssize_t firmware_loading_store(struct device *dev,
 				goto err;
 			}
 			/* Pages will be freed by vfree() */
-			fw_priv->pages = NULL;
 			fw_priv->page_array_size = 0;
 			fw_priv->nr_pages = 0;
 			complete(&fw_priv->completion);
Signature · 1 line
1.6.3.2
#3 lore raw

PATCH 3/5 Dynamic debug: fix typo: -/->

In reply to Greg KH

From: Roel Kluin <[email protected]>

The member was intended, not the local variable.

---
 lib/dynamic_debug.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
lib/dynamic_debug.c +1 -1
index 833139c..e22c148 100644
@@ -164,7 +164,7 @@ static void ddebug_change(const struct ddebug_query *query,
 
 			if (!newflags)
 				dt->num_enabled--;
-			else if (!dp-flags)
+			else if (!dp->flags)
 				dt->num_enabled++;
 			dp->flags = newflags;
 			if (newflags) {
Signature · 1 line
1.6.3.2
#4 lore raw

PATCH 4/5 driver core: sysdev: do not send KOBJ_ADD uevent if kobject_init_and_add fails

In reply to Greg KH

From: Xiaotian Feng <[email protected]>

If kobject_init_and_add fails, sysdev_register should not send KOBJ_ADD uevent to userspace.

---
 drivers/base/sys.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/base/sys.c +1 -1
index 79a9ae5..0d90390 100644
@@ -275,9 +275,9 @@ int sysdev_register(struct sys_device *sysdev)
 				drv->add(sysdev);
 		}
 		mutex_unlock(&sysdev_drivers_lock);
+		kobject_uevent(&sysdev->kobj, KOBJ_ADD);
 	}
 
-	kobject_uevent(&sysdev->kobj, KOBJ_ADD);
 	return error;
 }
 
Signature · 1 line
1.6.3.2
#5 lore raw

PATCH 5/5 driver core: documentation: make it clear that sysfs is optional

In reply to Greg KH

From: Lucian Adrian Grijincu <[email protected]>

The original text suggested that sysfs is mandatory and always compiled in the kernel.

---
 Documentation/filesystems/sysfs.txt |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
Documentation/filesystems/sysfs.txt +2 -1
index 7e81e37..b245d52 100644
@@ -23,7 +23,8 @@ interface.
 Using sysfs
 ~~~~~~~~~~~
 
-sysfs is always compiled in. You can access it by doing:
+sysfs is always compiled in if CONFIG_SYSFS is defined. You can access
+it by doing:
 
     mount -t sysfs sysfs /sys 
 
Signature · 1 line
1.6.3.2