linguini1 opened a new issue, #19293:
URL: https://github.com/apache/nuttx/issues/19293

   ### Description / Steps to reproduce the issue
   
   One example is the following part of the interface:
   
   ```c
   /****************************************************************************
    * Name: I2S_SETMCLKFREQUENCY
    *
    * Description:
    *   Set the master clock frequency. Usually, the MCLK is a multiple of the
    *   sample rate. Most of the audio codecs require setting specific MCLK
    *   frequency according to the sample rate. NOTE: this parameter may not
    *   be implemented on I2S driver. If not implemented, the I2S may set
    *   internally any value to the master clock (or even does not support it).
    *
    * Input Parameters:
    *   dev        - Device-specific state data
    *   frequency  - The I2S master clock's frequency
    *
    * Returned Value:
    *   Returns the resulting master clock or a negated errno value on failure.
    *
    
****************************************************************************/
   
   #define I2S_SETMCLKFREQUENCY(d,f) \
     ((d)->ops->i2s_setmclkfrequency ? \
      (d)->ops->i2s_setmclkfrequency(d,f) : -ENOTTY)
   ```
   
   The function `i2s_setmclkfrequency` should be capable of returning a negated 
error code. However, the function signature is as follows:
   
   ```c
     /* Master Clock methods */
   
     CODE uint32_t (*i2s_getmclkfrequency)(FAR struct i2s_dev_s *dev);
     CODE uint32_t (*i2s_setmclkfrequency)(FAR struct i2s_dev_s *dev,
                                           uint32_t frequency);
   ```
   
   A `uint32_t` is never capable of returning a negated error code.
   
   ### On which OS does this issue occur?
   
   [OS: Linux]
   
   ### What is the version of your OS?
   
   Arch Linux
   
   ### NuttX Version
   
   master
   
   ### Issue Architecture
   
   [Arch: all]
   
   ### Issue Area
   
   [Area: Drivers]
   
   ### Host information
   
   _No response_
   
   ### Verification
   
   - [x] I have verified before submitting the report.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to