Re: [PATCH v4 06/10] iio: magnetometer: yas530: Rename functions and registers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Jul 4, 2022 at 12:03 AM Jakob Hauser <jahau@xxxxxxxxxxxxxx> wrote:
>
> This is a preparation for adding YAS537 variant.
>
> Functions that are used only by YAS530, YAS532 and YAS533 are renamed from
> yas5xx to yas530. Same for the registers.
>
> To avoid part listing in function and registers names, the name of the first
> variant is used. Where appropriate, comments were added that these functions
> are used by more than one variant.
>
> Functions that will be used by all variants including YAS537 remain in the
> naming scheme yas5xx. Or YAS5XX for registers, respectively.

...

>  /**
> - * yas5xx_measure() - Make a measure from the hardware
> + * yas530_measure() - Make a measure from the hardware
>   * @yas5xx: The device state
>   * @t: the raw temperature measurement
>   * @x: the raw x axis measurement
> @@ -190,7 +192,8 @@ static u16 yas532_extract_axis(u8 *data)
>   * @y2: the y2 axis measurement
>   * @return: 0 on success or error code
>   */
> -static int yas5xx_measure(struct yas5xx *yas5xx, u16 *t, u16 *x, u16 *y1, u16 *y2)
> +/* Used by YAS530, YAS532 and YAS533 */

Why a separate comment and not embedded into the kernel doc above?

> +static int yas530_measure(struct yas5xx *yas5xx, u16 *t, u16 *x, u16 *y1, u16 *y2)

...

>  /**
> - * yas5xx_get_measure() - Measure a sample of all axis and process
> + * yas530_get_measure() - Measure a sample of all axis and process
>   * @yas5xx: The device state
>   * @to: Temperature out
>   * @xo: X axis out
> @@ -314,7 +318,8 @@ static s32 yas5xx_linearize(struct yas5xx *yas5xx, u16 val, int axis)
>   * @zo: Z axis out
>   * @return: 0 on success or error code
>   */
> -static int yas5xx_get_measure(struct yas5xx *yas5xx, s32 *to, s32 *xo, s32 *yo, s32 *zo)
> +/* Used by YAS530, YAS532 and YAS533 */

Ditto.

> +static int yas530_get_measure(struct yas5xx *yas5xx, s32 *to, s32 *xo, s32 *yo, s32 *zo)

...

>  /**
> - * yas53x_extract_calibration() - extracts the a2-a9 and k calibration
> + * yas530_extract_calibration() - extracts the a2-a9 and k calibration
>   * @data: the bitfield to use
>   * @c: the calibration to populate
>   */
> -static void yas53x_extract_calibration(u8 *data, struct yas5xx_calibration *c)
> +/* Used by YAS530, YAS532 and YAS533 */

Ditto.

> +static void yas530_extract_calibration(u8 *data, struct yas5xx_calibration *c)

-- 
With Best Regards,
Andy Shevchenko



[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux