aboutsummaryrefslogtreecommitdiffstats
path: root/pending
diff options
authorGreg Kroah-Hartman <gregkh@suse.de>2008-03-19 12:20:14 -0700
committerGreg Kroah-Hartman <gregkh@suse.de>2008-03-19 12:20:14 -0700
commit85db9fb3e4729f54affa62b203f6b8f9e7056695 (patch)
tree88c55e2c505943f3dc6fa86d99ed2a7d542afe4b /pending
parent5a0f3a6140f199bf0609b759e18e0f29912c81ba (diff)
downloadpatches-85db9fb3e4729f54affa62b203f6b8f9e7056695.tar.gz
move firmware patches that are currently broken out of the way...
Diffstat (limited to 'pending')
-rw-r--r--pending/f2.patch110
-rw-r--r--pending/firmware-add-kconfig-and-makefile-to-build-the-firmware-samples.patch51
2 files changed, 161 insertions, 0 deletions
diff --git a/pending/f2.patch b/pending/f2.patch
new file mode 100644
index 00000000000000..47c6b064b81e40
--- /dev/null
+++ b/pending/f2.patch
@@ -0,0 +1,110 @@
+---
+ samples/firmware_class/firmware_sample_firmware_class.c | 44 ++++++----------
+ 1 file changed, 18 insertions(+), 26 deletions(-)
+
+--- a/samples/firmware_class/firmware_sample_firmware_class.c
++++ b/samples/firmware_class/firmware_sample_firmware_class.c
+@@ -23,16 +23,8 @@ MODULE_AUTHOR("Manuel Estrada Sainz");
+ MODULE_DESCRIPTION("Hackish sample for using firmware class directly");
+ MODULE_LICENSE("GPL");
+
+-static inline struct class_device *to_class_dev(struct kobject *obj)
+-{
+- return container_of(obj, struct class_device, kobj);
+-}
+-
+-static inline
+-struct class_device_attribute *to_class_dev_attr(struct attribute *_attr)
+-{
+- return container_of(_attr, struct class_device_attribute, attr);
+-}
++#define to_dev(obj) container_of(obj, struct device, kobj)
++#define to_class_dev_attr(_attr) container_of(_attr, struct class_device_attribute, attr)
+
+ struct firmware_priv {
+ char fw_id[FIRMWARE_NAME_MAX];
+@@ -40,16 +32,18 @@ struct firmware_priv {
+ u32 abort:1;
+ };
+
+-static ssize_t firmware_loading_show(struct class_device *class_dev, char *buf)
++static ssize_t firmware_loading_show(struct device *dev,
++ struct device_attribute *attr, char *buf)
+ {
+- struct firmware_priv *fw_priv = class_get_devdata(class_dev);
++ struct firmware_priv *fw_priv = dev_get_drvdata(dev);
+ return sprintf(buf, "%d\n", fw_priv->loading);
+ }
+
+-static ssize_t firmware_loading_store(struct class_device *class_dev,
++static ssize_t firmware_loading_store(struct device *dev,
++ struct device_attribute *attr,
+ const char *buf, size_t count)
+ {
+- struct firmware_priv *fw_priv = class_get_devdata(class_dev);
++ struct firmware_priv *fw_priv = dev_get_drvdata(dev);
+ int prev_loading = fw_priv->loading;
+
+ fw_priv->loading = simple_strtol(buf, NULL, 10);
+@@ -71,15 +65,15 @@ static ssize_t firmware_loading_store(st
+
+ return count;
+ }
+-static CLASS_DEVICE_ATTR(loading, 0644,
+- firmware_loading_show, firmware_loading_store);
++static DEVICE_ATTR(loading, 0644,
++ firmware_loading_show, firmware_loading_store);
+
+ static ssize_t firmware_data_read(struct kobject *kobj,
+ struct bin_attribute *bin_attr,
+ char *buffer, loff_t offset, size_t count)
+ {
+- struct class_device *class_dev = to_class_dev(kobj);
+- struct firmware_priv *fw_priv = class_get_devdata(class_dev);
++ struct device *dev = to_dev(kobj);
++ struct firmware_priv *fw_priv = dev_get_drvdata(dev);
+
+ /* read from the devices firmware memory */
+
+@@ -89,8 +83,8 @@ static ssize_t firmware_data_write(struc
+ struct bin_attribute *bin_attr,
+ char *buffer, loff_t offset, size_t count)
+ {
+- struct class_device *class_dev = to_class_dev(kobj);
+- struct firmware_priv *fw_priv = class_get_devdata(class_dev);
++ struct device *dev = to_dev(kobj);
++ struct firmware_priv *fw_priv = dev_get_drvdata(dev);
+
+ /* write to the devices firmware memory */
+
+@@ -102,9 +96,8 @@ static struct bin_attribute firmware_att
+ .read = firmware_data_read,
+ .write = firmware_data_write,
+ };
+-static int fw_setup_class_device(struct class_device *class_dev,
+- const char *fw_name,
+- struct device *device)
++static int fw_setup_device(struct device *dev, const char *fw_name,
++ struct device *parent)
+ {
+ int retval;
+ struct firmware_priv *fw_priv;
+@@ -115,7 +108,7 @@ static int fw_setup_class_device(struct
+ goto out;
+ }
+
+- memset(class_dev, 0, sizeof(*class_dev));
++ memset(dev, 0, sizeof(*dev));
+
+ strncpy(fw_priv->fw_id, fw_name, FIRMWARE_NAME_MAX);
+ fw_priv->fw_id[FIRMWARE_NAME_MAX-1] = '\0';
+@@ -183,8 +176,7 @@ static int __init firmware_sample_init(v
+ if (!class_dev)
+ return -ENOMEM;
+
+- error = fw_setup_class_device(class_dev, "my_firmware_image",
+- &my_device);
++ error = fw_setup_device(class_dev, "my_firmware_image", &my_device);
+ if (error) {
+ kfree(class_dev);
+ return error;
diff --git a/pending/firmware-add-kconfig-and-makefile-to-build-the-firmware-samples.patch b/pending/firmware-add-kconfig-and-makefile-to-build-the-firmware-samples.patch
new file mode 100644
index 00000000000000..dbce2c16b402f9
--- /dev/null
+++ b/pending/firmware-add-kconfig-and-makefile-to-build-the-firmware-samples.patch
@@ -0,0 +1,51 @@
+From randy.dunlap@oracle.com Wed Feb 20 14:33:28 2008
+From: Randy Dunlap <randy.dunlap@oracle.com>
+Date: Wed, 20 Feb 2008 13:20:50 -0800
+Subject: firmware: add Kconfig and Makefile to build the firmware samples
+To: Greg KH <greg@kroah.com>
+Cc: akpm <akpm@linux-foundation.org>
+Message-ID: <20080220132050.8f1dac05.randy.dunlap@oracle.com>
+
+
+From: Randy Dunlap <randy.dunlap@oracle.com>
+
+Now that the firmware samples are cleaned up, enable the build so that
+it does not get so far behind what the kernel supports again.
+
+Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
+Acked-by: Marcel Holtmann <marcel@holtmann.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ samples/Kconfig | 8 ++++++++
+ samples/Makefile | 2 +-
+ samples/firmware_class/Makefile | 1 +
+ 3 files changed, 10 insertions(+), 1 deletion(-)
+
+--- a/samples/Kconfig
++++ b/samples/Kconfig
+@@ -33,5 +33,13 @@ config SAMPLE_KRETPROBES
+ default m
+ depends on SAMPLE_KPROBES && KRETPROBES
+
++config SAMPLE_FIRMWARE_CLASS
++ tristate "Build firmware_class examples -- loadable modules only"
++ depends on FW_LOADER && m
++ help
++ This build firmware_class example modules.
++
++ If in doubt, say "N" here.
++
+ endif # SAMPLES
+
+--- a/samples/Makefile
++++ b/samples/Makefile
+@@ -1,3 +1,3 @@
+ # Makefile for Linux samples code
+
+-obj-$(CONFIG_SAMPLES) += markers/ kobject/ kprobes/
++obj-$(CONFIG_SAMPLES) += markers/ kobject/ kprobes/ firmware_class/
+--- /dev/null
++++ b/samples/firmware_class/Makefile
+@@ -0,0 +1 @@
++obj-$(CONFIG_SAMPLE_FIRMWARE_CLASS) += firmware_sample_driver.o firmware_sample_firmware_class.o