diff mbox series

[2/4] astbmc/slots: Add SW_PLUGGABLE() macro

Message ID 20180821043752.16679-2-oohall@gmail.com
State Accepted
Headers show
Series [1/4] zaius: Add a slot table | expand

Checks

Context Check Description
snowpatch_ozlabs/apply_patch success master/apply_patch Successfully applied

Commit Message

Oliver O'Halloran Aug. 21, 2018, 4:37 a.m. UTC
Add a macro to help with defining ports that are under a switch. This is
different to the existing ST_PLUGGABLE() macro in that it can be used to
define a slot inside a slot_table_entry array.

Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
---
 platforms/astbmc/astbmc.h | 8 ++++++++
 1 file changed, 8 insertions(+)
diff mbox series

Patch

diff --git a/platforms/astbmc/astbmc.h b/platforms/astbmc/astbmc.h
index fc53d1a10b1e..f8548c57cccd 100644
--- a/platforms/astbmc/astbmc.h
+++ b/platforms/astbmc/astbmc.h
@@ -79,6 +79,14 @@  static struct slot_table_entry st_name[] = \
 	{ .etype = st_end }, \
 }
 
+#define SW_PLUGGABLE(slot_name, port, ...) \
+{ \
+	.etype = st_pluggable_slot, \
+	.name = slot_name, \
+	.location = ST_LOC_DEVFN(port, 0), \
+	##__VA_ARGS__ \
+}
+
 extern const struct bmc_platform astbmc_ami;
 extern const struct bmc_platform astbmc_openbmc;