Re: [PATCH v5 RESEND 2/6] leds: rgb: leds-ktd202x: Get device properties through fwnode to support ACPI

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


On Sun, Mar 24, 2024 at 5:02 PM Kate Hsuan <hpa@xxxxxxxxxx> wrote:
> This LED controller also installed on a Xiaomi pad2 and it is a x86
> platform. The original driver is based on device tree and can't be

the device

> used for this ACPI based system. This patch migrated the driver to
> use fwnode to access the properties. Moreover, the fwnode API
> supports device tree so this work won't effect the original


> implementations.


> +       fwnode_for_each_available_child_node(fwnode, child) {
> +               num_channels++;
> +       }

{} are not needed.

>         if (!num_channels || num_channels > chip->num_leds)
>                 return -EINVAL;


> +static int ktd202x_add_led(struct ktd202x *chip,
> +                          struct fwnode_handle *fwnode_color,

Can it be simply fwnode? (Originally it was np, so I assume there is
no name collision)


> +       count = device_get_child_node_count(dev);
>         if (!count || count > chip->num_leds)
>                 return -EINVAL;

> +       fwnode = dev_fwnode(chip->dev);

Why not dev?

> +       if (!fwnode)
> +               return -ENODEV;

This is dead code. Please remove these three lines.


> +       .id_table = ktd202x_id,

Seems to me that you may split the I²C ID table addition into a separate change.

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