]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/usb/gadget/inode.c
Manual merge with Linus.
[linux-2.6-omap-h63xx.git] / drivers / usb / gadget / inode.c
index 0aab7d24c768d03c99c5a67aa154bf2df1e4e640..3f618ce6998dbb1b92a604784d96de0b9df29ba1 100644 (file)
@@ -170,10 +170,9 @@ static struct dev_data *dev_new (void)
 {
        struct dev_data         *dev;
 
-       dev = kmalloc (sizeof *dev, GFP_KERNEL);
+       dev = kzalloc(sizeof(*dev), GFP_KERNEL);
        if (!dev)
                return NULL;
-       memset (dev, 0, sizeof *dev);
        dev->state = STATE_DEV_DISABLED;
        atomic_set (&dev->count, 1);
        spin_lock_init (&dev->lock);
@@ -1582,7 +1581,7 @@ restart:
 
 static struct inode *
 gadgetfs_create_file (struct super_block *sb, char const *name,
-               void *data, struct file_operations *fops,
+               void *data, const struct file_operations *fops,
                struct dentry **dentry_p);
 
 static int activate_ep_files (struct dev_data *dev)
@@ -1592,10 +1591,9 @@ static int activate_ep_files (struct dev_data *dev)
        gadget_for_each_ep (ep, dev->gadget) {
                struct ep_data  *data;
 
-               data = kmalloc (sizeof *data, GFP_KERNEL);
+               data = kzalloc(sizeof(*data), GFP_KERNEL);
                if (!data)
                        goto enomem;
-               memset (data, 0, sizeof data);
                data->state = STATE_EP_DISABLED;
                init_MUTEX (&data->lock);
                init_waitqueue_head (&data->wait);
@@ -1957,7 +1955,7 @@ module_param (default_perm, uint, 0644);
 
 static struct inode *
 gadgetfs_make_inode (struct super_block *sb,
-               void *data, struct file_operations *fops,
+               void *data, const struct file_operations *fops,
                int mode)
 {
        struct inode *inode = new_inode (sb);
@@ -1981,7 +1979,7 @@ gadgetfs_make_inode (struct super_block *sb,
  */
 static struct inode *
 gadgetfs_create_file (struct super_block *sb, char const *name,
-               void *data, struct file_operations *fops,
+               void *data, const struct file_operations *fops,
                struct dentry **dentry_p)
 {
        struct dentry   *dentry;