Re: [RFC PATCH 3/6] i2c: aspeed: switch to generic fw properties.

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

 



On Thu, May 25, 2023 at 6:23 PM Jonathan Cameron
<Jonathan.Cameron@xxxxxxxxxx> wrote:
>
> Not tested on device tree but works nicely for ACPI :)

Needs a better commit message obviously :-)

...

> -       ret = of_property_read_u32(pdev->dev.of_node,
> +       ret = device_property_read_u32(&pdev->dev,
>                                    "bus-frequency", &bus->bus_frequency);

Oh, please avoid double effort, i.e. go further and use I²C core APIs
for the timings. Oh, wait, do they use non-standard property?!

...

> +       bus->get_clk_reg_val = (u32 (*)(struct device *, u32))
> +               device_get_match_data(&pdev->dev);

Personally I prefer using pointers in driver_data so we can avoid
ambiguity for the 0/NULL value returned by this call. But if 0 value
is considered invalid here, it's probably fine.

> +       if (!bus->get_clk_reg_val)
>                 bus->get_clk_reg_val = aspeed_i2c_24xx_get_clk_reg_val;
> -       else
> -               bus->get_clk_reg_val = (u32 (*)(struct device *, u32))
> -                               match->data;


-- 
With Best Regards,
Andy Shevchenko




[Index of Archives]     [Linux IBM ACPI]     [Linux Power Management]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]
  Powered by Linux