From: Michael Tretter <m.tretter@pengutronix.de>
To: linux-arm-kernel@lists.infradead.org
Cc: michal.simek@xilinx.com, rajan.vaja@xilinx.com,
jolly.shah@xilinx.com, m.tretter@pengutronix.de
Subject: [PATCH 3/4] soc: xilinx: use a properly named field instead of flags
Date: Wed, 17 Mar 2021 17:04:09 +0100 [thread overview]
Message-ID: <20210317160410.2097178-4-m.tretter@pengutronix.de> (raw)
In-Reply-To: <20210317160410.2097178-1-m.tretter@pengutronix.de>
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: Michael Tretter <m.tretter@pengutronix.de>
---
drivers/soc/xilinx/zynqmp_pm_domains.c | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
diff --git a/drivers/soc/xilinx/zynqmp_pm_domains.c b/drivers/soc/xilinx/zynqmp_pm_domains.c
index 67e1c2b56a7d..c793041bf51e 100644
--- a/drivers/soc/xilinx/zynqmp_pm_domains.c
+++ b/drivers/soc/xilinx/zynqmp_pm_domains.c
@@ -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;
@@ -171,7 +169,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);
@@ -203,7 +201,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);
--
2.29.2
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2021-03-17 16:05 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-17 16:04 [PATCH 0/4] soc: xilinx: pm_domains: cleanup and fix PM_INIT_FINALIZE Michael Tretter
2021-03-17 16:04 ` [PATCH 1/4] soc: xilinx: move PM_INIT_FINALIZE to zynqmp_pm_domains driver Michael Tretter
2021-03-17 16:04 ` [PATCH 2/4] soc: xilinx: cleanup debug and error messages Michael Tretter
2021-03-17 16:04 ` Michael Tretter [this message]
2021-03-17 16:04 ` [PATCH 4/4] soc: xilinx: add a to_zynqmp_pm_domain macro Michael Tretter
2021-04-15 16:27 ` [PATCH 0/4] soc: xilinx: pm_domains: cleanup and fix PM_INIT_FINALIZE Rajan Vaja
2021-04-19 7:32 ` Michael Tretter
2021-04-19 12:29 ` Rajan Vaja
2021-04-20 14:18 ` Sudeep Holla
2021-04-28 13:17 ` Michal Simek
2021-06-01 8:49 ` Michael Tretter
2021-06-01 9:17 ` Rajan Vaja
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210317160410.2097178-4-m.tretter@pengutronix.de \
--to=m.tretter@pengutronix.de \
--cc=jolly.shah@xilinx.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=michal.simek@xilinx.com \
--cc=rajan.vaja@xilinx.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).