Deleted Added
full compact
linux_compat.c (256281) linux_compat.c (271127)
1/*-
2 * Copyright (c) 2010 Isilon Systems, Inc.
3 * Copyright (c) 2010 iX Systems, Inc.
4 * Copyright (c) 2010 Panasas, Inc.
1/*-
2 * Copyright (c) 2010 Isilon Systems, Inc.
3 * Copyright (c) 2010 iX Systems, Inc.
4 * Copyright (c) 2010 Panasas, Inc.
5 * Copyright (c) 2013, 2014 Mellanox Technologies, Ltd.
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
9 * are met:
10 * 1. Redistributions of source code must retain the above copyright
11 * notice unmodified, this list of conditions, and the following
12 * disclaimer.

--- 142 unchanged lines hidden (view full) ---

155 if (kobj->ktype && kobj->ktype->release)
156 kobj->ktype->release(kobj);
157 kfree(name);
158}
159
160static void
161kobject_kfree(struct kobject *kobj)
162{
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
10 * are met:
11 * 1. Redistributions of source code must retain the above copyright
12 * notice unmodified, this list of conditions, and the following
13 * disclaimer.

--- 142 unchanged lines hidden (view full) ---

156 if (kobj->ktype && kobj->ktype->release)
157 kobj->ktype->release(kobj);
158 kfree(name);
159}
160
161static void
162kobject_kfree(struct kobject *kobj)
163{
163
164 kfree(kobj);
165}
166
164 kfree(kobj);
165}
166
167static void
168kobject_kfree_name(struct kobject *kobj)
169{
170 if (kobj) {
171 kfree(kobj->name);
172 }
173}
174
167struct kobj_type kfree_type = { .release = kobject_kfree };
168
169struct device *
170device_create(struct class *class, struct device *parent, dev_t devt,
171 void *drvdata, const char *fmt, ...)
172{
173 struct device *dev;
174 va_list args;

--- 521 unchanged lines hidden (view full) ---

696 INIT_LIST_HEAD(&pci_devices);
697 spin_lock_init(&pci_lock);
698 mtx_init(&vmmaplock, "IO Map lock", NULL, MTX_DEF);
699 for (i = 0; i < VMMAP_HASH_SIZE; i++)
700 LIST_INIT(&vmmaphead[i]);
701}
702
703SYSINIT(linux_compat, SI_SUB_DRIVERS, SI_ORDER_SECOND, linux_compat_init, NULL);
175struct kobj_type kfree_type = { .release = kobject_kfree };
176
177struct device *
178device_create(struct class *class, struct device *parent, dev_t devt,
179 void *drvdata, const char *fmt, ...)
180{
181 struct device *dev;
182 va_list args;

--- 521 unchanged lines hidden (view full) ---

704 INIT_LIST_HEAD(&pci_devices);
705 spin_lock_init(&pci_lock);
706 mtx_init(&vmmaplock, "IO Map lock", NULL, MTX_DEF);
707 for (i = 0; i < VMMAP_HASH_SIZE; i++)
708 LIST_INIT(&vmmaphead[i]);
709}
710
711SYSINIT(linux_compat, SI_SUB_DRIVERS, SI_ORDER_SECOND, linux_compat_init, NULL);
712
713static void
714linux_compat_uninit(void)
715{
716 kobject_kfree_name(&class_root);
717 kobject_kfree_name(&linux_rootdev.kobj);
718 kobject_kfree_name(&miscclass.kobj);
719}
720SYSUNINIT(linux_compat, SI_SUB_DRIVERS, SI_ORDER_SECOND, linux_compat_uninit, NULL);