Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4a31a334 authored by Jean Pihet's avatar Jean Pihet Committed by Rafael J. Wysocki
Browse files

PM QoS: Code reorganization



Move around the PM QoS misc devices management code
for better readability.

Signed-off-by: default avatarJean Pihet <j-pihet@ti.com>
Acked-by: default avatarmarkgross <markgross@thegnar.org>
Reviewed-by: default avatarKevin Hilman <khilman@ti.com>
Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
parent cc749986
Loading
Loading
Loading
Loading
+23 −22
Original line number Original line Diff line number Diff line
@@ -188,28 +188,6 @@ static void update_target(struct pm_qos_object *o, struct plist_node *node,
					     NULL);
					     NULL);
}
}


static int register_pm_qos_misc(struct pm_qos_object *qos)
{
	qos->pm_qos_power_miscdev.minor = MISC_DYNAMIC_MINOR;
	qos->pm_qos_power_miscdev.name = qos->name;
	qos->pm_qos_power_miscdev.fops = &pm_qos_power_fops;

	return misc_register(&qos->pm_qos_power_miscdev);
}

static int find_pm_qos_object_by_minor(int minor)
{
	int pm_qos_class;

	for (pm_qos_class = 0;
		pm_qos_class < PM_QOS_NUM_CLASSES; pm_qos_class++) {
		if (minor ==
			pm_qos_array[pm_qos_class]->pm_qos_power_miscdev.minor)
			return pm_qos_class;
	}
	return -1;
}

/**
/**
 * pm_qos_request - returns current system wide qos expectation
 * pm_qos_request - returns current system wide qos expectation
 * @pm_qos_class: identification of which qos value is requested
 * @pm_qos_class: identification of which qos value is requested
@@ -362,6 +340,29 @@ int pm_qos_remove_notifier(int pm_qos_class, struct notifier_block *notifier)
}
}
EXPORT_SYMBOL_GPL(pm_qos_remove_notifier);
EXPORT_SYMBOL_GPL(pm_qos_remove_notifier);


/* User space interface to PM QoS classes via misc devices */
static int register_pm_qos_misc(struct pm_qos_object *qos)
{
	qos->pm_qos_power_miscdev.minor = MISC_DYNAMIC_MINOR;
	qos->pm_qos_power_miscdev.name = qos->name;
	qos->pm_qos_power_miscdev.fops = &pm_qos_power_fops;

	return misc_register(&qos->pm_qos_power_miscdev);
}

static int find_pm_qos_object_by_minor(int minor)
{
	int pm_qos_class;

	for (pm_qos_class = 0;
		pm_qos_class < PM_QOS_NUM_CLASSES; pm_qos_class++) {
		if (minor ==
			pm_qos_array[pm_qos_class]->pm_qos_power_miscdev.minor)
			return pm_qos_class;
	}
	return -1;
}

static int pm_qos_power_open(struct inode *inode, struct file *filp)
static int pm_qos_power_open(struct inode *inode, struct file *filp)
{
{
	long pm_qos_class;
	long pm_qos_class;