<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p>Hi Mark & Olivier:<br>
    </p>
    <div class="moz-cite-prefix">On 2022/5/24 2:57, Mark Brown wrote:<br>
    </div>
    <blockquote type="cite" cite="mid:YovZAf4S0XphBsco@sirena.org.uk">
      <pre class="moz-quote-pre" wrap="">On Mon, May 23, 2022 at 03:28:48PM +0200, Olivier MOYSAN wrote:

</pre>
      <blockquote type="cite">
        <pre class="moz-quote-pre" wrap="">The current patch requires a change in the driver.
Either changing STM_SAI_x_ID enums, or replacing data by a struct.
For instance:
struct stm32_sai_comp_data {
        unsigned int id;
}
struct stm32_sai_comp_data stm32_sai_comp_data_a = {
        .id = STM_SAI_A_ID;
}
struct of_device_id stm32_sai_sub_ids[] = {
        .data = &stm32_sai_comp_data_a},
}
</pre>
      </blockquote>
      <pre class="moz-quote-pre" wrap="">
Either approach works for me (or a revert for that matter).</pre>
    </blockquote>
    <p>    Thanks for your advice, I was thoughtless.</p>
    <p>    I think change the date of STM_SAI_x_ID maybe simple. But if
      we don't change the id,</p>
    <p>what about add a "#define" like the line 47:</p>
    <p>#define STM_SAI_IS_SUB(x) ((x)->id == STM_SAI_A_ID ||
      (x)->id == STM_SAI_B_ID)</p>
    <p>then in the judgement, wu use:</p>
    <p><span style="color: rgb(128, 128, 128); font-family: 微软雅黑;
        font-size: 14px; font-style: normal; font-variant: normal;
        font-weight: normal; letter-spacing: normal; line-height:
        normal; orphans: auto; text-align: start; text-indent: 0px;
        text-transform: none; white-space: normal; widows: 1;
        word-spacing: 0px; -webkit-text-stroke-width: 0px; display:
        inline !important; float: none; background-color: rgb(255, 255,
        255);">    sai->id =
        (uintptr_t)of_device_get_match_data(&pdev->dev);</span></p>
    <p><span style="color: rgb(128, 128, 128); font-family: 微软雅黑;
        font-size: 14px; font-style: normal; font-variant: normal;
        font-weight: normal; letter-spacing: normal; line-height:
        normal; orphans: auto; text-align: start; text-indent: 0px;
        text-transform: none; white-space: normal; widows: 1;
        word-spacing: 0px; -webkit-text-stroke-width: 0px; display:
        inline !important; float: none; background-color: rgb(255, 255,
        255);">    if (!STM_SAI_IS_SUB(sai))</span></p>
    <p><span style="color: rgb(128, 128, 128); font-family: 微软雅黑;
        font-size: 14px; font-style: normal; font-variant: normal;
        font-weight: normal; letter-spacing: normal; line-height:
        normal; orphans: auto; text-align: start; text-indent: 0px;
        text-transform: none; white-space: normal; widows: 1;
        word-spacing: 0px; -webkit-text-stroke-width: 0px; display:
        inline !important; float: none; background-color: rgb(255, 255,
        255);">            return -EINVAL;<br>
      </span></p>
    <p><br>
    </p>
    <p>if you think that's ok, I will send patch v2 for you .</p>
    <p>Thanks</p>
    <p>Tang Bin<br>
    </p>
    <blockquote type="cite" cite="mid:YovZAf4S0XphBsco@sirena.org.uk">
      <pre class="moz-quote-pre" wrap="">
</pre>
    </blockquote>
  </body>
</html>