Commit e7a9106c authored by Michael Tretter's avatar Michael Tretter Committed by Michal Simek
Browse files

soc: xilinx: use a properly named field instead of flags



Instead of defining a flags field and a single bit in this field to
signal that a PM node has been requested, use a boolean field with a
descriptive name.

No functional change, but using a proper name instead of flags makes the
code easier to read.

Signed-off-by: default avatarMichael Tretter <m.tretter@pengutronix.de>
Acked-by: default avatarMichal Simek <michal.simek@xilinx.com>
Acked-by: default avatarRajan Vaja <rajan.vaja@xilinx.com>
Link: https://lore.kernel.org/r/20210825150313.4033156-4-m.tretter@pengutronix.de


Signed-off-by: default avatarMichal Simek <michal.simek@xilinx.com>
parent c4245100
Loading
Loading
Loading
Loading
+5 −7
Original line number Diff line number Diff line
@@ -20,8 +20,6 @@
#include <linux/firmware/xlnx-zynqmp.h>

#define ZYNQMP_NUM_DOMAINS		(100)
/* Flag stating if PM nodes mapped to the PM domain has been requested */
#define ZYNQMP_PM_DOMAIN_REQUESTED	BIT(0)

static int min_capability;

@@ -29,12 +27,12 @@ static int min_capability;
 * struct zynqmp_pm_domain - Wrapper around struct generic_pm_domain
 * @gpd:		Generic power domain
 * @node_id:		PM node ID corresponding to device inside PM domain
 * @flags:		ZynqMP PM domain flags
 * @requested:		The PM node mapped to the PM domain has been requested
 */
struct zynqmp_pm_domain {
	struct generic_pm_domain gpd;
	u32 node_id;
	u8 flags;
	bool requested;
};

/**
@@ -112,7 +110,7 @@ static int zynqmp_gpd_power_off(struct generic_pm_domain *domain)
	pd = container_of(domain, struct zynqmp_pm_domain, gpd);

	/* If domain is already released there is nothing to be done */
	if (!(pd->flags & ZYNQMP_PM_DOMAIN_REQUESTED)) {
	if (!pd->requested) {
		dev_dbg(&domain->dev, "PM node id %d is already released\n",
			pd->node_id);
		return 0;
@@ -177,7 +175,7 @@ static int zynqmp_gpd_attach_dev(struct generic_pm_domain *domain,
		return ret;
	}

	pd->flags |= ZYNQMP_PM_DOMAIN_REQUESTED;
	pd->requested = true;

	dev_dbg(&domain->dev, "%s requested PM node id %d\n",
		dev_name(dev), pd->node_id);
@@ -209,7 +207,7 @@ static void zynqmp_gpd_detach_dev(struct generic_pm_domain *domain,
		return;
	}

	pd->flags &= ~ZYNQMP_PM_DOMAIN_REQUESTED;
	pd->requested = false;

	dev_dbg(&domain->dev, "%s released PM node id %d\n",
		dev_name(dev), pd->node_id);