summaryrefslogtreecommitdiff
path: root/udev_remove.c
diff options
context:
space:
mode:
authorKay Sievers <kay.sievers@suse.de>2006-01-09 21:18:00 +0100
committerKay Sievers <kay.sievers@suse.de>2006-01-09 21:18:00 +0100
commit1aa1e24848903d11780db1ade355be73ad61a937 (patch)
treefb15c937a1a6e9f0197c905cc7af6ee5df8b108c /udev_remove.c
parent47fbf3c58260e3fed1078061f8d45e01b0e120f0 (diff)
replace libsysfs
We never used any of the libsysfs convenience features. Here we replace it completely with 300 lines of code, which are much simpler and a bit faster cause udev(d) does not open any syfs file for a simple event which does not need any parent device information. Signed-off-by: Kay Sievers <kay.sievers@suse.de>
Diffstat (limited to 'udev_remove.c')
-rw-r--r--udev_remove.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/udev_remove.c b/udev_remove.c
index f9592b4c70..945618ce5a 100644
--- a/udev_remove.c
+++ b/udev_remove.c
@@ -28,11 +28,7 @@
#include <errno.h>
#include <sys/stat.h>
-#include "udev_libc_wrapper.h"
#include "udev.h"
-#include "udev_utils.h"
-#include "udev_version.h"
-#include "logging.h"
static int delete_node(struct udevice *udev)
{
@@ -112,10 +108,10 @@ static int delete_node(struct udevice *udev)
*/
int udev_remove_device(struct udevice *udev)
{
- if (udev->type != DEV_BLOCK && udev->type != DEV_CLASS)
+ if (major(udev->devt) == 0)
return 0;
- if (udev_db_get_device(udev, udev->devpath) == 0) {
+ if (udev_db_get_device(udev, udev->dev->devpath) == 0) {
if (udev->ignore_remove) {
dbg("remove event for '%s' requested to be ignored by rule", udev->name);
return 0;
@@ -123,8 +119,8 @@ int udev_remove_device(struct udevice *udev)
dbg("remove name='%s'", udev->name);
udev_db_delete_device(udev);
} else {
- dbg("'%s' not found in database, using kernel name '%s'", udev->devpath, udev->kernel_name);
- strlcpy(udev->name, udev->kernel_name, sizeof(udev->name));
+ dbg("'%s' not found in database, using kernel name '%s'", udev->dev->devpath, udev->dev->kernel_name);
+ strlcpy(udev->name, udev->dev->kernel_name, sizeof(udev->name));
}
return delete_node(udev);