qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <f4bug@amsat.org>
To: qemu-devel@nongnu.org
Cc: "Peter Maydell" <peter.maydell@linaro.org>,
	"Andrew Jeffery" <andrew@aj.id.au>,
	"Joaquin de Andres" <me@xcancerberox.com.ar>,
	"Philippe Mathieu-Daudé" <f4bug@amsat.org>,
	"Esteban Bosse" <estebanbosse@gmail.com>,
	qemu-arm@nongnu.org, "Cédric Le Goater" <clg@kaod.org>,
	"Joel Stanley" <joel@jms.id.au>
Subject: [PATCH v3 1/4] hw/misc/pca9552: Replace magic value by PCA9552_LED_COUNT definition
Date: Fri, 19 Jun 2020 16:50:58 +0200	[thread overview]
Message-ID: <20200619145101.1637-2-f4bug@amsat.org> (raw)
In-Reply-To: <20200619145101.1637-1-f4bug@amsat.org>

Replace the '16' magic value by the PCA9552_LED_COUNT definition.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 include/hw/misc/pca9552.h | 1 +
 hw/misc/pca9552.c         | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/include/hw/misc/pca9552.h b/include/hw/misc/pca9552.h
index ebb43c63fe..b2b9a5d9d4 100644
--- a/include/hw/misc/pca9552.h
+++ b/include/hw/misc/pca9552.h
@@ -15,6 +15,7 @@
 #define PCA9552(obj) OBJECT_CHECK(PCA9552State, (obj), TYPE_PCA9552)
 
 #define PCA9552_NR_REGS 10
+#define PCA9552_LED_COUNT 16
 
 typedef struct PCA9552State {
     /*< private >*/
diff --git a/hw/misc/pca9552.c b/hw/misc/pca9552.c
index cac729e35a..e015ef0e5d 100644
--- a/hw/misc/pca9552.c
+++ b/hw/misc/pca9552.c
@@ -291,7 +291,7 @@ static void pca9552_initfn(Object *obj)
      * PCA955X device
      */
     s->max_reg = PCA9552_LS3;
-    s->nr_leds = 16;
+    s->nr_leds = PCA9552_LED_COUNT;
 
     for (led = 0; led < s->nr_leds; led++) {
         char *name;
-- 
2.21.3



  reply	other threads:[~2020-06-19 14:53 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-19 14:50 [PATCH v3 0/4] hw/misc/pca9552: Trace LED On/Off events Philippe Mathieu-Daudé
2020-06-19 14:50 ` Philippe Mathieu-Daudé [this message]
2020-06-19 14:50 ` [PATCH v3 2/4] hw/misc/pca9552: Add a PCA955X_LED_MAX definition Philippe Mathieu-Daudé
2020-06-19 14:51 ` [PATCH v3 3/4] hw/misc/pca9552: Trace LED On/Off events Philippe Mathieu-Daudé
2020-06-19 14:51 ` [PATCH v3 4/4] hw/misc/pca9552: Trace LED change events Philippe Mathieu-Daudé
2020-06-20 11:49 ` [PATCH v3 0/4] hw/misc/pca9552: Trace LED On/Off events Philippe Mathieu-Daudé

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=20200619145101.1637-2-f4bug@amsat.org \
    --to=f4bug@amsat.org \
    --cc=andrew@aj.id.au \
    --cc=clg@kaod.org \
    --cc=estebanbosse@gmail.com \
    --cc=joel@jms.id.au \
    --cc=me@xcancerberox.com.ar \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    /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).