// SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause)
/*
 * Copyright (c) 2020 MediaTek Inc.
 */
#include <linux/module.h>

#include "mdrv_demux_debug.h"

static struct kobject *root_kobj;
static struct kobj_type demux_ktype = {
	.sysfs_ops = &kobj_sysfs_ops,
};

int mdrv_demux_debug_init(struct platform_device *pdev)
{
	root_kobj = &pdev->dev.kobj;

	return 0;
}

int mdrv_demux_debug_exit(struct platform_device *pdev)
{
	root_kobj = NULL;

	return 0;
}

struct kobject *mdrv_demux_debug_get_root_kobj(void)
{
	if (!root_kobj) {
		DEMUX_DEBUG_DEBUG("[%s][%d] root_kobj is NULL\n", __FUNCTION__, __LINE__);
	}

	return root_kobj;
}

struct kobj_type *mdrv_demux_debug_get_ktype(void)
{
	return &demux_ktype;
}

int mdrv_demux_debug_remove_attr_group(struct kobject *kobj, struct attribute_group *attr_group)
{
	if (attr_group)
		sysfs_remove_group(kobj, attr_group);

	kobject_put(kobj);

	return 0;
}
