Re: [PATCH v4 10/11] platform/x86: int3472: Pass tps68470_regulator_platform_data to the tps68470-regulator MFD-cell

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

 



On Mon, Oct 25, 2021 at 12:42 PM Hans de Goede <hdegoede@xxxxxxxxxx> wrote:
>
> Pass tps68470_regulator_platform_data to the tps68470-regulator
> MFD-cell, specifying the voltages of the various regulators and
> tying the regulators to the sensor supplies so that sensors which use
> the TPS68470 can find their regulators.
>
> Since the voltages and supply connections are board-specific, this
> introduces a DMI matches int3472_tps68470_board_data struct which
> contains the necessary per-board info.
>
> This per-board info also includes GPIO lookup information for the
> sensor GPIOs which may be connected to the tps68470 gpios.

gpios --> GPIO lines

...

> +       board_data = int3472_tps68470_get_board_data(dev_name(&client->dev));

> +       if (board_data)

IIRC it's a dup. Below already incorporates this.

> +               gpiod_remove_lookup_table(board_data->tps68470_gpio_lookup_table);

...

> +const struct int3472_tps68470_board_data *int3472_tps68470_get_board_data(const char *dev_name)
> +{
> +       const struct int3472_tps68470_board_data *board_data;
> +       const struct dmi_system_id *match;
> +
> +       match = dmi_first_match(int3472_tps68470_board_data_table);
> +       while (match) {
> +               board_data = match->driver_data;
> +               if (strcmp(board_data->dev_name, dev_name) == 0)
> +                       return board_data;
> +
> +               dmi_first_match(++match);
> +       }
> +
> +       return NULL;

Sounds like a déjà-vu for the code seeing somewhere under sound/soc or so.
Perhaps a TODO for eliminating the dup? (Yes, it's out of scope of this series)

> +}

-- 
With Best Regards,
Andy Shevchenko




[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux