Merge branch 'fix/misc' into for-linus
[pandora-kernel.git] / drivers / gpu / drm / ttm / ttm_bo.c
index c7320ce..dd47b2a 100644 (file)
@@ -128,7 +128,7 @@ static struct attribute *ttm_bo_global_attrs[] = {
        NULL
 };
 
-static struct sysfs_ops ttm_bo_global_ops = {
+static const struct sysfs_ops ttm_bo_global_ops = {
        .show = &ttm_bo_global_show
 };
 
@@ -1425,8 +1425,8 @@ int ttm_bo_global_init(struct ttm_global_reference *ref)
 
        atomic_set(&glob->bo_count, 0);
 
-       kobject_init(&glob->kobj, &ttm_bo_glob_kobj_type);
-       ret = kobject_add(&glob->kobj, ttm_get_kobj(), "buffer_objects");
+       ret = kobject_init_and_add(
+               &glob->kobj, &ttm_bo_glob_kobj_type, ttm_get_kobj(), "buffer_objects");
        if (unlikely(ret != 0))
                kobject_put(&glob->kobj);
        return ret;