From: Tommaso Merciai <tommaso.merciai@amarulasolutions.com>
To: tommaso.merciai@amarulasolutions.com
Cc: linuxfancy@googlegroups.com, linux-amarula@amarulasolutions.com,
quentin.schulz@theobroma-systems.com,
Jacopo Mondi <jacopo@jmondi.org>,
Daniel Scally <djrscally@gmail.com>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
linux-media@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH v5 1/6] media: ov5693: count num_supplies using array_size
Date: Thu, 30 Jun 2022 15:48:30 +0200 [thread overview]
Message-ID: <20220630134835.592521-2-tommaso.merciai@amarulasolutions.com> (raw)
In-Reply-To: <20220630134835.592521-1-tommaso.merciai@amarulasolutions.com>
Instead of hardcode OV5693_NUM_SUPPLIES in a define is better use
ARRAY_SIZE function to count the number of supplies from
ov5693_supply_names array
Signed-off-by: Tommaso Merciai <tommaso.merciai@amarulasolutions.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Daniel Scally <djrscally@gmail.com>
---
Changes since v3:
- Add reviewed-by tag, suggested by Jacopo, Krzysztof
Changes since v4:
- Add Daniel reviewed-by tag
drivers/media/i2c/ov5693.c | 15 +++++++--------
1 file changed, 7 insertions(+), 8 deletions(-)
diff --git a/drivers/media/i2c/ov5693.c b/drivers/media/i2c/ov5693.c
index 117ff5403312..f410333c4c67 100644
--- a/drivers/media/i2c/ov5693.c
+++ b/drivers/media/i2c/ov5693.c
@@ -127,11 +127,15 @@
#define OV5693_LINK_FREQ_419_2MHZ 419200000
#define OV5693_PIXEL_RATE 167680000
-/* Miscellaneous */
-#define OV5693_NUM_SUPPLIES 2
-
#define to_ov5693_sensor(x) container_of(x, struct ov5693_device, sd)
+static const char * const ov5693_supply_names[] = {
+ "avdd", /* Analog power */
+ "dovdd", /* Digital I/O power */
+};
+
+#define OV5693_NUM_SUPPLIES ARRAY_SIZE(ov5693_supply_names)
+
struct ov5693_reg {
u32 reg;
u8 val;
@@ -352,11 +356,6 @@ static const s64 link_freq_menu_items[] = {
OV5693_LINK_FREQ_419_2MHZ
};
-static const char * const ov5693_supply_names[] = {
- "avdd",
- "dovdd",
-};
-
static const char * const ov5693_test_pattern_menu[] = {
"Disabled",
"Random Data",
--
2.25.1
next prev parent reply other threads:[~2022-06-30 13:50 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-30 13:48 [PATCH v5 0/6] media: ov5693: cleanup code and add dts support Tommaso Merciai
2022-06-30 13:48 ` Tommaso Merciai [this message]
2022-06-30 13:48 ` [PATCH v5 2/6] media: ov5693: add dvdd into ov5693_supply_names array Tommaso Merciai
2022-06-30 13:48 ` [PATCH v5 3/6] media: ov5693: rename clk into xvclk Tommaso Merciai
2022-06-30 13:48 ` [PATCH v5 4/6] media: ov5693: add support for acpi clock-frequency prop Tommaso Merciai
2022-06-30 13:48 ` [PATCH v5 5/6] media: dt-bindings: ov5693: document YAML binding Tommaso Merciai
2022-07-11 9:36 ` Jacopo Mondi
2022-07-11 11:11 ` Tommaso Merciai
2022-07-11 12:36 ` Jacopo Mondi
2022-07-11 14:49 ` Tommaso Merciai
2022-07-12 15:25 ` Jacopo Mondi
2022-07-12 15:32 ` Krzysztof Kozlowski
2022-07-12 16:12 ` Jacopo Mondi
2022-07-12 16:16 ` Krzysztof Kozlowski
2022-07-12 16:17 ` Tommaso Merciai
2022-06-30 13:48 ` [PATCH v5 6/6] media: ov5693: add ov5693_of_match, dts support Tommaso Merciai
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=20220630134835.592521-2-tommaso.merciai@amarulasolutions.com \
--to=tommaso.merciai@amarulasolutions.com \
--cc=djrscally@gmail.com \
--cc=jacopo@jmondi.org \
--cc=linux-amarula@amarulasolutions.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=linuxfancy@googlegroups.com \
--cc=mchehab@kernel.org \
--cc=quentin.schulz@theobroma-systems.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.