<p><b>@benpicco</b> commented on this pull request.</p>

<hr>

<p>In <a href="https://github.com/RIOT-OS/RIOT/pull/8419#discussion_r327197931">drivers/lis2dh12/lis2dh12.c</a>:</p>
<pre style='color:#555'>>      if (_acquire(dev) != BUS_OK) {
-        DEBUG("[lis2dh12] error: unable to acquire SPI bus\n");
+        DEBUG("[lis2dh12] error: unable to acquire the bus\n");
+        return LIS2DH12_NOBUS;
+    }
+
+#ifndef MODULE_LIS2DH12_SPI
+    /* in the current state, the I2C driver expects the bus to be acquired
+     * before the init function is called, so we have to switch order */
</pre>
<p>So why not call <code>_acquire()</code> (and <code>_release()</code>) and inside <code>_init_bus()</code>  and save yourself the code duplication here.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/RIOT-OS/RIOT/pull/8419?email_source=notifications&email_token=ABE7WYE5GCE5E5MICM7A5EDQLDRWTA5CNFSM4ENHQ5K2YY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCFS5GUA#pullrequestreview-291885904">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABE7WYCNKEWAK6QDLSMNV53QLDRWTANCNFSM4ENHQ5KQ">mute the thread</a>.<img src="https://github.com/notifications/beacon/ABE7WYDQ4RTH2KVIH2RQWS3QLDRWTA5CNFSM4ENHQ5K2YY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCFS5GUA.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/RIOT-OS/RIOT/pull/8419?email_source=notifications\u0026email_token=ABE7WYE5GCE5E5MICM7A5EDQLDRWTA5CNFSM4ENHQ5K2YY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCFS5GUA#pullrequestreview-291885904",
"url": "https://github.com/RIOT-OS/RIOT/pull/8419?email_source=notifications\u0026email_token=ABE7WYE5GCE5E5MICM7A5EDQLDRWTA5CNFSM4ENHQ5K2YY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCFS5GUA#pullrequestreview-291885904",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>