* [GIT PATCH] driver core patch against 2.6.26-rc4
@ 2008-05-30 4:15 Greg KH
2008-05-30 4:16 ` [PATCH 1/1] driver-core: prepare for 2.6.27 api change by adding dev_set_name Greg Kroah-Hartman
2008-05-30 4:16 ` Greg Kroah-Hartman
0 siblings, 2 replies; 3+ messages in thread
From: Greg KH @ 2008-05-30 4:15 UTC (permalink / raw)
To: Linus Torvalds, Andrew Morton; +Cc: linux-kernel, Stephen Rothwell, Kay Sievers
Here is a single patch against your 2.6.26-git tree.
It was suggested by Stephen, as it will help with the linux-next merge
issues starting to happen as this api changes in anticipation for
2.6.27. This patch merges a functional version of the dev_set_name()
function for other trees to be able to take adnd merge in changes that
help with the progression toward getting rid of the bus_id field and the
limitation of 20 characters for the name of struct device.
Please pull from:
master.kernel.org:/pub/scm/linux/kernel/git/gregkh/driver-2.6.git/
The patch will be sent as a follow-on to this message to lkml for people
to see.
thanks,
greg k-h
------------
drivers/base/core.c | 15 +++++++++++++++
include/linux/device.h | 3 +++
2 files changed, 18 insertions(+), 0 deletions(-)
---------------
Stephen Rothwell (1):
driver-core: prepare for 2.6.27 api change by adding dev_set_name
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH 1/1] driver-core: prepare for 2.6.27 api change by adding dev_set_name
2008-05-30 4:15 [GIT PATCH] driver core patch against 2.6.26-rc4 Greg KH
@ 2008-05-30 4:16 ` Greg Kroah-Hartman
2008-05-30 4:16 ` Greg Kroah-Hartman
1 sibling, 0 replies; 3+ messages in thread
From: Greg Kroah-Hartman @ 2008-05-30 4:16 UTC (permalink / raw)
To: linux-kernel; +Cc: Stephen Rothwell, Kay Sievers, Greg Kroah-Hartman
From: Stephen Rothwell <sfr@canb.auug.org.au>
Create the dev_set_name function now so that various subsystems can
start changing over to it before other changes in 2.6.27 will make it
compulsory.
Cc: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/base/core.c | 15 +++++++++++++++
include/linux/device.h | 3 +++
2 files changed, 18 insertions(+), 0 deletions(-)
diff --git a/drivers/base/core.c b/drivers/base/core.c
index 72eccae..422cfca 100644
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -760,6 +760,21 @@ static void device_remove_class_symlinks(struct device *dev)
}
/**
+ * dev_set_name - set a device name
+ * @dev: device
+ */
+int dev_set_name(struct device *dev, const char *fmt, ...)
+{
+ va_list vargs;
+
+ va_start(vargs, fmt);
+ vsnprintf(dev->bus_id, sizeof(dev->bus_id), fmt, vargs);
+ va_end(vargs);
+ return 0;
+}
+EXPORT_SYMBOL_GPL(dev_set_name);
+
+/**
* device_add - add device to device hierarchy.
* @dev: device.
*
diff --git a/include/linux/device.h b/include/linux/device.h
index 14616e8..6a2d04c 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -385,6 +385,9 @@ static inline const char *dev_name(struct device *dev)
return dev->bus_id;
}
+extern int dev_set_name(struct device *dev, const char *name, ...)
+ __attribute__((format(printf, 2, 3)));
+
#ifdef CONFIG_NUMA
static inline int dev_to_node(struct device *dev)
{
--
1.5.5.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* driver-core: prepare for 2.6.27 api change by adding dev_set_name
2008-05-30 4:15 [GIT PATCH] driver core patch against 2.6.26-rc4 Greg KH
2008-05-30 4:16 ` [PATCH 1/1] driver-core: prepare for 2.6.27 api change by adding dev_set_name Greg Kroah-Hartman
@ 2008-05-30 4:16 ` Greg Kroah-Hartman
1 sibling, 0 replies; 3+ messages in thread
From: Greg Kroah-Hartman @ 2008-05-30 4:16 UTC (permalink / raw)
To: linux-kernel; +Cc: Stephen Rothwell, Kay Sievers, Greg Kroah-Hartman
From: Stephen Rothwell <sfr@canb.auug.org.au>
Create the dev_set_name function now so that various subsystems can
start changing over to it before other changes in 2.6.27 will make it
compulsory.
Cc: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -760,6 +760,21 @@ static void device_remove_class_symlinks(struct device *dev)
}
/**
+ * dev_set_name - set a device name
+ * @dev: device
+ */
+int dev_set_name(struct device *dev, const char *fmt, ...)
+{
+ va_list vargs;
+
+ va_start(vargs, fmt);
+ vsnprintf(dev->bus_id, sizeof(dev->bus_id), fmt, vargs);
+ va_end(vargs);
+ return 0;
+}
+EXPORT_SYMBOL_GPL(dev_set_name);
+
+/**
* device_add - add device to device hierarchy.
* @dev: device.
*
diff --git a/include/linux/device.h b/include/linux/device.h
index 14616e8..6a2d04c 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -385,6 +385,9 @@ static inline const char *dev_name(struct device *dev)
return dev->bus_id;
}
+extern int dev_set_name(struct device *dev, const char *name, ...)
+ __attribute__((format(printf, 2, 3)));
+
#ifdef CONFIG_NUMA
static inline int dev_to_node(struct device *dev)
{
--
1.5.5.2
--
To unsubscribe from this list: send the line "unsubscribe linux-next" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2008-05-30 4:18 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-30 4:15 [GIT PATCH] driver core patch against 2.6.26-rc4 Greg KH
2008-05-30 4:16 ` [PATCH 1/1] driver-core: prepare for 2.6.27 api change by adding dev_set_name Greg Kroah-Hartman
2008-05-30 4:16 ` Greg Kroah-Hartman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox