Re: [PATCH] platform: x86: int3472: Register a LED lookup table entry for the privacy LED

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

 



On Fri, Feb 24, 2023 at 6:37 PM Hans de Goede <hdegoede@xxxxxxxxxx> wrote:
>
> All currently known models using the tps68470 PMIC have a privacy LED for
> the back sensor (first ACPI consumer dev of the PMIC) connected to the
> ileda output of the PMIC.
>
> Add a LED lookup table entry for this, so that the v4l2-core code turns on
> the LED when streaming from the sensor.

...

>  static int skl_int3472_tps68470_probe(struct i2c_client *client)
>  {

For now and the future improvements you may

    struct device *dev = &client->dev;

>         struct acpi_device *adev = ACPI_COMPANION(&client->dev);

    struct acpi_device *adev = ACPI_COMPANION(dev);

...

> +               ret = skl_int3472_get_sensor_adev_and_name(&client->dev, NULL,
> +                                                          &led_lookup->dev_id);

After above this probably can take only a single line.

> +               if (ret)
> +                       return ret;

...

> +               ret = devm_add_action_or_reset(&client->dev,
> +                                              skl_int3472_tps68470_unregister_led_lookup,
> +                                              led_lookup);

Similar gain.

-- 
With Best Regards,
Andy Shevchenko



[Index of Archives]     [Linux Kernel Development]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux