Re: [PATCH] iio: proximity: sx9310: Convert enum->pointer for match data table

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

 



On Sat, Aug 12, 2023 at 4:01 PM Biju Das <biju.das.jz@xxxxxxxxxxxxxx> wrote:
>
> Convert enum->pointer for data in match data table, so that
> device_get_match_data() can do match against OF/ACPI/I2C tables, once i2c
> bus type match support added to it.
>
> Add struct sx931x_info and replace enum->sx931x_info in the match table
> and simplify sx9310_check_whoami().

...

> +       ddata = device_get_match_data(dev);
> +       if (ddata->whoami != whoami)
>                 return -EINVAL;

-ENODEV looks better.

...

> +static const struct sx931x_info sx9310_info = {
> +       .name = "sx9310",
> +       .whoami = SX9310_WHOAMI_VALUE

Keep trailing comma.

> +};
> +
> +static const struct sx931x_info sx9311_info = {
> +       .name = "sx9311",
> +       .whoami = SX9311_WHOAMI_VALUE

Ditto.

> +};

...

Otherwise looks good to me
Reviewed-by: Andy Shevchenko <andy.shevchenko@xxxxxxxxx>

-- 
With Best Regards,
Andy Shevchenko




[Index of Archives]     [Linux Samsung SOC]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux