Commit 58aae7d9 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

DRIVER: firmware class build cleanups

Made variables static that were global, and cleaned up some sparse warnings.
parent a95557d5
...@@ -56,13 +56,13 @@ firmware_timeout_store(struct class *class, const char *buf, size_t count) ...@@ -56,13 +56,13 @@ firmware_timeout_store(struct class *class, const char *buf, size_t count)
return count; return count;
} }
CLASS_ATTR(timeout, 0644, firmware_timeout_show, firmware_timeout_store); static CLASS_ATTR(timeout, 0644, firmware_timeout_show, firmware_timeout_store);
static void fw_class_dev_release(struct class_device *class_dev); static void fw_class_dev_release(struct class_device *class_dev);
int firmware_class_hotplug(struct class_device *dev, char **envp, int firmware_class_hotplug(struct class_device *dev, char **envp,
int num_envp, char *buffer, int buffer_size); int num_envp, char *buffer, int buffer_size);
struct class firmware_class = { static struct class firmware_class = {
.name = "firmware", .name = "firmware",
.hotplug = firmware_class_hotplug, .hotplug = firmware_class_hotplug,
.release = fw_class_dev_release, .release = fw_class_dev_release,
...@@ -132,7 +132,7 @@ firmware_loading_store(struct class_device *class_dev, ...@@ -132,7 +132,7 @@ firmware_loading_store(struct class_device *class_dev,
return count; return count;
} }
CLASS_DEVICE_ATTR(loading, 0644, static CLASS_DEVICE_ATTR(loading, 0644,
firmware_loading_show, firmware_loading_store); firmware_loading_show, firmware_loading_store);
static ssize_t static ssize_t
...@@ -224,10 +224,11 @@ firmware_class_timeout(u_long data) ...@@ -224,10 +224,11 @@ firmware_class_timeout(u_long data)
wmb(); wmb();
complete(&fw_priv->completion); complete(&fw_priv->completion);
} }
static inline void static inline void
fw_setup_class_device_id(struct class_device *class_dev, struct device *dev) fw_setup_class_device_id(struct class_device *class_dev, struct device *dev)
{ {
#warning we should watch out for name collisions /* XXX warning we should watch out for name collisions */
strncpy(class_dev->class_id, dev->bus_id, BUS_ID_SIZE); strncpy(class_dev->class_id, dev->bus_id, BUS_ID_SIZE);
class_dev->class_id[BUS_ID_SIZE - 1] = '\0'; class_dev->class_id[BUS_ID_SIZE - 1] = '\0';
} }
...@@ -252,7 +253,7 @@ fw_setup_class_device(struct class_device **class_dev_p, ...@@ -252,7 +253,7 @@ fw_setup_class_device(struct class_device **class_dev_p,
memcpy(&fw_priv->attr_data, &firmware_attr_data_tmpl, memcpy(&fw_priv->attr_data, &firmware_attr_data_tmpl,
sizeof (firmware_attr_data_tmpl)); sizeof (firmware_attr_data_tmpl));
strncpy(fw_priv->fw_id, fw_name, FIRMWARE_NAME_MAX); strncpy(&fw_priv->fw_id[0], fw_name, FIRMWARE_NAME_MAX);
fw_priv->fw_id[FIRMWARE_NAME_MAX - 1] = '\0'; fw_priv->fw_id[FIRMWARE_NAME_MAX - 1] = '\0';
fw_setup_class_device_id(class_dev, device); fw_setup_class_device_id(class_dev, device);
......
...@@ -13,7 +13,6 @@ int request_firmware_nowait( ...@@ -13,7 +13,6 @@ int request_firmware_nowait(
struct module *module, struct module *module,
const char *name, struct device *device, void *context, const char *name, struct device *device, void *context,
void (*cont)(const struct firmware *fw, void *context)); void (*cont)(const struct firmware *fw, void *context));
/* Maybe 'device' should be 'struct device *' */
void release_firmware(const struct firmware *fw); void release_firmware(const struct firmware *fw);
void register_firmware(const char *name, const u8 *data, size_t size); void register_firmware(const char *name, const u8 *data, size_t size);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment