diff options
| author | Greg Kroah-Hartman <gregkh@suse.de> | 2008-02-20 16:10:05 -0800 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@suse.de> | 2008-02-20 16:10:05 -0800 |
| commit | 0f2f42fda5b00a8797b08afca6ba9dabf327b8eb (patch) | |
| tree | ebbf611d307360d2122b36ec536868a43c933fee /f1.patch | |
| parent | 71135fd97018000368733e88d38da05c48b88bf8 (diff) | |
| download | patches-0f2f42fda5b00a8797b08afca6ba9dabf327b8eb.tar.gz | |
rename f1.patch
Diffstat (limited to 'f1.patch')
| -rw-r--r-- | f1.patch | 217 |
1 files changed, 0 insertions, 217 deletions
diff --git a/f1.patch b/f1.patch deleted file mode 100644 index 232bfb8e5a9af8..00000000000000 --- a/f1.patch +++ /dev/null @@ -1,217 +0,0 @@ ---- - samples/firmware_class/firmware_sample_driver.c | 45 ++++++++-------- - samples/firmware_class/firmware_sample_firmware_class.c | 33 +++++------ - 2 files changed, 40 insertions(+), 38 deletions(-) - ---- a/samples/firmware_class/firmware_sample_driver.c -+++ b/samples/firmware_class/firmware_sample_driver.c -@@ -12,8 +12,7 @@ - #include <linux/init.h> - #include <linux/device.h> - #include <linux/string.h> -- --#include "linux/firmware.h" -+#include <linux/firmware.h> - - static struct device ghost_device = { - .bus_id = "ghost0", -@@ -31,11 +30,14 @@ static void sample_firmware_load(char *f - static void sample_probe_default(void) - { - /* uses the default method to get the firmware */ -- const struct firmware *fw_entry; -- printk(KERN_INFO "firmware_sample_driver: a ghost device got inserted :)\n"); -+ const struct firmware *fw_entry; -+ int retval; -+ -+ printk(KERN_INFO "firmware_sample_driver: " -+ "a ghost device got inserted :)\n"); - -- if(request_firmware(&fw_entry, "sample_driver_fw", &ghost_device)!=0) -- { -+ retval = request_firmware(&fw_entry, "sample_driver_fw", &ghost_device); -+ if (retval) { - printk(KERN_ERR - "firmware_sample_driver: Firmware not available\n"); - return; -@@ -47,17 +49,20 @@ static void sample_probe_default(void) - - /* finish setting up the device */ - } -+ - static void sample_probe_specific(void) - { -+ int retval; - /* Uses some specific hotplug support to get the firmware from - * userspace directly into the hardware, or via some sysfs file */ - - /* NOTE: This currently doesn't work */ - -- printk(KERN_INFO "firmware_sample_driver: a ghost device got inserted :)\n"); -+ printk(KERN_INFO "firmware_sample_driver: " -+ "a ghost device got inserted :)\n"); - -- if(request_firmware(NULL, "sample_driver_fw", &ghost_device)!=0) -- { -+ retval = request_firmware(NULL, "sample_driver_fw", &ghost_device); -+ if (retval) { - printk(KERN_ERR - "firmware_sample_driver: Firmware load failed\n"); - return; -@@ -70,7 +75,7 @@ static void sample_probe_specific(void) - } - static void sample_probe_async_cont(const struct firmware *fw, void *context) - { -- if(!fw){ -+ if (!fw) { - printk(KERN_ERR - "firmware_sample_driver: firmware load failed\n"); - return; -@@ -80,19 +85,18 @@ static void sample_probe_async_cont(cons - (char *)context); - sample_firmware_load(fw->data, fw->size); - } -+ - static void sample_probe_async(void) - { - /* Let's say that I can't sleep */ - int error; -- error = request_firmware_nowait (THIS_MODULE, FW_ACTION_NOHOTPLUG, -- "sample_driver_fw", &ghost_device, -- "my device pointer", -- sample_probe_async_cont); -- if(error){ -- printk(KERN_ERR -- "firmware_sample_driver:" -+ error = request_firmware_nowait(THIS_MODULE, FW_ACTION_NOHOTPLUG, -+ "sample_driver_fw", &ghost_device, -+ "my device pointer", -+ sample_probe_async_cont); -+ if (error) -+ printk(KERN_ERR "firmware_sample_driver:" - " request_firmware_nowait failed\n"); -- } - } - - static int sample_init(void) -@@ -105,11 +109,12 @@ static int sample_init(void) - sample_probe_async(); - return 0; - } -+ - static void __exit sample_exit(void) - { - } - --module_init (sample_init); --module_exit (sample_exit); -+module_init(sample_init); -+module_exit(sample_exit); - - MODULE_LICENSE("GPL"); ---- a/samples/firmware_class/firmware_sample_firmware_class.c -+++ b/samples/firmware_class/firmware_sample_firmware_class.c -@@ -25,30 +25,27 @@ MODULE_LICENSE("GPL"); - - static inline struct class_device *to_class_dev(struct kobject *obj) - { -- return container_of(obj,struct class_device,kobj); -+ 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); -+ return container_of(_attr, struct class_device_attribute, attr); - } - --int sysfs_create_bin_file(struct kobject * kobj, struct bin_attribute * attr); --int sysfs_remove_bin_file(struct kobject * kobj, struct bin_attribute * attr); -- - struct firmware_priv { - char fw_id[FIRMWARE_NAME_MAX]; - s32 loading:2; - u32 abort:1; - }; - --extern struct class firmware_class; -- - static ssize_t firmware_loading_show(struct class_device *class_dev, char *buf) - { - struct firmware_priv *fw_priv = class_get_devdata(class_dev); - return sprintf(buf, "%d\n", fw_priv->loading); - } -+ - static ssize_t firmware_loading_store(struct class_device *class_dev, - const char *buf, size_t count) - { -@@ -57,7 +54,7 @@ static ssize_t firmware_loading_store(st - - fw_priv->loading = simple_strtol(buf, NULL, 10); - -- switch(fw_priv->loading){ -+ switch (fw_priv->loading) { - case -1: - /* abort load an panic */ - break; -@@ -65,7 +62,7 @@ static ssize_t firmware_loading_store(st - /* setup load */ - break; - case 0: -- if(prev_loading==1){ -+ if (prev_loading == 1) { - /* finish load and get the device back to working - * state */ - } -@@ -130,24 +127,24 @@ static int fw_setup_class_device(struct - class_dev->class = &firmware_class, - class_set_devdata(class_dev, fw_priv); - retval = class_device_register(class_dev); -- if (retval){ -+ if (retval) { - printk(KERN_ERR "%s: class_device_register failed\n", -- __FUNCTION__); -+ __func__); - goto error_free_fw_priv; - } - - retval = sysfs_create_bin_file(&class_dev->kobj, &firmware_attr_data); -- if (retval){ -+ if (retval) { - printk(KERN_ERR "%s: sysfs_create_bin_file failed\n", -- __FUNCTION__); -+ __func__); - goto error_unreg_class_dev; - } - - retval = class_device_create_file(class_dev, - &class_device_attr_loading); -- if (retval){ -+ if (retval) { - printk(KERN_ERR "%s: class_device_create_file failed\n", -- __FUNCTION__); -+ __func__); - goto error_remove_data; - } - -@@ -183,16 +180,16 @@ static int __init firmware_sample_init(v - - device_initialize(&my_device); - class_dev = kmalloc(sizeof(struct class_device), GFP_KERNEL); -- if(!class_dev) -+ if (!class_dev) - return -ENOMEM; - - error = fw_setup_class_device(class_dev, "my_firmware_image", - &my_device); -- if(error){ -+ if (error) { - kfree(class_dev); - return error; - } -- return 0; -+ return 0; - - } - static void __exit firmware_sample_exit(void) |
