From: Greg KH <greg@kroah.com>
To: linux-usb-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org
Subject: Re: [BK PATCH] USB changes for 2.5.39
Date: Mon, 30 Sep 2002 17:34:01 -0700 [thread overview]
Message-ID: <20021001003401.GD3994@kroah.com> (raw)
In-Reply-To: <20021001003304.GC3994@kroah.com>
# This is a BitKeeper generated patch for the following project:
# Project Name: Linux kernel tree
# This patch format is intended for GNU patch command version 2.5 or higher.
# This patch includes the following deltas:
# ChangeSet 1.660.1.2 -> 1.660.1.3
# drivers/base/hotplug.c 1.1 -> 1.2
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 02/09/30 greg@kroah.com 1.660.1.3
# driver core: added location of device in driverfs tree to /sbin/hotplug call.
#
# /sbin/hotplug is now called when any device is added or removed from the
# system.
# --------------------------------------------
#
diff -Nru a/drivers/base/hotplug.c b/drivers/base/hotplug.c
--- a/drivers/base/hotplug.c Mon Sep 30 17:25:55 2002
+++ b/drivers/base/hotplug.c Mon Sep 30 17:25:55 2002
@@ -18,6 +18,7 @@
#include <linux/kmod.h>
#include <linux/interrupt.h>
#include "base.h"
+#include "fs/fs.h"
/*
* hotplugging invokes what /proc/sys/kernel/hotplug says (normally
@@ -32,14 +33,16 @@
int dev_hotplug (struct device *dev, const char *action)
{
char *argv [3], **envp, *buffer, *scratch;
+ char *dev_path;
int retval;
int i = 0;
+ int dev_length;
pr_debug ("%s\n", __FUNCTION__);
if (!dev)
return -ENODEV;
- if (!dev->bus || !dev->bus->hotplug)
+ if (!dev->bus)
return -ENODEV;
if (!hotplug_path [0])
@@ -66,6 +69,18 @@
return -ENOMEM;
}
+ dev_length = get_devpath_length (dev);
+ dev_length += strlen("root");
+ dev_path = kmalloc (dev_length, GFP_KERNEL);
+ if (!dev_path) {
+ kfree (buffer);
+ kfree (envp);
+ return -ENOMEM;
+ }
+ memset (dev_path, 0x00, dev_length);
+ strcpy (dev_path, "root");
+ fill_devpath (dev, dev_path, dev_length);
+
/* only one standardized param to hotplug command: the bus name */
argv [0] = hotplug_path;
argv [1] = dev->bus->name;
@@ -77,26 +92,33 @@
scratch = buffer;
- /* action: add, remove */
envp [i++] = scratch;
scratch += sprintf (scratch, "ACTION=%s", action) + 1;
- /* have the bus specific function set up the rest of the environment */
- retval = dev->bus->hotplug (dev, &envp[i], NUM_ENVP - i,
- scratch, BUFFER_SIZE - (scratch - buffer));
- if (retval) {
- pr_debug ("%s - hotplug() returned %d\n", __FUNCTION__, retval);
- goto exit;
+ envp [i++] = scratch;
+ scratch += sprintf (scratch, "DEVICE=%s", dev_path) + 1;
+
+ if (dev->bus->hotplug) {
+ /* have the bus specific function add its stuff */
+ retval = dev->bus->hotplug (dev, &envp[i], NUM_ENVP - i,
+ scratch,
+ BUFFER_SIZE - (scratch - buffer));
+ if (retval) {
+ pr_debug ("%s - hotplug() returned %d\n",
+ __FUNCTION__, retval);
+ goto exit;
+ }
}
pr_debug ("%s: %s %s %s %s %s %s\n", __FUNCTION__, argv [0], argv[1],
- action, envp[0], envp[1], envp[2]);
+ envp[0], envp[1], envp[2], envp[3]);
retval = call_usermodehelper (argv [0], argv, envp);
if (retval)
pr_debug ("%s - call_usermodehelper returned %d\n",
__FUNCTION__, retval);
exit:
+ kfree (dev_path);
kfree (buffer);
kfree (envp);
return retval;
next prev parent reply other threads:[~2002-10-01 0:31 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-10-01 0:31 [BK PATCH] USB changes for 2.5.39 Greg KH
2002-10-01 0:32 ` Greg KH
2002-10-01 0:33 ` Greg KH
2002-10-01 0:34 ` Greg KH [this message]
2002-10-01 0:34 ` Greg KH
2002-10-01 0:34 ` Greg KH
2002-10-01 0:35 ` Greg KH
2002-10-01 0:35 ` Greg KH
2002-10-01 0:35 ` Greg KH
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20021001003401.GD3994@kroah.com \
--to=greg@kroah.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb-devel@lists.sourceforge.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).