return ret;
 }
 
-static int calculate_sha256(struct cros_ec_codec_priv *priv,
-                           uint8_t *buf, uint32_t size, uint8_t *digest)
-{
-       struct sha256_state sctx;
-
-       sha256_init(&sctx);
-       sha256_update(&sctx, buf, size);
-       sha256_final(&sctx, digest);
-
-#ifdef DEBUG
-       {
-               char digest_str[65];
-
-               bin2hex(digest_str, digest, 32);
-               digest_str[64] = 0;
-               dev_dbg(priv->dev, "hash=%s\n", digest_str);
-       }
-#endif
-
-       return 0;
-}
-
 static int dmic_get_gain(struct snd_kcontrol *kcontrol,
                         struct snd_ctl_elem_value *ucontrol)
 {
        if (IS_ERR(buf))
                return PTR_ERR(buf);
 
-       ret = calculate_sha256(priv, buf, size, digest);
-       if (ret)
-               goto leave;
+       sha256(buf, size, digest);
+       dev_dbg(priv->dev, "hash=%*phN\n", SHA256_DIGEST_SIZE, digest);
 
        p.cmd = EC_CODEC_WOV_GET_LANG;
        ret = send_ec_host_command(priv->ec_device, EC_CMD_EC_CODEC_WOV,