Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 7 Apr 2018 20:34:57 +0000 (UTC)
From:      Ian Lepore <ian@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r332231 - head/sys/dev/spibus
Message-ID:  <201804072034.w37KYve9093719@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ian
Date: Sat Apr  7 20:34:57 2018
New Revision: 332231
URL: https://svnweb.freebsd.org/changeset/base/332231

Log:
  Generate a spibus_set_[ivarname]() convenience function for each ivar,
  now that they can be set.

Modified:
  head/sys/dev/spibus/spibusvar.h

Modified: head/sys/dev/spibus/spibusvar.h
==============================================================================
--- head/sys/dev/spibus/spibusvar.h	Sat Apr  7 20:34:03 2018	(r332230)
+++ head/sys/dev/spibus/spibusvar.h	Sat Apr  7 20:34:57 2018	(r332231)
@@ -60,8 +60,14 @@ spibus_get_ ## A(device_t dev, T *t)					\
 {									\
 	return BUS_READ_IVAR(device_get_parent(dev), dev,		\
 	    SPIBUS_IVAR_ ## B, (uintptr_t *) t);			\
+}									\
+static inline int							\
+spibus_set_ ## A(device_t dev, T t)					\
+{									\
+	return BUS_WRITE_IVAR(device_get_parent(dev), dev,		\
+	    SPIBUS_IVAR_ ## B, (uintptr_t) t);			\
 }
-	
+
 SPIBUS_ACCESSOR(cs,		CS,		uint32_t)
 SPIBUS_ACCESSOR(mode,		MODE,		uint32_t)
 SPIBUS_ACCESSOR(clock,		CLOCK,		uint32_t)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201804072034.w37KYve9093719>